├── .github ├── CODE_OF_CONDUCT.md └── CONTRIBUTING.md ├── LICENSE ├── README.md ├── rewind ├── README.md └── gh-mysql-rewind └── skeefree ├── .github ├── skeema-diff.cfg └── workflows │ └── skeema-diff.yml ├── .gitignore ├── LICENSE ├── README.md ├── config ├── kubernetes │ └── default │ │ ├── deployments │ │ └── skeefree.yaml │ │ └── services │ │ └── skeefree.yaml └── moda │ └── deployment.yaml ├── docs ├── adding-repository.md ├── chatops.md ├── how-action.md ├── how-gh-ost.md ├── how-skeefree.md ├── how.md └── migrations.md ├── go ├── app │ ├── api.go │ ├── application.go │ ├── chatops.go │ ├── cli.go │ ├── direct_applier.go │ ├── logic.go │ ├── scheduler.go │ ├── scheduler_test.go │ ├── special_mapping.go │ └── special_mapping_test.go ├── cmd │ └── skeefree │ │ └── main.go ├── config │ └── config.go ├── core │ ├── cluster_schema_map.go │ ├── migration.go │ ├── migration_test.go │ ├── parse.go │ ├── parse_test.go │ ├── pull_request.go │ ├── pull_request_migration_statement.go │ ├── pull_request_test.go │ ├── repo_production_mapping.go │ ├── repository.go │ ├── repository_test.go │ ├── utils.go │ └── utils_test.go ├── db │ ├── backend.go │ └── topology.go ├── gh │ ├── http.go │ ├── mysql_discovery_api.go │ └── sites_api.go ├── ghapi │ ├── api.go │ └── client.go └── util │ ├── text.go │ ├── text_test.go │ └── token.go ├── schema ├── .skeema └── skeefree │ ├── .skeema │ ├── migrations.sql │ ├── pull_request_migration_statements.sql │ ├── pull_requests.sql │ ├── repo_production_mapping.sql │ ├── repositories.sql │ └── service_election.sql ├── script ├── bootstrap ├── build ├── cibuild ├── dep ├── localserver.sh ├── release ├── revision ├── server ├── skeefree.sh └── test └── vendor ├── github.com ├── cenk │ └── backoff │ │ ├── LICENSE │ │ ├── backoff.go │ │ ├── context.go │ │ ├── exponential.go │ │ ├── retry.go │ │ ├── ticker.go │ │ └── tries.go ├── facebookgo │ └── clock │ │ ├── LICENSE │ │ └── clock.go ├── go-sql-driver │ └── mysql │ │ ├── .github │ │ ├── ISSUE_TEMPLATE.md │ │ └── PULL_REQUEST_TEMPLATE.md │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── .travis │ │ ├── docker.cnf │ │ ├── gofmt.sh │ │ └── wait_mysql.sh │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appengine.go │ │ ├── auth.go │ │ ├── auth_test.go │ │ ├── benchmark_test.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── connection.go │ │ ├── connection_test.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── driver_test.go │ │ ├── dsn.go │ │ ├── dsn_test.go │ │ ├── errors.go │ │ ├── errors_test.go │ │ ├── fields.go │ │ ├── infile.go │ │ ├── packets.go │ │ ├── packets_test.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── statement_test.go │ │ ├── transaction.go │ │ ├── utils.go │ │ └── utils_test.go ├── golang │ └── protobuf │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── proto │ │ ├── clone.go │ │ ├── decode.go │ │ ├── encode.go │ │ ├── equal.go │ │ ├── extensions.go │ │ ├── lib.go │ │ ├── message_set.go │ │ ├── pointer_reflect.go │ │ ├── pointer_unsafe.go │ │ ├── properties.go │ │ ├── text.go │ │ └── text_parser.go │ │ ├── protoc-gen-go │ │ └── descriptor │ │ │ └── descriptor.pb.go │ │ └── ptypes │ │ ├── any.go │ │ ├── any │ │ └── any.pb.go │ │ ├── doc.go │ │ ├── duration.go │ │ ├── duration │ │ └── duration.pb.go │ │ ├── timestamp.go │ │ └── timestamp │ │ └── timestamp.pb.go ├── google │ ├── go-github │ │ └── github │ │ │ ├── activity.go │ │ │ ├── activity_events.go │ │ │ ├── activity_events_test.go │ │ │ ├── activity_notifications.go │ │ │ ├── activity_notifications_test.go │ │ │ ├── activity_star.go │ │ │ ├── activity_star_test.go │ │ │ ├── activity_test.go │ │ │ ├── activity_watching.go │ │ │ ├── activity_watching_test.go │ │ │ ├── admin.go │ │ │ ├── admin_orgs.go │ │ │ ├── admin_orgs_test.go │ │ │ ├── admin_stats.go │ │ │ ├── admin_stats_test.go │ │ │ ├── admin_test.go │ │ │ ├── admin_users.go │ │ │ ├── admin_users_test.go │ │ │ ├── apps.go │ │ │ ├── apps_installation.go │ │ │ ├── apps_installation_test.go │ │ │ ├── apps_marketplace.go │ │ │ ├── apps_marketplace_test.go │ │ │ ├── apps_test.go │ │ │ ├── authorizations.go │ │ │ ├── authorizations_test.go │ │ │ ├── checks.go │ │ │ ├── checks_test.go │ │ │ ├── doc.go │ │ │ ├── event.go │ │ │ ├── event_types.go │ │ │ ├── examples_test.go │ │ │ ├── gen-accessors.go │ │ │ ├── gen-stringify-test.go │ │ │ ├── gists.go │ │ │ ├── gists_comments.go │ │ │ ├── gists_comments_test.go │ │ │ ├── gists_test.go │ │ │ ├── git.go │ │ │ ├── git_blobs.go │ │ │ ├── git_blobs_test.go │ │ │ ├── git_commits.go │ │ │ ├── git_commits_test.go │ │ │ ├── git_refs.go │ │ │ ├── git_refs_test.go │ │ │ ├── git_tags.go │ │ │ ├── git_tags_test.go │ │ │ ├── git_trees.go │ │ │ ├── git_trees_test.go │ │ │ ├── github-accessors.go │ │ │ ├── github-stringify_test.go │ │ │ ├── github.go │ │ │ ├── github_test.go │ │ │ ├── gitignore.go │ │ │ ├── gitignore_test.go │ │ │ ├── interactions.go │ │ │ ├── interactions_orgs.go │ │ │ ├── interactions_orgs_test.go │ │ │ ├── interactions_repos.go │ │ │ ├── interactions_repos_test.go │ │ │ ├── issues.go │ │ │ ├── issues_assignees.go │ │ │ ├── issues_assignees_test.go │ │ │ ├── issues_comments.go │ │ │ ├── issues_comments_test.go │ │ │ ├── issues_events.go │ │ │ ├── issues_events_test.go │ │ │ ├── issues_labels.go │ │ │ ├── issues_labels_test.go │ │ │ ├── issues_milestones.go │ │ │ ├── issues_milestones_test.go │ │ │ ├── issues_test.go │ │ │ ├── issues_timeline.go │ │ │ ├── issues_timeline_test.go │ │ │ ├── licenses.go │ │ │ ├── licenses_test.go │ │ │ ├── messages.go │ │ │ ├── messages_test.go │ │ │ ├── migrations.go │ │ │ ├── migrations_source_import.go │ │ │ ├── migrations_source_import_test.go │ │ │ ├── migrations_test.go │ │ │ ├── migrations_user.go │ │ │ ├── migrations_user_test.go │ │ │ ├── misc.go │ │ │ ├── misc_test.go │ │ │ ├── orgs.go │ │ │ ├── orgs_hooks.go │ │ │ ├── orgs_hooks_test.go │ │ │ ├── orgs_members.go │ │ │ ├── orgs_members_test.go │ │ │ ├── orgs_outside_collaborators.go │ │ │ ├── orgs_outside_collaborators_test.go │ │ │ ├── orgs_projects.go │ │ │ ├── orgs_projects_test.go │ │ │ ├── orgs_test.go │ │ │ ├── orgs_users_blocking.go │ │ │ ├── orgs_users_blocking_test.go │ │ │ ├── projects.go │ │ │ ├── projects_test.go │ │ │ ├── pulls.go │ │ │ ├── pulls_comments.go │ │ │ ├── pulls_comments_test.go │ │ │ ├── pulls_reviewers.go │ │ │ ├── pulls_reviewers_test.go │ │ │ ├── pulls_reviews.go │ │ │ ├── pulls_reviews_test.go │ │ │ ├── pulls_test.go │ │ │ ├── reactions.go │ │ │ ├── reactions_test.go │ │ │ ├── repos.go │ │ │ ├── repos_collaborators.go │ │ │ ├── repos_collaborators_test.go │ │ │ ├── repos_comments.go │ │ │ ├── repos_comments_test.go │ │ │ ├── repos_commits.go │ │ │ ├── repos_commits_test.go │ │ │ ├── repos_community_health.go │ │ │ ├── repos_community_health_test.go │ │ │ ├── repos_contents.go │ │ │ ├── repos_contents_test.go │ │ │ ├── repos_deployments.go │ │ │ ├── repos_deployments_test.go │ │ │ ├── repos_forks.go │ │ │ ├── repos_forks_test.go │ │ │ ├── repos_hooks.go │ │ │ ├── repos_hooks_test.go │ │ │ ├── repos_invitations.go │ │ │ ├── repos_invitations_test.go │ │ │ ├── repos_keys.go │ │ │ ├── repos_keys_test.go │ │ │ ├── repos_merging.go │ │ │ ├── repos_merging_test.go │ │ │ ├── repos_pages.go │ │ │ ├── repos_pages_test.go │ │ │ ├── repos_prereceive_hooks.go │ │ │ ├── repos_prereceive_hooks_test.go │ │ │ ├── repos_projects.go │ │ │ ├── repos_projects_test.go │ │ │ ├── repos_releases.go │ │ │ ├── repos_releases_test.go │ │ │ ├── repos_stats.go │ │ │ ├── repos_stats_test.go │ │ │ ├── repos_statuses.go │ │ │ ├── repos_statuses_test.go │ │ │ ├── repos_test.go │ │ │ ├── repos_traffic.go │ │ │ ├── repos_traffic_test.go │ │ │ ├── search.go │ │ │ ├── search_test.go │ │ │ ├── strings.go │ │ │ ├── strings_test.go │ │ │ ├── teams.go │ │ │ ├── teams_discussion_comments.go │ │ │ ├── teams_discussion_comments_test.go │ │ │ ├── teams_discussions.go │ │ │ ├── teams_discussions_test.go │ │ │ ├── teams_members.go │ │ │ ├── teams_members_test.go │ │ │ ├── teams_test.go │ │ │ ├── timestamp.go │ │ │ ├── timestamp_test.go │ │ │ ├── users.go │ │ │ ├── users_administration.go │ │ │ ├── users_administration_test.go │ │ │ ├── users_blocking.go │ │ │ ├── users_blocking_test.go │ │ │ ├── users_emails.go │ │ │ ├── users_emails_test.go │ │ │ ├── users_followers.go │ │ │ ├── users_followers_test.go │ │ │ ├── users_gpg_keys.go │ │ │ ├── users_gpg_keys_test.go │ │ │ ├── users_keys.go │ │ │ ├── users_keys_test.go │ │ │ ├── users_test.go │ │ │ ├── with_appengine.go │ │ │ └── without_appengine.go │ └── go-querystring │ │ ├── LICENSE │ │ └── query │ │ └── encode.go ├── jmoiron │ └── sqlx │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bind.go │ │ ├── doc.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── named.go │ │ ├── named_context.go │ │ ├── named_context_test.go │ │ ├── named_test.go │ │ ├── reflectx │ │ ├── README.md │ │ ├── reflect.go │ │ └── reflect_test.go │ │ ├── sqlx.go │ │ ├── sqlx_context.go │ │ ├── sqlx_context_test.go │ │ ├── sqlx_test.go │ │ └── types │ │ ├── README.md │ │ ├── types.go │ │ └── types_test.go ├── openark │ └── golib │ │ └── tests │ │ └── spec.go ├── opentracing │ └── opentracing-go │ │ ├── LICENSE │ │ ├── ext │ │ └── tags.go │ │ ├── globaltracer.go │ │ ├── gocontext.go │ │ ├── log │ │ ├── field.go │ │ └── util.go │ │ ├── noop.go │ │ ├── propagation.go │ │ ├── span.go │ │ └── tracer.go ├── patrickmn │ └── go-cache │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cache.go │ │ ├── cache_test.go │ │ ├── sharded.go │ │ └── sharded_test.go ├── pressly │ └── chi │ │ ├── LICENSE │ │ ├── chain.go │ │ ├── chi.go │ │ ├── context.go │ │ ├── mux.go │ │ └── tree.go ├── rubyist │ └── circuitbreaker │ │ ├── LICENSE │ │ ├── circuitbreaker.go │ │ ├── client.go │ │ ├── panel.go │ │ └── window.go ├── soheilhy │ └── cmux │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── buffer.go │ │ ├── cmux.go │ │ ├── doc.go │ │ ├── matchers.go │ │ └── patricia.go └── streadway │ └── simpleuuid │ └── uuid.go ├── golang.org └── x │ ├── crypto │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README.md │ ├── acme │ │ ├── acme.go │ │ ├── acme_test.go │ │ ├── autocert │ │ │ ├── autocert.go │ │ │ ├── autocert_test.go │ │ │ ├── cache.go │ │ │ ├── cache_test.go │ │ │ ├── example_test.go │ │ │ ├── internal │ │ │ │ └── acmetest │ │ │ │ │ └── ca.go │ │ │ ├── listener.go │ │ │ ├── renewal.go │ │ │ └── renewal_test.go │ │ ├── http.go │ │ ├── http_test.go │ │ ├── jws.go │ │ ├── jws_test.go │ │ ├── types.go │ │ ├── types_test.go │ │ └── version_go112.go │ ├── argon2 │ │ ├── argon2.go │ │ ├── argon2_test.go │ │ ├── blake2b.go │ │ ├── blamka_amd64.go │ │ ├── blamka_amd64.s │ │ ├── blamka_generic.go │ │ └── blamka_ref.go │ ├── bcrypt │ │ ├── base64.go │ │ ├── bcrypt.go │ │ └── bcrypt_test.go │ ├── blake2b │ │ ├── blake2b.go │ │ ├── blake2bAVX2_amd64.go │ │ ├── blake2bAVX2_amd64.s │ │ ├── blake2b_amd64.go │ │ ├── blake2b_amd64.s │ │ ├── blake2b_generic.go │ │ ├── blake2b_ref.go │ │ ├── blake2b_test.go │ │ ├── blake2x.go │ │ └── register.go │ ├── blake2s │ │ ├── blake2s.go │ │ ├── blake2s_386.go │ │ ├── blake2s_386.s │ │ ├── blake2s_amd64.go │ │ ├── blake2s_amd64.s │ │ ├── blake2s_generic.go │ │ ├── blake2s_ref.go │ │ ├── blake2s_test.go │ │ ├── blake2x.go │ │ └── register.go │ ├── blowfish │ │ ├── block.go │ │ ├── blowfish_test.go │ │ ├── cipher.go │ │ └── const.go │ ├── bn256 │ │ ├── bn256.go │ │ ├── bn256_test.go │ │ ├── constants.go │ │ ├── curve.go │ │ ├── example_test.go │ │ ├── gfp12.go │ │ ├── gfp2.go │ │ ├── gfp6.go │ │ ├── optate.go │ │ └── twist.go │ ├── cast5 │ │ ├── cast5.go │ │ └── cast5_test.go │ ├── chacha20poly1305 │ │ ├── chacha20poly1305.go │ │ ├── chacha20poly1305_amd64.go │ │ ├── chacha20poly1305_amd64.s │ │ ├── chacha20poly1305_generic.go │ │ ├── chacha20poly1305_noasm.go │ │ ├── chacha20poly1305_test.go │ │ ├── chacha20poly1305_vectors_test.go │ │ └── xchacha20poly1305.go │ ├── codereview.cfg │ ├── cryptobyte │ │ ├── asn1.go │ │ ├── asn1 │ │ │ └── asn1.go │ │ ├── asn1_test.go │ │ ├── builder.go │ │ ├── cryptobyte_test.go │ │ ├── example_test.go │ │ └── string.go │ ├── curve25519 │ │ ├── const_amd64.h │ │ ├── const_amd64.s │ │ ├── cswap_amd64.s │ │ ├── curve25519.go │ │ ├── curve25519_test.go │ │ ├── doc.go │ │ ├── freeze_amd64.s │ │ ├── ladderstep_amd64.s │ │ ├── mont25519_amd64.go │ │ ├── mul_amd64.s │ │ ├── square_amd64.s │ │ └── testvectors_test.go │ ├── ed25519 │ │ ├── ed25519.go │ │ ├── ed25519_go113.go │ │ ├── ed25519_test.go │ │ ├── go113_test.go │ │ ├── internal │ │ │ └── edwards25519 │ │ │ │ ├── const.go │ │ │ │ └── edwards25519.go │ │ └── testdata │ │ │ └── sign.input.gz │ ├── go.mod │ ├── go.sum │ ├── hkdf │ │ ├── example_test.go │ │ ├── hkdf.go │ │ └── hkdf_test.go │ ├── internal │ │ ├── chacha20 │ │ │ ├── asm_arm64.s │ │ │ ├── asm_ppc64le.s │ │ │ ├── chacha_arm64.go │ │ │ ├── chacha_generic.go │ │ │ ├── chacha_noasm.go │ │ │ ├── chacha_ppc64le.go │ │ │ ├── chacha_s390x.go │ │ │ ├── chacha_s390x.s │ │ │ ├── chacha_test.go │ │ │ ├── vectors_test.go │ │ │ └── xor.go │ │ └── subtle │ │ │ ├── aliasing.go │ │ │ ├── aliasing_appengine.go │ │ │ └── aliasing_test.go │ ├── md4 │ │ ├── example_test.go │ │ ├── md4.go │ │ ├── md4_test.go │ │ └── md4block.go │ ├── nacl │ │ ├── auth │ │ │ ├── auth.go │ │ │ ├── auth_test.go │ │ │ └── example_test.go │ │ ├── box │ │ │ ├── box.go │ │ │ ├── box_test.go │ │ │ └── example_test.go │ │ ├── secretbox │ │ │ ├── example_test.go │ │ │ ├── secretbox.go │ │ │ └── secretbox_test.go │ │ └── sign │ │ │ ├── sign.go │ │ │ └── sign_test.go │ ├── ocsp │ │ ├── ocsp.go │ │ └── ocsp_test.go │ ├── openpgp │ │ ├── armor │ │ │ ├── armor.go │ │ │ ├── armor_test.go │ │ │ └── encode.go │ │ ├── canonical_text.go │ │ ├── canonical_text_test.go │ │ ├── clearsign │ │ │ ├── clearsign.go │ │ │ └── clearsign_test.go │ │ ├── elgamal │ │ │ ├── elgamal.go │ │ │ └── elgamal_test.go │ │ ├── errors │ │ │ └── errors.go │ │ ├── keys.go │ │ ├── keys_data_test.go │ │ ├── keys_test.go │ │ ├── packet │ │ │ ├── compressed.go │ │ │ ├── compressed_test.go │ │ │ ├── config.go │ │ │ ├── encrypted_key.go │ │ │ ├── encrypted_key_test.go │ │ │ ├── literal.go │ │ │ ├── ocfb.go │ │ │ ├── ocfb_test.go │ │ │ ├── one_pass_signature.go │ │ │ ├── opaque.go │ │ │ ├── opaque_test.go │ │ │ ├── packet.go │ │ │ ├── packet_test.go │ │ │ ├── private_key.go │ │ │ ├── private_key_test.go │ │ │ ├── public_key.go │ │ │ ├── public_key_test.go │ │ │ ├── public_key_v3.go │ │ │ ├── public_key_v3_test.go │ │ │ ├── reader.go │ │ │ ├── signature.go │ │ │ ├── signature_test.go │ │ │ ├── signature_v3.go │ │ │ ├── signature_v3_test.go │ │ │ ├── symmetric_key_encrypted.go │ │ │ ├── symmetric_key_encrypted_test.go │ │ │ ├── symmetrically_encrypted.go │ │ │ ├── symmetrically_encrypted_test.go │ │ │ ├── userattribute.go │ │ │ ├── userattribute_test.go │ │ │ ├── userid.go │ │ │ └── userid_test.go │ │ ├── read.go │ │ ├── read_test.go │ │ ├── s2k │ │ │ ├── s2k.go │ │ │ └── s2k_test.go │ │ ├── write.go │ │ └── write_test.go │ ├── otr │ │ ├── libotr_test_helper.c │ │ ├── otr.go │ │ ├── otr_test.go │ │ └── smp.go │ ├── pbkdf2 │ │ ├── pbkdf2.go │ │ └── pbkdf2_test.go │ ├── pkcs12 │ │ ├── bmp-string.go │ │ ├── bmp-string_test.go │ │ ├── crypto.go │ │ ├── crypto_test.go │ │ ├── errors.go │ │ ├── internal │ │ │ └── rc2 │ │ │ │ ├── bench_test.go │ │ │ │ ├── rc2.go │ │ │ │ └── rc2_test.go │ │ ├── mac.go │ │ ├── mac_test.go │ │ ├── pbkdf.go │ │ ├── pbkdf_test.go │ │ ├── pkcs12.go │ │ ├── pkcs12_test.go │ │ └── safebags.go │ ├── poly1305 │ │ ├── mac_noasm.go │ │ ├── poly1305.go │ │ ├── poly1305_test.go │ │ ├── sum_amd64.go │ │ ├── sum_amd64.s │ │ ├── sum_arm.go │ │ ├── sum_arm.s │ │ ├── sum_generic.go │ │ ├── sum_noasm.go │ │ ├── sum_ppc64le.go │ │ ├── sum_ppc64le.s │ │ ├── sum_s390x.go │ │ ├── sum_s390x.s │ │ ├── sum_vmsl_s390x.s │ │ └── vectors_test.go │ ├── ripemd160 │ │ ├── ripemd160.go │ │ ├── ripemd160_test.go │ │ └── ripemd160block.go │ ├── salsa20 │ │ ├── salsa │ │ │ ├── hsalsa20.go │ │ │ ├── salsa208.go │ │ │ ├── salsa20_amd64.go │ │ │ ├── salsa20_amd64.s │ │ │ ├── salsa20_amd64_test.go │ │ │ ├── salsa20_noasm.go │ │ │ ├── salsa20_ref.go │ │ │ └── salsa_test.go │ │ ├── salsa20.go │ │ └── salsa20_test.go │ ├── scrypt │ │ ├── example_test.go │ │ ├── scrypt.go │ │ └── scrypt_test.go │ ├── sha3 │ │ ├── doc.go │ │ ├── hashes.go │ │ ├── hashes_generic.go │ │ ├── keccakf.go │ │ ├── keccakf_amd64.go │ │ ├── keccakf_amd64.s │ │ ├── register.go │ │ ├── sha3.go │ │ ├── sha3_s390x.go │ │ ├── sha3_s390x.s │ │ ├── sha3_test.go │ │ ├── shake.go │ │ ├── shake_generic.go │ │ ├── testdata │ │ │ └── keccakKats.json.deflate │ │ ├── xor.go │ │ ├── xor_generic.go │ │ └── xor_unaligned.go │ ├── ssh │ │ ├── agent │ │ │ ├── client.go │ │ │ ├── client_test.go │ │ │ ├── example_test.go │ │ │ ├── forward.go │ │ │ ├── keyring.go │ │ │ ├── keyring_test.go │ │ │ ├── server.go │ │ │ ├── server_test.go │ │ │ └── testdata_test.go │ │ ├── benchmark_test.go │ │ ├── buffer.go │ │ ├── buffer_test.go │ │ ├── certs.go │ │ ├── certs_test.go │ │ ├── channel.go │ │ ├── cipher.go │ │ ├── cipher_test.go │ │ ├── client.go │ │ ├── client_auth.go │ │ ├── client_auth_test.go │ │ ├── client_test.go │ │ ├── common.go │ │ ├── common_test.go │ │ ├── connection.go │ │ ├── doc.go │ │ ├── example_test.go │ │ ├── handshake.go │ │ ├── handshake_test.go │ │ ├── kex.go │ │ ├── kex_test.go │ │ ├── keys.go │ │ ├── keys_test.go │ │ ├── knownhosts │ │ │ ├── knownhosts.go │ │ │ └── knownhosts_test.go │ │ ├── mac.go │ │ ├── mempipe_test.go │ │ ├── messages.go │ │ ├── messages_test.go │ │ ├── mux.go │ │ ├── mux_test.go │ │ ├── server.go │ │ ├── session.go │ │ ├── session_test.go │ │ ├── ssh_gss.go │ │ ├── ssh_gss_test.go │ │ ├── streamlocal.go │ │ ├── tcpip.go │ │ ├── tcpip_test.go │ │ ├── terminal │ │ │ ├── terminal.go │ │ │ ├── terminal_test.go │ │ │ ├── util.go │ │ │ ├── util_aix.go │ │ │ ├── util_bsd.go │ │ │ ├── util_linux.go │ │ │ ├── util_plan9.go │ │ │ ├── util_solaris.go │ │ │ └── util_windows.go │ │ ├── test │ │ │ ├── agent_unix_test.go │ │ │ ├── banner_test.go │ │ │ ├── cert_test.go │ │ │ ├── dial_unix_test.go │ │ │ ├── doc.go │ │ │ ├── forward_unix_test.go │ │ │ ├── multi_auth_test.go │ │ │ ├── session_test.go │ │ │ ├── sshd_test_pw.c │ │ │ ├── test_unix_test.go │ │ │ └── testdata_test.go │ │ ├── testdata │ │ │ ├── doc.go │ │ │ └── keys.go │ │ ├── testdata_test.go │ │ ├── transport.go │ │ └── transport_test.go │ ├── tea │ │ ├── cipher.go │ │ └── tea_test.go │ ├── twofish │ │ ├── twofish.go │ │ └── twofish_test.go │ ├── xtea │ │ ├── block.go │ │ ├── cipher.go │ │ └── xtea_test.go │ └── xts │ │ ├── xts.go │ │ └── xts_test.go │ ├── net │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── context │ │ ├── context.go │ │ ├── ctxhttp │ │ │ ├── ctxhttp.go │ │ │ └── ctxhttp_pre17.go │ │ ├── go17.go │ │ ├── go19.go │ │ ├── pre_go17.go │ │ └── pre_go19.go │ ├── http2 │ │ ├── ciphers.go │ │ ├── client_conn_pool.go │ │ ├── configure_transport.go │ │ ├── databuffer.go │ │ ├── errors.go │ │ ├── flow.go │ │ ├── frame.go │ │ ├── go16.go │ │ ├── go17.go │ │ ├── go17_not18.go │ │ ├── go18.go │ │ ├── go19.go │ │ ├── gotrack.go │ │ ├── headermap.go │ │ ├── hpack │ │ │ ├── encode.go │ │ │ ├── hpack.go │ │ │ ├── huffman.go │ │ │ └── tables.go │ │ ├── http2.go │ │ ├── not_go16.go │ │ ├── not_go17.go │ │ ├── not_go18.go │ │ ├── not_go19.go │ │ ├── pipe.go │ │ ├── server.go │ │ ├── transport.go │ │ ├── write.go │ │ ├── writesched.go │ │ ├── writesched_priority.go │ │ └── writesched_random.go │ ├── idna │ │ ├── idna.go │ │ ├── punycode.go │ │ ├── tables.go │ │ ├── trie.go │ │ └── trieval.go │ ├── internal │ │ └── timeseries │ │ │ └── timeseries.go │ ├── lex │ │ └── httplex │ │ │ └── httplex.go │ ├── publicsuffix │ │ ├── gen.go │ │ ├── list.go │ │ └── table.go │ └── trace │ │ ├── events.go │ │ ├── histogram.go │ │ ├── trace.go │ │ ├── trace_go16.go │ │ └── trace_go17.go │ ├── oauth2 │ ├── .travis.yml │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── README.md │ ├── google │ │ ├── appengine.go │ │ ├── appengine_hook.go │ │ ├── appengineflex_hook.go │ │ ├── default.go │ │ ├── doc_go19.go │ │ ├── doc_not_go19.go │ │ ├── go19.go │ │ ├── google.go │ │ ├── jwt.go │ │ ├── not_go19.go │ │ └── sdk.go │ ├── internal │ │ ├── client_appengine.go │ │ ├── doc.go │ │ ├── oauth2.go │ │ ├── token.go │ │ └── transport.go │ ├── jws │ │ └── jws.go │ ├── jwt │ │ └── jwt.go │ ├── oauth2.go │ ├── token.go │ └── transport.go │ ├── sync │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── errgroup │ │ └── errgroup.go │ └── text │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── collate │ ├── build │ │ ├── builder.go │ │ ├── colelem.go │ │ ├── contract.go │ │ ├── order.go │ │ ├── table.go │ │ └── trie.go │ ├── collate.go │ ├── index.go │ ├── maketables.go │ ├── option.go │ ├── sort.go │ └── tables.go │ ├── feature │ └── plural │ │ ├── common.go │ │ ├── gen.go │ │ ├── gen_common.go │ │ ├── message.go │ │ ├── plural.go │ │ └── tables.go │ ├── internal │ ├── catmsg │ │ ├── catmsg.go │ │ ├── codec.go │ │ └── varint.go │ ├── colltab │ │ ├── collelem.go │ │ ├── colltab.go │ │ ├── contract.go │ │ ├── iter.go │ │ ├── numeric.go │ │ ├── table.go │ │ ├── trie.go │ │ └── weighter.go │ ├── format │ │ ├── format.go │ │ └── parser.go │ ├── gen.go │ ├── gen │ │ ├── code.go │ │ └── gen.go │ ├── internal.go │ ├── match.go │ ├── number │ │ ├── common.go │ │ ├── decimal.go │ │ ├── format.go │ │ ├── gen.go │ │ ├── gen_common.go │ │ ├── number.go │ │ ├── pattern.go │ │ ├── roundingmode_string.go │ │ └── tables.go │ ├── stringset │ │ └── set.go │ ├── tables.go │ ├── tag │ │ └── tag.go │ ├── triegen │ │ ├── compact.go │ │ ├── print.go │ │ └── triegen.go │ └── ucd │ │ └── ucd.go │ ├── language │ ├── common.go │ ├── coverage.go │ ├── doc.go │ ├── gen.go │ ├── gen_common.go │ ├── gen_index.go │ ├── go1_1.go │ ├── go1_2.go │ ├── index.go │ ├── language.go │ ├── lookup.go │ ├── match.go │ ├── parse.go │ ├── tables.go │ └── tags.go │ ├── message │ ├── catalog.go │ ├── catalog │ │ ├── catalog.go │ │ ├── dict.go │ │ ├── go19.go │ │ └── gopre19.go │ ├── doc.go │ ├── format.go │ ├── message.go │ └── print.go │ ├── secure │ └── bidirule │ │ ├── bidirule.go │ │ ├── bidirule10.0.0.go │ │ └── bidirule9.0.0.go │ ├── transform │ └── transform.go │ └── unicode │ ├── bidi │ ├── bidi.go │ ├── bracket.go │ ├── core.go │ ├── gen.go │ ├── gen_ranges.go │ ├── gen_trieval.go │ ├── prop.go │ ├── tables10.0.0.go │ ├── tables9.0.0.go │ └── trieval.go │ ├── cldr │ ├── base.go │ ├── cldr.go │ ├── collate.go │ ├── decode.go │ ├── makexml.go │ ├── resolve.go │ ├── slice.go │ └── xml.go │ ├── norm │ ├── composition.go │ ├── forminfo.go │ ├── input.go │ ├── iter.go │ ├── maketables.go │ ├── normalize.go │ ├── readwriter.go │ ├── tables10.0.0.go │ ├── tables9.0.0.go │ ├── transform.go │ ├── trie.go │ └── triegen.go │ └── rangetable │ ├── gen.go │ ├── merge.go │ ├── rangetable.go │ ├── tables10.0.0.go │ └── tables9.0.0.go └── google.golang.org ├── genproto ├── LICENSE └── googleapis │ └── rpc │ └── status │ └── status.pb.go └── grpc ├── AUTHORS ├── LICENSE ├── backoff.go ├── balancer.go ├── balancer ├── balancer.go ├── base │ ├── balancer.go │ └── base.go └── roundrobin │ └── roundrobin.go ├── balancer_conn_wrappers.go ├── balancer_v1_wrapper.go ├── call.go ├── clientconn.go ├── codec.go ├── codes ├── code_string.go └── codes.go ├── connectivity └── connectivity.go ├── credentials ├── credentials.go ├── credentials_util_go17.go ├── credentials_util_go18.go └── credentials_util_pre_go17.go ├── doc.go ├── encoding └── encoding.go ├── go16.go ├── go17.go ├── grpclb.go ├── grpclb └── grpc_lb_v1 │ └── messages │ └── messages.pb.go ├── grpclb_picker.go ├── grpclb_remote_balancer.go ├── grpclb_util.go ├── grpclog ├── grpclog.go ├── logger.go └── loggerv2.go ├── health ├── grpc_health_v1 │ └── health.pb.go └── health.go ├── interceptor.go ├── internal └── internal.go ├── keepalive └── keepalive.go ├── metadata └── metadata.go ├── naming ├── dns_resolver.go ├── go17.go ├── go18.go └── naming.go ├── peer └── peer.go ├── picker_wrapper.go ├── pickfirst.go ├── proxy.go ├── reflection ├── grpc_reflection_v1alpha │ └── reflection.pb.go └── serverreflection.go ├── resolver ├── dns │ ├── dns_resolver.go │ ├── go17.go │ └── go18.go ├── passthrough │ └── passthrough.go └── resolver.go ├── resolver_conn_wrapper.go ├── rpc_util.go ├── server.go ├── service_config.go ├── stats ├── handlers.go └── stats.go ├── status └── status.go ├── stream.go ├── tap └── tap.go ├── trace.go └── transport ├── bdp_estimator.go ├── control.go ├── go16.go ├── go17.go ├── handler_server.go ├── http2_client.go ├── http2_server.go ├── http_util.go ├── log.go └── transport.go /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | Hi there! 4 | 5 | At this time the project is not open to contributions. This is subject to change. 6 | 7 | Whether open or not, this project adheres to the [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. 8 | 9 | ## Submitting a pull request 10 | 11 | At this time this project is not open to pull requests. 12 | 13 | ## Resources 14 | 15 | - [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/) 16 | - [Using Pull Requests](https://help.github.com/articles/using-pull-requests/) 17 | - [GitHub Help](https://help.github.com) 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 GitHub 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gh-mysql-tools 2 | 3 | General purpose MySQL tools by GitHub Engineering 4 | 5 | ### General notes 6 | 7 | This repository publishes tools created and used by GitHub's Database Infrastructure team. These will be small tools/scripts/configs that we use internally at GitHub. 8 | 9 | To be able to publish these tools, we strip out GitHub-specific code (e.g. integration with our chatops, monitoring etc.). We publish the tools "as is", under the MIT license, and without support. At this time we do not expect to maintain the tools on this repository, though we may periodically update them based on internal development. 10 | 11 | # The tools 12 | 13 | ## gh-mysql-rewind 14 | 15 | Move MySQL back in time, decontaminate or un-split brain a MySQL server, restore it into replication chain. 16 | 17 | [Read more](rewind/) 18 | 19 | 20 | # Project status 21 | 22 | This project is archived to indicate that it is not open to contributions. We expect to be updating it from time to time. We may be open to contributions at some point in the future. 23 | 24 | # Contributing 25 | 26 | See [CONTRIBUTING](.github/CONTRIBUTING.md) 27 | 28 | # License 29 | 30 | This project is released under the [MIT LICENSE](LICENSE). 31 | -------------------------------------------------------------------------------- /skeefree/.github/skeema-diff.cfg: -------------------------------------------------------------------------------- 1 | # Normally, skeema-diff CI looks for `.skeema` file in one of: 2 | # . skeema schemas schema db -name .skeema 3 | # Some repos may have `.skeema` file deep under some arbitrary directory. 4 | # We do not want `skeema-diff` to recursively search all possible directories. This is risky 5 | # because it might identify a wrong `.skeema` file (it may happen that a repo has multiple `.skeema` files 6 | # for some internal reason, some of which are irrelevant to production). 7 | # If a repo has such `.skeema` file in an unconventional path, please uncomment the below to indicate that path: 8 | # 9 | #skeema_path=path/to/.skeema/file 10 | -------------------------------------------------------------------------------- /skeefree/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | /tmp/ 3 | -------------------------------------------------------------------------------- /skeefree/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 GitHub 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /skeefree/README.md: -------------------------------------------------------------------------------- 1 | # skeefree 2 | 3 | Automated schema migrations for `github/*` repos 4 | 5 | `skeefree` is an app which collaborates with other components to achieve automated schema migration flow at GitHub. The complete flow is composed of: 6 | 7 | - [GitHub Actions](https://github.com/features/actions): an Action runs on Pull Request to identify if and which schema changes are pending 8 | - [skeema](https://github.com/skeema/skeema): an open source tool, which we use to identify which schema change is pending, and generate a formal statement to transition into the new schema 9 | - [gh-ost](https://github.com/github/gh-ost): our online schema migration tool, which runs reliable, auditable, controllable migrations on our busy clusters 10 | - `skeefree`: this repo, a service (internally deployed on kubernetes) which interacts the schema changes Pull Requests (by collaborating with the Action), which supports chatops for control and visibility, and which can kick the schema change, either directly (`CREATE TABLE`, `DROP TABLE`) or indirectly (invoke `gh-ost` to run the migration). 11 | 12 | For more information, read [How skeefree works](docs/how.md) 13 | 14 | 15 | ## Deployment 16 | 17 | We deploy `skeefree` in two forms: 18 | 19 | - A service (internally at GitHub we run this on kubernetes) 20 | - A binary deployed to "utility" hosts where we run `gh-ost` on. The binary helps `gh-ost` interact in the `skeefree` flow: 21 | - It activates `gh-ost` 22 | - And gets called by `gh-ost` via _hooks_. 23 | 24 | 25 | ## Docs 26 | 27 | - [Docs](docs/) 28 | -------------------------------------------------------------------------------- /skeefree/config/kubernetes/default/deployments/skeefree.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Deployment 3 | metadata: 4 | name: skeefree 5 | annotations: 6 | redacted: "skeefree" 7 | redacted: "skeefree" 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: skeefree 13 | template: 14 | metadata: 15 | labels: 16 | app: skeefree 17 | spec: 18 | containers: 19 | - name: skeefree 20 | image: skeefree 21 | env: 22 | - name: HTTP_ADDR 23 | value: ":8080" 24 | ports: 25 | - name: http 26 | containerPort: 8080 27 | protocol: TCP 28 | -------------------------------------------------------------------------------- /skeefree/config/kubernetes/default/services/skeefree.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | annotations: 5 | redacted/domain-name: "skeefree-%environment%.redacted" 6 | name: skeefree 7 | labels: 8 | service: skeefree 9 | spec: 10 | ports: 11 | - name: http 12 | port: 8080 13 | protocol: TCP 14 | targetPort: http 15 | selector: 16 | app: skeefree 17 | type: LoadBalancer 18 | -------------------------------------------------------------------------------- /skeefree/config/moda/deployment.yaml: -------------------------------------------------------------------------------- 1 | environments: 2 | - name: production 3 | secret_source: redacted 4 | secret_name: skeefree 5 | cluster_strategy: redacted 6 | clusters: 7 | - redacted 8 | - name: staging 9 | secret_source: redacted 10 | secret_name: skeefree 11 | cluster_strategy: redacted 12 | clusters: 13 | - redacted 14 | notifications: 15 | slack_channels: 16 | - "#redacted" 17 | -------------------------------------------------------------------------------- /skeefree/docs/how-gh-ost.md: -------------------------------------------------------------------------------- 1 | # How skeefree works: gh-ost 2 | 3 | `gh-ost` migrations are executed on utility hosts. 4 | 5 | A cronjob runs every minute on the utility servers, that kicks a check: do we need to run a migration? 6 | 7 | What runs the logic is `skeefree` CLI. It's the same `skeefree` build, but does not run as a service. 8 | 9 | The flow is: 10 | 11 | - Once per minute, run `gh-migrate-skeefree` (internal script) 12 | - which calls `skeefree -c own-migration`. This attempts to find a migration in `ready` [state](migrations.md) and own it. Multiple utility hosts will compete for such migration; one and only one will win. 13 | - The output of `skeefree -c own-migration` is a JSON which, among other things, contains the actual `command-to-run-gh-ost ...`. The script executes that command. 14 | - Now `gh-ost` is running, and is normally calling hooks. 15 | - In four of the hooks: `startup`, `status`, `success`, `failure`, we call upon `skeefree` CLI to take action based on the hook type. For example, on `startup` we will add a PR comment noting that migration has started. On `complete` we will set the migration to `complete` state, and add a PR comment. 16 | -------------------------------------------------------------------------------- /skeefree/docs/how-skeefree.md: -------------------------------------------------------------------------------- 1 | # How skeefree works: the skeefree coordinator 2 | 3 | `skeefree` is a (internally at GitHub) kubernetes app (you mnay run it asa service however you like to), backed by MySQL database on `redacted`. It is responsible for: 4 | 5 | - Storing known repos, PRs, migration state 6 | - Serving chatops 7 | - Accepting submissions for new repos 8 | - Auto-detecting PR with schema changes in known repos 9 | - Parsing the information in PRs, as generated by `skeema-diff` Action. 10 | - Generating migration commands based on `skeema-diff` migration statements and by deducing relevant cluster, shards, schema. 11 | - Generating review requests from relevant teams. 12 | - Identifying approved PRs, queueing migrations 13 | - Self applying `CREATE TABLE` and `DROP TABLE` (applied as `RENAME`) migrations 14 | - Scheduling migrations for `gh-ost` 15 | - Reading progress on `gh-ost` owned migrations 16 | - Identifying successful/failed migrations 17 | - Communicating successful/failed migrations to PR owners (commenting on PR) 18 | -------------------------------------------------------------------------------- /skeefree/go/app/api.go: -------------------------------------------------------------------------------- 1 | package app 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | "time" 7 | 8 | "github.com/github/mu" 9 | ) 10 | 11 | // apiService provides HTTP API endpoints to our app. 12 | // Useful endpoints can be, for example: 13 | // /debug/metrics: golang standard metrics endpoint 14 | // /_ping: GitHub standard health check endpoint 15 | // etc. 16 | type apiService struct { 17 | app *Application 18 | } 19 | 20 | func NewApiService(app *Application) *apiService { 21 | return &apiService{app: app} 22 | } 23 | 24 | func (s *apiService) Routes() []mu.Route { 25 | return []mu.Route{ 26 | mu.Get("/health", s.health), 27 | } 28 | } 29 | 30 | func (s *apiService) ServiceContext(req *http.Request) { 31 | } 32 | 33 | func (s *apiService) health(w http.ResponseWriter, r *http.Request) { 34 | fmt.Fprintf(w, "skeefree OK - %s\n", 35 | time.Now().UTC()) 36 | } 37 | -------------------------------------------------------------------------------- /skeefree/go/app/special_mapping.go: -------------------------------------------------------------------------------- 1 | package app 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | const defaultActionName = "skeema-diff" 8 | 9 | var specialReposActionName = map[string]string{} 10 | 11 | var reposRequiringDBReviewers = map[string]bool{ 12 | "special-repo": true, 13 | } 14 | 15 | func init() { 16 | } 17 | 18 | var postCompletePRComments = map[string]string{ 19 | "special-repo": strings.ReplaceAll(` 20 | #### For this special-repo, you are kindly asked to follow this flow: 21 | 22 | markdown §supported§, with this §funny§ character as backtick replacement. 23 | `, "§", "`"), 24 | } 25 | 26 | func getActionName(repo string) string { 27 | if name, ok := specialReposActionName[repo]; ok { 28 | return name 29 | } 30 | return defaultActionName 31 | } 32 | -------------------------------------------------------------------------------- /skeefree/go/app/special_mapping_test.go: -------------------------------------------------------------------------------- 1 | package app 2 | 3 | import ( 4 | "testing" 5 | 6 | test "github.com/openark/golib/tests" 7 | ) 8 | 9 | func TestGetActionName(t *testing.T) { 10 | { 11 | test.S(t).ExpectEquals(getActionName("my-default-repo"), defaultActionName) 12 | } 13 | { 14 | test.S(t).ExpectEquals(getActionName("myorg"), "skeema-diff") 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /skeefree/go/core/cluster_schema_map.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type MySQLClusterSchema struct { 4 | MySQLCluster string `db:"mysql_cluster" json:"mysql_cluster"` 5 | MySQLSchema string `db:"mysql_schema" json:"mysql_schema"` 6 | } 7 | 8 | func NewMySQLClusterSchema(cluster string, schema string) *MySQLClusterSchema { 9 | return &MySQLClusterSchema{ 10 | MySQLCluster: cluster, 11 | MySQLSchema: schema, 12 | } 13 | } 14 | 15 | type MySQLClusterSchemaMap map[string](*MySQLClusterSchema) 16 | -------------------------------------------------------------------------------- /skeefree/go/core/migration_test.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "testing" 5 | 6 | test "github.com/openark/golib/tests" 7 | ) 8 | 9 | func TestStrategy(t *testing.T) { 10 | { 11 | m := NewMigration(nil, "", nil, nil, PullRequestMigrationStatement{}, MigrationStrategyManual) 12 | test.S(t).ExpectEquals(m.Strategy, MigrationStrategyManual) 13 | } 14 | } 15 | 16 | func TestEvalClusterName(t *testing.T) { 17 | { 18 | r := &Repository{MySQLCluster: "testing"} 19 | m := NewMigration(nil, "", r, nil, PullRequestMigrationStatement{}, MigrationStrategyManual) 20 | test.S(t).ExpectEquals(m.EvalClusterName(), "testing") 21 | } 22 | { 23 | r := &Repository{MySQLCluster: "testing"} 24 | m := NewMigration(nil, "0080", r, nil, PullRequestMigrationStatement{}, MigrationStrategyManual) 25 | test.S(t).ExpectEquals(m.EvalClusterName(), "testing-0080") 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /skeefree/go/core/pull_request_test.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "testing" 5 | 6 | test "github.com/openark/golib/tests" 7 | ) 8 | 9 | func TestHasStatus(t *testing.T) { 10 | { 11 | pr := NewPullRequest() 12 | test.S(t).ExpectEquals(pr.GetStatus(), PullRequestStatusDetected) 13 | } 14 | { 15 | pr := NewPullRequest() 16 | pr.Status = "complete" 17 | test.S(t).ExpectEquals(pr.GetStatus(), PullRequestStatusComplete) 18 | } 19 | { 20 | pr := NewPullRequest() 21 | pr.Status = "" 22 | test.S(t).ExpectEquals(pr.GetStatus(), PullRequestStatusUnknown) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /skeefree/go/core/repo_production_mapping.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | type RepositoryProductionMapping struct { 8 | Id int64 `db:"id" json:"id"` 9 | Org string `db:"org" json:"org"` 10 | Repo string `db:"repo" json:"repo"` 11 | Hint string `db:"hint" json:"hint"` 12 | MySQLCluster string `db:"mysql_cluster" json:"mysql_cluster"` 13 | MySQLSchema string `db:"mysql_schema" json:"mysql_schema"` 14 | 15 | TimeAdded time.Time `db:"added_timestamp" json:"added_timestamp"` 16 | TimeUpdated time.Time `db:"updated_timestamp" json:"updated_timestamp"` 17 | } 18 | 19 | func NewRepositoryProductionMapping() *RepositoryProductionMapping { 20 | return &RepositoryProductionMapping{} 21 | } 22 | 23 | func NewRepositoryProductionMappingFromRepo(r *Repository) *RepositoryProductionMapping { 24 | return &RepositoryProductionMapping{ 25 | Org: r.Org, 26 | Repo: r.Repo, 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /skeefree/go/core/repository.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | type Repository struct { 9 | Id int64 `db:"id" json:"id"` 10 | Org string `db:"org" json:"org"` 11 | Repo string `db:"repo" json:"repo"` 12 | Owner string `db:"owner" json:"owner"` 13 | AutoRun bool `db:"autorun" json:"autorun"` 14 | MySQLCluster string 15 | MySQLSchema string 16 | 17 | TimeAdded time.Time `db:"added_timestamp" json:"added_timestamp"` 18 | TimeUpdated time.Time `db:"updated_timestamp" json:"updated_timestamp"` 19 | } 20 | 21 | func NewRepository(id int64) *Repository { 22 | return &Repository{ 23 | Id: id, 24 | } 25 | } 26 | func NewRepositoryFromPullRequest(pr *PullRequest) *Repository { 27 | return &Repository{ 28 | Org: pr.Org, 29 | Repo: pr.Repo, 30 | } 31 | } 32 | 33 | func (r *Repository) HasOrgRepo() bool { 34 | return r.Org != "" && r.Repo != "" 35 | } 36 | 37 | func (r *Repository) OrgRepo() string { 38 | return fmt.Sprintf("%s/%s", r.Org, r.Repo) 39 | } 40 | -------------------------------------------------------------------------------- /skeefree/go/core/repository_test.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "encoding/json" 5 | "testing" 6 | 7 | test "github.com/openark/golib/tests" 8 | ) 9 | 10 | func TestRepositoryUnmarshall(t *testing.T) { 11 | { 12 | j := ` 13 | { 14 | "id": 8, 15 | "org": "myorg", 16 | "repo": "skeefree-test", 17 | "owner": "database-team", 18 | "added_timestamp": "2019-05-23T00:43:27Z", 19 | "updated_timestamp": "2019-05-23T00:43:27Z" 20 | } 21 | ` 22 | r := &Repository{} 23 | _ = json.Unmarshal([]byte(j), &r) 24 | test.S(t).ExpectEquals(r.Id, int64(8)) 25 | test.S(t).ExpectEquals(r.Org, "myorg") 26 | test.S(t).ExpectEquals(r.Repo, "skeefree-test") 27 | test.S(t).ExpectEquals(r.Owner, "database-team") 28 | test.S(t).ExpectEquals(r.MySQLCluster, "") 29 | test.S(t).ExpectEquals(r.MySQLSchema, "") 30 | 31 | test.S(t).ExpectEquals(r.OrgRepo(), "myorg/skeefree-test") 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /skeefree/go/core/utils.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type PRMigrationsMap map[int64]([]Migration) 4 | 5 | func MapPRMigrations(migrations []Migration) (prMigrationsMap PRMigrationsMap, orderedPRIds []int64) { 6 | prMigrationsMap = make(PRMigrationsMap) 7 | for _, m := range migrations { 8 | if _, ok := prMigrationsMap[m.PR.Id]; !ok { 9 | prMigrationsMap[m.PR.Id] = []Migration{} 10 | orderedPRIds = append(orderedPRIds, m.PR.Id) 11 | } 12 | prMigrationsMap[m.PR.Id] = append(prMigrationsMap[m.PR.Id], m) 13 | } 14 | return prMigrationsMap, orderedPRIds 15 | } 16 | 17 | func EvaluateStrategy(prStatement PullRequestMigrationStatement, allowAuto bool) MigrationStrategy { 18 | if allowAuto { 19 | switch prStatement.GetMigrationType() { 20 | case CreateTableMigrationType, DropTableMigrationType: 21 | return MigrationStrategyDirect 22 | case AlterTableMigrationType: 23 | return MigrationStrategyGhost 24 | } 25 | } 26 | return MigrationStrategyManual 27 | } 28 | -------------------------------------------------------------------------------- /skeefree/go/core/utils_test.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "testing" 5 | 6 | test "github.com/openark/golib/tests" 7 | ) 8 | 9 | func TestEvaluateStrategy(t *testing.T) { 10 | { 11 | p := PullRequestMigrationStatement{ 12 | Statement: "CREATE TABLE `t`", 13 | } 14 | strategy := EvaluateStrategy(p, true) 15 | test.S(t).ExpectEquals(strategy, MigrationStrategyDirect) 16 | } 17 | { 18 | p := PullRequestMigrationStatement{ 19 | Statement: "DROP TABLE `t`", 20 | } 21 | strategy := EvaluateStrategy(p, true) 22 | test.S(t).ExpectEquals(strategy, MigrationStrategyDirect) 23 | } 24 | { 25 | p := PullRequestMigrationStatement{ 26 | Statement: "ALTER TABLE `t` DROP KEY `i`", 27 | } 28 | strategy := EvaluateStrategy(p, true) 29 | test.S(t).ExpectEquals(strategy, MigrationStrategyGhost) 30 | } 31 | { 32 | p := PullRequestMigrationStatement{ 33 | Statement: "ALTER TABLE `t` DROP KEY `i`", 34 | } 35 | strategy := EvaluateStrategy(p, false) 36 | test.S(t).ExpectEquals(strategy, MigrationStrategyManual) 37 | } 38 | { 39 | p := PullRequestMigrationStatement{ 40 | Statement: "DROP TABLE `t`", 41 | } 42 | strategy := EvaluateStrategy(p, false) 43 | test.S(t).ExpectEquals(strategy, MigrationStrategyManual) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /skeefree/go/gh/http.go: -------------------------------------------------------------------------------- 1 | package gh 2 | 3 | import ( 4 | "crypto/tls" 5 | "net" 6 | "net/http" 7 | "time" 8 | ) 9 | 10 | func setupHttpClient() (*http.Client, error) { 11 | httpTimeout := time.Second 12 | dialTimeout := func(network, addr string) (net.Conn, error) { 13 | return net.DialTimeout(network, addr, httpTimeout) 14 | } 15 | httpTransport := &http.Transport{ 16 | TLSClientConfig: &tls.Config{InsecureSkipVerify: false}, 17 | Dial: dialTimeout, 18 | ResponseHeaderTimeout: httpTimeout, 19 | } 20 | httpClient := &http.Client{Transport: httpTransport} 21 | 22 | return httpClient, nil 23 | } 24 | -------------------------------------------------------------------------------- /skeefree/go/ghapi/client.go: -------------------------------------------------------------------------------- 1 | package ghapi 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/github/skeefree/go/config" 7 | "github.com/google/go-github/github" 8 | 9 | "golang.org/x/oauth2" 10 | ) 11 | 12 | // NewGitHubClient creates a new GitHub API client 13 | func newGitHubClient(c *config.Config) (*github.Client, error) { 14 | tokenSource := oauth2.StaticTokenSource( 15 | &oauth2.Token{AccessToken: c.GitHubAPIToken}, 16 | ) 17 | return github.NewClient(oauth2.NewClient(context.Background(), tokenSource)), nil 18 | } 19 | -------------------------------------------------------------------------------- /skeefree/go/util/text.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | ) 7 | 8 | var ( 9 | orgRepoParserRegexp = regexp.MustCompile("^([^/]+)/([^/]+)$") 10 | orglessRepoParserRegexp = regexp.MustCompile("^([^/]+)$") 11 | ) 12 | 13 | func ParseOrgRepo(params map[string]string, defaultOrg string) (org string, repo string, err error) { 14 | 15 | if submatch := orgRepoParserRegexp.FindStringSubmatch(params["repo"]); len(submatch) > 0 { 16 | // explcitily indicated in "repo" params as in "github/freno" 17 | org, repo = submatch[1], submatch[2] 18 | } else if submatch := orglessRepoParserRegexp.FindStringSubmatch(params["repo"]); len(submatch) > 0 { 19 | if params["org"] != "" { 20 | org = params["org"] 21 | } else { 22 | org = defaultOrg 23 | } 24 | repo = submatch[1] 25 | } else { 26 | err = fmt.Errorf("Unable to parse org/repo from %+v", params) 27 | } 28 | return org, repo, err 29 | } 30 | -------------------------------------------------------------------------------- /skeefree/go/util/text_test.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "testing" 5 | 6 | test "github.com/openark/golib/tests" 7 | ) 8 | 9 | func TestParseOrgRepo(t *testing.T) { 10 | { 11 | params := map[string]string{ 12 | "repo": "myorg/myrepo", 13 | } 14 | org, repo, err := ParseOrgRepo(params, "def") 15 | test.S(t).ExpectNil(err) 16 | test.S(t).ExpectEquals(org, "myorg") 17 | test.S(t).ExpectEquals(repo, "myrepo") 18 | } 19 | { 20 | params := map[string]string{ 21 | "repo": "myrepo", 22 | } 23 | org, repo, err := ParseOrgRepo(params, "def") 24 | test.S(t).ExpectNil(err) 25 | test.S(t).ExpectEquals(org, "def") 26 | test.S(t).ExpectEquals(repo, "myrepo") 27 | } 28 | { 29 | params := map[string]string{ 30 | "org": "myorg", 31 | "repo": "myrepo", 32 | } 33 | org, repo, err := ParseOrgRepo(params, "def") 34 | test.S(t).ExpectNil(err) 35 | test.S(t).ExpectEquals(org, "myorg") 36 | test.S(t).ExpectEquals(repo, "myrepo") 37 | } 38 | { 39 | params := map[string]string{ 40 | "org": "myorg", 41 | "repo": "explicit-org/myrepo", 42 | } 43 | org, repo, err := ParseOrgRepo(params, "def") 44 | test.S(t).ExpectNil(err) 45 | test.S(t).ExpectEquals(org, "explicit-org") 46 | test.S(t).ExpectEquals(repo, "myrepo") 47 | } 48 | { 49 | params := map[string]string{ 50 | "repo": "myorg/myrepo/mypath", 51 | } 52 | _, _, err := ParseOrgRepo(params, "def") 53 | test.S(t).ExpectNotNil(err) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /skeefree/schema/.skeema: -------------------------------------------------------------------------------- 1 | # `skeema-diff-ci` is used by `skeema-diff` Action, see .github/workflows/skeema-diff.yml 2 | # It runs on a GitHub Action image, which implicitly contains a MySQL server. 3 | # 4 | [skeema-diff-ci] 5 | host=127.0.0.1 6 | port=3306 7 | user=root 8 | -------------------------------------------------------------------------------- /skeefree/schema/skeefree/.skeema: -------------------------------------------------------------------------------- 1 | # Skeefree eats its own dog food, and has `.skeema` settings and `skeefree` directives. 2 | # The prefix `skeema:` is ignored (any prefix with colon is ignored). It is used to make it explicit that the schema is never an actual production schema. 3 | # The suffix, `skeefree_production` is the actual name of the schema in production. 4 | [skeema-diff-ci] 5 | schema=skeema:skeefree_production 6 | -------------------------------------------------------------------------------- /skeefree/schema/skeefree/migrations.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `migrations` ( 2 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 3 | `org` varchar(128) NOT NULL, 4 | `repo` varchar(128) NOT NULL, 5 | `pull_request_number` bigint(20) unsigned NOT NULL, 6 | `pull_requests_id` bigint(20) unsigned NOT NULL, 7 | `pull_request_migration_statements_id` bigint(20) unsigned NOT NULL, 8 | `mysql_cluster` varchar(128) NOT NULL, 9 | `mysql_shard` varchar(128) NOT NULL, 10 | `mysql_schema` varchar(128) NOT NULL, 11 | `mysql_table` varchar(128) NOT NULL, 12 | `migration_statement` text NOT NULL, 13 | `alter_statement` text NOT NULL, 14 | `suggestion` text NOT NULL, 15 | `canonical` varchar(128) NOT NULL, 16 | `strategy` varchar(128) NOT NULL, 17 | `token` varchar(128) NOT NULL, 18 | `token_hint` varchar(128) NOT NULL, 19 | `added_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 20 | `ready_timestamp` timestamp NULL DEFAULT NULL, 21 | `assigned_timestamp` timestamp NULL DEFAULT NULL, 22 | `started_timestamp` timestamp NULL DEFAULT NULL, 23 | `liveness_timestamp` timestamp NULL DEFAULT NULL, 24 | `completed_timestamp` timestamp NULL DEFAULT NULL, 25 | `status` varchar(128) NOT NULL, 26 | PRIMARY KEY (`id`), 27 | KEY `pull_request_migration_statements_id_idx` (`pull_request_migration_statements_id`), 28 | KEY `mysql_cluster_shard_idx` (`mysql_cluster`,`mysql_shard`), 29 | KEY `added_timestamp_idx` (`added_timestamp`), 30 | KEY `token_idx` (`token`), 31 | KEY `status_idx` (`status`,`liveness_timestamp`), 32 | KEY `pull_requests_id_idx` (`pull_requests_id`), 33 | KEY `org_repo_pr_number_idx` (`org`, `repo`, `pull_request_number`) 34 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 35 | -------------------------------------------------------------------------------- /skeefree/schema/skeefree/pull_request_migration_statements.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `pull_request_migration_statements` ( 2 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 3 | `pull_requests_id` bigint(20) unsigned NOT NULL, 4 | `migration_statement` text NOT NULL, 5 | `status` varchar(32) NOT NULL, 6 | `added_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 7 | PRIMARY KEY (`id`), 8 | KEY `pull_requests_id_idx` (`pull_requests_id`), 9 | KEY `status_idx` (`status`,`added_timestamp`) 10 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; 11 | -------------------------------------------------------------------------------- /skeefree/schema/skeefree/pull_requests.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `pull_requests` ( 2 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 3 | `org` varchar(128) NOT NULL, 4 | `repo` varchar(128) NOT NULL, 5 | `pull_request_number` bigint(20) unsigned NOT NULL, 6 | `title` varchar(4096) NOT NULL DEFAULT '', 7 | `author` varchar(128) NOT NULL DEFAULT '', 8 | `priority` int(1) NOT NULL DEFAULT '0', 9 | `status` varchar(32) NOT NULL, 10 | `is_open` tinyint(4) unsigned NOT NULL DEFAULT '0', 11 | `submitted_by` varchar(128) NOT NULL, 12 | `added_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 13 | `probed_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 14 | `requested_review_by_db_reviewers` tinyint(4) unsigned NOT NULL DEFAULT '0', 15 | `approved_by_db_reviewers` tinyint(4) unsigned NOT NULL DEFAULT '0', 16 | `requested_review_by_db_infra` tinyint(4) unsigned NOT NULL DEFAULT '0', 17 | `approved_by_db_infra` tinyint(4) unsigned NOT NULL DEFAULT '0', 18 | `label_diff` tinyint(4) unsigned NOT NULL DEFAULT '0', 19 | `label_detected` tinyint(4) unsigned NOT NULL DEFAULT '0', 20 | `label_queued` tinyint(4) unsigned NOT NULL DEFAULT '0', 21 | `label_for_review` tinyint(4) unsigned NOT NULL DEFAULT '0', 22 | PRIMARY KEY (`id`), 23 | UNIQUE KEY `org_repo_pull_idx` (`org`,`repo`,`pull_request_number`), 24 | KEY `status_idx` (`status`,`added_timestamp`), 25 | KEY `is_open_priority_idx` (`is_open`,`priority`) 26 | ) ENGINE=InnoDB AUTO_INCREMENT=154 DEFAULT CHARSET=utf8mb4; 27 | -------------------------------------------------------------------------------- /skeefree/schema/skeefree/repo_production_mapping.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `repo_production_mapping` ( 2 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 3 | `org` varchar(128) NOT NULL, 4 | `repo` varchar(128) NOT NULL, 5 | `hint` varchar(128) NOT NULL, 6 | `mysql_cluster` varchar(128) NOT NULL, 7 | `mysql_schema` varchar(128) NOT NULL, 8 | `added_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 9 | `updated_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 10 | PRIMARY KEY (`id`), 11 | UNIQUE KEY `org_repo_uidx` (`org`,`repo`,`hint`) 12 | ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4; 13 | -------------------------------------------------------------------------------- /skeefree/schema/skeefree/repositories.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `repositories` ( 2 | `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, 3 | `org` varchar(128) NOT NULL, 4 | `repo` varchar(128) NOT NULL, 5 | `owner` varchar(128) NOT NULL, 6 | `autorun` tinyint(1) NOT NULL DEFAULT 0, 7 | `added_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 8 | `updated_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 9 | PRIMARY KEY (`id`), 10 | UNIQUE KEY `org_repo_uidx` (`org`,`repo`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4; 12 | -------------------------------------------------------------------------------- /skeefree/schema/skeefree/service_election.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `service_election` ( 2 | `anchor` int(10) unsigned NOT NULL, 3 | `service_id` varchar(128) NOT NULL, 4 | `last_seen_active` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, 5 | PRIMARY KEY (`anchor`) 6 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 7 | -------------------------------------------------------------------------------- /skeefree/script/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ "$(uname -s)" = "Darwin" ]; then 3 | mkdir -p tmp 4 | 5 | brew bundle &> tmp/brew-bundle.log || ( 6 | echo "Failed to brew bundle:" 7 | cat tmp/brew-bundle.log 8 | ) 9 | 10 | if [[ ! -x "$(which go)" ]]; then 11 | echo >&2 "skeefree requires an installation of Go to build." 12 | exit 1 13 | fi 14 | 15 | if [[ ! -x "$(which docker)" ]]; then 16 | echo >&2 "skeefree requires an installation of Docker to run." 17 | exit 1 18 | fi 19 | 20 | 21 | fi 22 | 23 | docker build -f Dockerfile.build -t skeefree:$(script/revision) . 24 | -------------------------------------------------------------------------------- /skeefree/script/build: -------------------------------------------------------------------------------- 1 | set -e 2 | #!/bin/bash 3 | 4 | go install -ldflags="-X main.BuildVersion=$(script/revision)" github.com/myorg/skeefree/... 5 | mkdir -p bin 6 | hostname 7 | 8 | cp -v "$GOPATH/bin/skeefree" bin/skeefree 9 | -------------------------------------------------------------------------------- /skeefree/script/cibuild: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -exu 3 | DOCKER_IMAGE=`docker build --tag myorg/skeefree:1.0 --rm -f Dockerfile.build .` 4 | 5 | PROJECT_WORKDIR="/go/src/github.com/myorg/skeefree" 6 | docker run --rm \ 7 | -v $(pwd):"$PROJECT_WORKDIR" \ 8 | --workdir "$PROJECT_WORKDIR" \ 9 | -e GOBIN="$PROJECT_WORKDIR/bin/" \ 10 | -e GOPATH="/go" \ 11 | "myorg/skeefree:1.0" \ 12 | /bin/sh -c "$PROJECT_WORKDIR/script/test" 13 | -------------------------------------------------------------------------------- /skeefree/script/dep: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # dep gets confused if it's run when pwd is a symlink into $GOPATH. 4 | scripts="$(dirname "$0")" 5 | root="$(dirname "$scripts")" 6 | cd -P "$root" 7 | 8 | echo Updating vendor... 9 | dep ensure "$@" 10 | -------------------------------------------------------------------------------- /skeefree/script/localserver.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | script/build 4 | 5 | 6 | export APPBIN=$GOBIN/skeefree 7 | 8 | export INTERNAL_ADDR="$(hostname):8080" 9 | 10 | export CHATOPS_AUTH_PUBLIC_KEY="" 11 | 12 | export CHATOPS_AUTH_BASE_URL="http://$(hostname):8080" 13 | 14 | export GITHUB_API_BASE_URL="stuff" 15 | 16 | echo "Booting server on ${INTERNAL_ADDR}..." 17 | 18 | bin/skeefree 19 | -------------------------------------------------------------------------------- /skeefree/script/release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | # Move stdout to fh 3, and dup stderr to stdout, so that the tar at the end can do the right thing 6 | exec 3>&1 1>&2 7 | 8 | if [ -z "$JANKY_SHA1" ]; then 9 | echo error: JANKY_SHA1 must be set 10 | exit 1 11 | fi 12 | 13 | go version 14 | 15 | export CGO_ENABLED=0 16 | 17 | mkdir -p /release 18 | 19 | script/build 20 | 21 | rm -rf tmp 22 | mkdir tmp 23 | chmod 777 tmp 24 | 25 | tar cfv /dev/fd/3 \ 26 | Dockerfile.release \ 27 | /go/bin \ 28 | tmp \ 29 | /etc/ssl/certs/ca-certificates.crt \ 30 | -------------------------------------------------------------------------------- /skeefree/script/revision: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -n "$JANKY_SHA1" ]; then 4 | echo "$JANKY_SHA1" 5 | exit 0 6 | fi 7 | 8 | git_revision=$(git rev-parse HEAD) 9 | if [ $? -eq 0 ]; then 10 | echo "$git_revision" 11 | exit 0 12 | fi 13 | 14 | echo "Could not find revision" >> /dev/stderr 15 | exit 1 16 | -------------------------------------------------------------------------------- /skeefree/script/server: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | script/build 4 | 5 | INTERNAL_ADDR="$(hostname):8080" 6 | export INTERNAL_ADDR 7 | 8 | CHATOPS_AUTH_PUBLIC_KEY="" 9 | export CHATOPS_AUTH_PUBLIC_KEY 10 | 11 | CHATOPS_TEST_PRIVATE_KEY_PATH="" 12 | export CHATOPS_TEST_PRIVATE_KEY_PATH 13 | 14 | CHATOPS_AUTH_BASE_URL="http://$(hostname):8080" 15 | export CHATOPS_AUTH_BASE_URL 16 | 17 | echo "Booting server on ${INTERNAL_ADDR}..." 18 | ls 19 | $(pwd)/bin/skeefree 20 | -------------------------------------------------------------------------------- /skeefree/script/skeefree.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ -f /etc/profile.d/skeefree.sh ] && . /etc/profile.d/skeefree.sh 4 | 5 | # skeefree, being a mu app, needs to get HTTP ports. 6 | # In CLI mode, nothing actually connects to these ports. 7 | # 8222 and 8223 are just dummy values. 8 | $(dirname $0)/skeefree -http-addr ":8222" -internal-addr ":8223" "$@" 9 | -------------------------------------------------------------------------------- /skeefree/script/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | echo "Verifying code is formatted via 'gofmt -s -w go/'" 5 | gofmt -s -w go/ 6 | git diff --exit-code --quiet 7 | 8 | echo "Building" 9 | ./script/build 10 | set -e 11 | 12 | 13 | # If gotest exists, colorize the output. 14 | if [ -f $GOBIN/gotest ] 15 | then 16 | gotest -v github.com/myorg/skeefree/go/... 17 | else 18 | go test -v github.com/myorg/skeefree/go/... 19 | fi 20 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/cenk/backoff/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Cenk Altı 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/cenk/backoff/context.go: -------------------------------------------------------------------------------- 1 | package backoff 2 | 3 | import ( 4 | "time" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // BackOffContext is a backoff policy that stops retrying after the context 10 | // is canceled. 11 | type BackOffContext interface { 12 | BackOff 13 | Context() context.Context 14 | } 15 | 16 | type backOffContext struct { 17 | BackOff 18 | ctx context.Context 19 | } 20 | 21 | // WithContext returns a BackOffContext with context ctx 22 | // 23 | // ctx must not be nil 24 | func WithContext(b BackOff, ctx context.Context) BackOffContext { 25 | if ctx == nil { 26 | panic("nil context") 27 | } 28 | 29 | if b, ok := b.(*backOffContext); ok { 30 | return &backOffContext{ 31 | BackOff: b.BackOff, 32 | ctx: ctx, 33 | } 34 | } 35 | 36 | return &backOffContext{ 37 | BackOff: b, 38 | ctx: ctx, 39 | } 40 | } 41 | 42 | func ensureContext(b BackOff) BackOffContext { 43 | if cb, ok := b.(BackOffContext); ok { 44 | return cb 45 | } 46 | return WithContext(b, context.Background()) 47 | } 48 | 49 | func (b *backOffContext) Context() context.Context { 50 | return b.ctx 51 | } 52 | 53 | func (b *backOffContext) NextBackOff() time.Duration { 54 | select { 55 | case <-b.Context().Done(): 56 | return Stop 57 | default: 58 | return b.BackOff.NextBackOff() 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/cenk/backoff/tries.go: -------------------------------------------------------------------------------- 1 | package backoff 2 | 3 | import "time" 4 | 5 | /* 6 | WithMaxTries creates a wrapper around another BackOff, which will 7 | return Stop if NextBackOff() has been called too many times since 8 | the last time Reset() was called 9 | 10 | Note: Implementation is not thread-safe. 11 | */ 12 | func WithMaxTries(b BackOff, max uint64) BackOff { 13 | return &backOffTries{delegate: b, maxTries: max} 14 | } 15 | 16 | type backOffTries struct { 17 | delegate BackOff 18 | maxTries uint64 19 | numTries uint64 20 | } 21 | 22 | func (b *backOffTries) NextBackOff() time.Duration { 23 | if b.maxTries > 0 { 24 | if b.maxTries <= b.numTries { 25 | return Stop 26 | } 27 | b.numTries++ 28 | } 29 | return b.delegate.NextBackOff() 30 | } 31 | 32 | func (b *backOffTries) Reset() { 33 | b.numTries = 0 34 | b.delegate.Reset() 35 | } 36 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/facebookgo/clock/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Ben Johnson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Issue description 2 | Tell us what should happen and what happens instead 3 | 4 | ### Example code 5 | ```go 6 | If possible, please enter some example code here to reproduce the issue. 7 | ``` 8 | 9 | ### Error log 10 | ``` 11 | If you have an error log, please paste it here. 12 | ``` 13 | 14 | ### Configuration 15 | *Driver version (or git SHA):* 16 | 17 | *Go version:* run `go version` in your console 18 | 19 | *Server version:* E.g. MySQL 5.6, MariaDB 10.0.20 20 | 21 | *Server OS:* E.g. Debian 8.1 (Jessie), Windows 10 22 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | Please explain the changes you made here. 3 | 4 | ### Checklist 5 | - [ ] Code compiles correctly 6 | - [ ] Created tests which fail without the change (if possible) 7 | - [ ] All tests passing 8 | - [ ] Extended the README / documentation, if necessary 9 | - [ ] Added myself / the copyright holder to the AUTHORS file 10 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .DS_Store? 3 | ._* 4 | .Spotlight-V100 5 | .Trashes 6 | Icon? 7 | ehthumbs.db 8 | Thumbs.db 9 | .idea 10 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/.travis/docker.cnf: -------------------------------------------------------------------------------- 1 | [client] 2 | user = gotest 3 | password = secret 4 | host = 127.0.0.1 5 | port = 3307 6 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/.travis/gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | 4 | # Only check for go1.10+ since the gofmt style changed 5 | if [[ $(go version) =~ go1\.([0-9]+) ]] && ((${BASH_REMATCH[1]} >= 10)); then 6 | test -z "$(gofmt -d -s . | tee /dev/stderr)" 7 | fi 8 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/.travis/wait_mysql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | while : 3 | do 4 | if mysql -e 'select version()' 2>&1 | grep 'version()\|ERROR 2059 (HY000):'; then 5 | break 6 | fi 7 | sleep 3 8 | done 9 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | ## Reporting Issues 4 | 5 | Before creating a new Issue, please check first if a similar Issue [already exists](https://github.com/go-sql-driver/mysql/issues?state=open) or was [recently closed](https://github.com/go-sql-driver/mysql/issues?direction=desc&page=1&sort=updated&state=closed). 6 | 7 | ## Contributing Code 8 | 9 | By contributing to this project, you share your code under the Mozilla Public License 2, as specified in the LICENSE file. 10 | Don't forget to add yourself to the AUTHORS file. 11 | 12 | ### Code Review 13 | 14 | Everyone is invited to review and comment on pull requests. 15 | If it looks fine to you, comment with "LGTM" (Looks good to me). 16 | 17 | If changes are required, notice the reviewers with "PTAL" (Please take another look) after committing the fixes. 18 | 19 | Before merging the Pull Request, at least one [team member](https://github.com/go-sql-driver?tab=members) must have commented with "LGTM". 20 | 21 | ## Development Ideas 22 | 23 | If you are looking for ideas for code contributions, please check our [Development Ideas](https://github.com/go-sql-driver/mysql/wiki/Development-Ideas) Wiki page. 24 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/appengine.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build appengine 10 | 11 | package mysql 12 | 13 | import ( 14 | "google.golang.org/appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/errors_test.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | import ( 12 | "bytes" 13 | "log" 14 | "testing" 15 | ) 16 | 17 | func TestErrorsSetLogger(t *testing.T) { 18 | previous := errLog 19 | defer func() { 20 | errLog = previous 21 | }() 22 | 23 | // set up logger 24 | const expected = "prefix: test\n" 25 | buffer := bytes.NewBuffer(make([]byte, 0, 64)) 26 | logger := log.New(buffer, "prefix: ", 0) 27 | 28 | // print 29 | SetLogger(logger) 30 | errLog.Print("test") 31 | 32 | // check result 33 | if actual := buffer.String(); actual != expected { 34 | t.Errorf("expected %q, got %q", expected, actual) 35 | } 36 | } 37 | 38 | func TestErrorsStrictIgnoreNotes(t *testing.T) { 39 | runTests(t, dsn+"&sql_notes=false", func(dbt *DBTest) { 40 | dbt.mustExec("DROP TABLE IF EXISTS does_not_exist") 41 | }) 42 | } 43 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/result.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlResult struct { 12 | affectedRows int64 13 | insertId int64 14 | } 15 | 16 | func (res *mysqlResult) LastInsertId() (int64, error) { 17 | return res.insertId, nil 18 | } 19 | 20 | func (res *mysqlResult) RowsAffected() (int64, error) { 21 | return res.affectedRows, nil 22 | } 23 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/go-sql-driver/mysql/transaction.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlTx struct { 12 | mc *mysqlConn 13 | } 14 | 15 | func (tx *mysqlTx) Commit() (err error) { 16 | if tx.mc == nil || tx.mc.closed.IsSet() { 17 | return ErrInvalidConn 18 | } 19 | err = tx.mc.exec("COMMIT") 20 | tx.mc = nil 21 | return 22 | } 23 | 24 | func (tx *mysqlTx) Rollback() (err error) { 25 | if tx.mc == nil || tx.mc.closed.IsSet() { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/golang/protobuf/LICENSE: -------------------------------------------------------------------------------- 1 | Go support for Protocol Buffers - Google's data interchange format 2 | 3 | Copyright 2010 The Go Authors. All rights reserved. 4 | https://github.com/golang/protobuf 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following disclaimer 14 | in the documentation and/or other materials provided with the 15 | distribution. 16 | * Neither the name of Google Inc. nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/admin_orgs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package github 7 | 8 | import "context" 9 | 10 | // createOrgRequest is a subset of Organization and is used internally 11 | // by CreateOrg to pass only the known fields for the endpoint. 12 | type createOrgRequest struct { 13 | Login *string `json:"login,omitempty"` 14 | Admin *string `json:"admin,omitempty"` 15 | } 16 | 17 | // CreateOrg creates a new organization in GitHub Enterprise. 18 | // 19 | // Note that only a subset of the org fields are used and org must 20 | // not be nil. 21 | // 22 | // GitHub Enterprise API docs: https://developer.github.com/enterprise/v3/enterprise-admin/orgs/#create-an-organization 23 | func (s *AdminService) CreateOrg(ctx context.Context, org *Organization, admin string) (*Organization, *Response, error) { 24 | u := "admin/organizations" 25 | 26 | orgReq := &createOrgRequest{ 27 | Login: org.Login, 28 | Admin: &admin, 29 | } 30 | 31 | req, err := s.client.NewRequest("POST", u, orgReq) 32 | if err != nil { 33 | return nil, nil, err 34 | } 35 | 36 | o := new(Organization) 37 | resp, err := s.client.Do(ctx, req, o) 38 | if err != nil { 39 | return nil, resp, err 40 | } 41 | 42 | return o, resp, nil 43 | } 44 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/admin_orgs_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package github 7 | 8 | import ( 9 | "context" 10 | "encoding/json" 11 | "fmt" 12 | "net/http" 13 | "reflect" 14 | "testing" 15 | ) 16 | 17 | func TestAdminOrgs_Create(t *testing.T) { 18 | client, mux, _, teardown := setup() 19 | defer teardown() 20 | 21 | input := &Organization{ 22 | Login: String("github"), 23 | } 24 | 25 | mux.HandleFunc("/admin/organizations", func(w http.ResponseWriter, r *http.Request) { 26 | v := new(createOrgRequest) 27 | json.NewDecoder(r.Body).Decode(v) 28 | 29 | testMethod(t, r, "POST") 30 | want := &createOrgRequest{Login: String("github"), Admin: String("ghAdmin")} 31 | if !reflect.DeepEqual(v, want) { 32 | t.Errorf("Request body = %+v, want %+v", v, want) 33 | } 34 | 35 | fmt.Fprint(w, `{"login":"github","id":1}`) 36 | }) 37 | 38 | org, _, err := client.Admin.CreateOrg(context.Background(), input, "ghAdmin") 39 | if err != nil { 40 | t.Errorf("Admin.CreateOrg returned error: %v", err) 41 | } 42 | 43 | want := &Organization{ID: Int64(1), Login: String("github")} 44 | if !reflect.DeepEqual(org, want) { 45 | t.Errorf("Admin.CreateOrg returned %+v, want %+v", org, want) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/git.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package github 7 | 8 | // GitService handles communication with the git data related 9 | // methods of the GitHub API. 10 | // 11 | // GitHub API docs: https://developer.github.com/v3/git/ 12 | type GitService service 13 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/interactions.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package github 7 | 8 | // InteractionsService handles communication with the repository and organization related 9 | // methods of the GitHub API. 10 | // 11 | // GitHub API docs: https://developer.github.com/v3/interactions/ 12 | type InteractionsService service 13 | 14 | // InteractionRestriction represents the interaction restrictions for repository and organization. 15 | type InteractionRestriction struct { 16 | // Specifies the group of GitHub users who can 17 | // comment, open issues, or create pull requests for the given repository. 18 | // Possible values are: "existing_users", "contributors_only" and "collaborators_only". 19 | Limit *string `json:"limit,omitempty"` 20 | 21 | // Origin specifies the type of the resource to interact with. 22 | // Possible values are: "repository" and "organization". 23 | Origin *string `json:"origin,omitempty"` 24 | 25 | // ExpiresAt specifies the time after which the interaction restrictions expire. 26 | // The default expiry time is 24 hours from the time restriction is created. 27 | ExpiresAt *Timestamp `json:"expires_at,omitempty"` 28 | } 29 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/issues_timeline_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package github 7 | 8 | import ( 9 | "context" 10 | "fmt" 11 | "net/http" 12 | "reflect" 13 | "strings" 14 | "testing" 15 | ) 16 | 17 | func TestIssuesService_ListIssueTimeline(t *testing.T) { 18 | client, mux, _, teardown := setup() 19 | defer teardown() 20 | 21 | wantAcceptHeaders := []string{mediaTypeTimelinePreview, mediaTypeProjectCardDetailsPreview} 22 | mux.HandleFunc("/repos/o/r/issues/1/timeline", func(w http.ResponseWriter, r *http.Request) { 23 | testMethod(t, r, "GET") 24 | testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", ")) 25 | testFormValues(t, r, values{ 26 | "page": "1", 27 | "per_page": "2", 28 | }) 29 | fmt.Fprint(w, `[{"id":1}]`) 30 | }) 31 | 32 | opt := &ListOptions{Page: 1, PerPage: 2} 33 | events, _, err := client.Issues.ListIssueTimeline(context.Background(), "o", "r", 1, opt) 34 | if err != nil { 35 | t.Errorf("Issues.ListIssueTimeline returned error: %v", err) 36 | } 37 | 38 | want := []*Timeline{{ID: Int64(1)}} 39 | if !reflect.DeepEqual(events, want) { 40 | t.Errorf("Issues.ListIssueTimeline = %+v, want %+v", events, want) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/repos_merging.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package github 7 | 8 | import ( 9 | "context" 10 | "fmt" 11 | ) 12 | 13 | // RepositoryMergeRequest represents a request to merge a branch in a 14 | // repository. 15 | type RepositoryMergeRequest struct { 16 | Base *string `json:"base,omitempty"` 17 | Head *string `json:"head,omitempty"` 18 | CommitMessage *string `json:"commit_message,omitempty"` 19 | } 20 | 21 | // Merge a branch in the specified repository. 22 | // 23 | // GitHub API docs: https://developer.github.com/v3/repos/merging/#perform-a-merge 24 | func (s *RepositoriesService) Merge(ctx context.Context, owner, repo string, request *RepositoryMergeRequest) (*RepositoryCommit, *Response, error) { 25 | u := fmt.Sprintf("repos/%v/%v/merges", owner, repo) 26 | req, err := s.client.NewRequest("POST", u, request) 27 | if err != nil { 28 | return nil, nil, err 29 | } 30 | 31 | commit := new(RepositoryCommit) 32 | resp, err := s.client.Do(ctx, req, commit) 33 | if err != nil { 34 | return nil, resp, err 35 | } 36 | 37 | return commit, resp, nil 38 | } 39 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/repos_merging_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package github 7 | 8 | import ( 9 | "context" 10 | "encoding/json" 11 | "fmt" 12 | "net/http" 13 | "reflect" 14 | "testing" 15 | ) 16 | 17 | func TestRepositoriesService_Merge(t *testing.T) { 18 | client, mux, _, teardown := setup() 19 | defer teardown() 20 | 21 | input := &RepositoryMergeRequest{ 22 | Base: String("b"), 23 | Head: String("h"), 24 | CommitMessage: String("c"), 25 | } 26 | 27 | mux.HandleFunc("/repos/o/r/merges", func(w http.ResponseWriter, r *http.Request) { 28 | v := new(RepositoryMergeRequest) 29 | json.NewDecoder(r.Body).Decode(v) 30 | 31 | testMethod(t, r, "POST") 32 | if !reflect.DeepEqual(v, input) { 33 | t.Errorf("Request body = %+v, want %+v", v, input) 34 | } 35 | 36 | fmt.Fprint(w, `{"sha":"s"}`) 37 | }) 38 | 39 | commit, _, err := client.Repositories.Merge(context.Background(), "o", "r", input) 40 | if err != nil { 41 | t.Errorf("Repositories.Merge returned error: %v", err) 42 | } 43 | 44 | want := &RepositoryCommit{SHA: String("s")} 45 | if !reflect.DeepEqual(commit, want) { 46 | t.Errorf("Repositories.Merge returned %+v, want %+v", commit, want) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/timestamp.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package github 7 | 8 | import ( 9 | "strconv" 10 | "time" 11 | ) 12 | 13 | // Timestamp represents a time that can be unmarshalled from a JSON string 14 | // formatted as either an RFC3339 or Unix timestamp. This is necessary for some 15 | // fields since the GitHub API is inconsistent in how it represents times. All 16 | // exported methods of time.Time can be called on Timestamp. 17 | type Timestamp struct { 18 | time.Time 19 | } 20 | 21 | func (t Timestamp) String() string { 22 | return t.Time.String() 23 | } 24 | 25 | // UnmarshalJSON implements the json.Unmarshaler interface. 26 | // Time is expected in RFC3339 or Unix format. 27 | func (t *Timestamp) UnmarshalJSON(data []byte) (err error) { 28 | str := string(data) 29 | i, err := strconv.ParseInt(str, 10, 64) 30 | if err == nil { 31 | t.Time = time.Unix(i, 0) 32 | } else { 33 | t.Time, err = time.Parse(`"`+time.RFC3339+`"`, str) 34 | } 35 | return 36 | } 37 | 38 | // Equal reports whether t and u are equal based on time.Equal 39 | func (t Timestamp) Equal(u Timestamp) bool { 40 | return t.Time.Equal(u.Time) 41 | } 42 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/with_appengine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build appengine 7 | 8 | // This file provides glue for making github work on App Engine. 9 | 10 | package github 11 | 12 | import ( 13 | "context" 14 | "net/http" 15 | ) 16 | 17 | func withContext(ctx context.Context, req *http.Request) *http.Request { 18 | // No-op because App Engine adds context to a request differently. 19 | return req 20 | } 21 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-github/github/without_appengine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-github AUTHORS. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | // This file provides glue for making github work without App Engine. 9 | 10 | package github 11 | 12 | import ( 13 | "context" 14 | "net/http" 15 | ) 16 | 17 | func withContext(ctx context.Context, req *http.Request) *http.Request { 18 | return req.WithContext(ctx) 19 | } 20 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/google/go-querystring/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Google. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/jmoiron/sqlx/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | tags 24 | environ 25 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/jmoiron/sqlx/.travis.yml: -------------------------------------------------------------------------------- 1 | # vim: ft=yaml sw=2 ts=2 2 | 3 | language: go 4 | 5 | # enable database services 6 | services: 7 | - mysql 8 | - postgresql 9 | 10 | # create test database 11 | before_install: 12 | - mysql -e 'CREATE DATABASE IF NOT EXISTS sqlxtest;' 13 | - psql -c 'create database sqlxtest;' -U postgres 14 | - go get github.com/mattn/goveralls 15 | - export SQLX_MYSQL_DSN="travis:@/sqlxtest?parseTime=true" 16 | - export SQLX_POSTGRES_DSN="postgres://postgres:@localhost/sqlxtest?sslmode=disable" 17 | - export SQLX_SQLITE_DSN="$HOME/sqlxtest.db" 18 | 19 | # go versions to test 20 | go: 21 | - "1.8" 22 | - "1.9" 23 | - "1.10.x" 24 | 25 | # run tests w/ coverage 26 | script: 27 | - travis_retry $GOPATH/bin/goveralls -service=travis-ci 28 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/jmoiron/sqlx/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Jason Moiron 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/jmoiron/sqlx/doc.go: -------------------------------------------------------------------------------- 1 | // Package sqlx provides general purpose extensions to database/sql. 2 | // 3 | // It is intended to seamlessly wrap database/sql and provide convenience 4 | // methods which are useful in the development of database driven applications. 5 | // None of the underlying database/sql methods are changed. Instead all extended 6 | // behavior is implemented through new methods defined on wrapper types. 7 | // 8 | // Additions include scanning into structs, named query support, rebinding 9 | // queries for different drivers, convenient shorthands for common error handling 10 | // and more. 11 | // 12 | package sqlx 13 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/jmoiron/sqlx/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/jmoiron/sqlx 2 | 3 | require ( 4 | github.com/go-sql-driver/mysql v1.4.0 5 | github.com/lib/pq v1.0.0 6 | github.com/mattn/go-sqlite3 v1.9.0 7 | ) 8 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/jmoiron/sqlx/go.sum: -------------------------------------------------------------------------------- 1 | github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk= 2 | github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= 3 | github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= 4 | github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 5 | github.com/mattn/go-sqlite3 v1.9.0 h1:pDRiWfl+++eC2FEFRy6jXmQlvp4Yh3z1MJKg4UeYM/4= 6 | github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= 7 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/jmoiron/sqlx/reflectx/README.md: -------------------------------------------------------------------------------- 1 | # reflectx 2 | 3 | The sqlx package has special reflect needs. In particular, it needs to: 4 | 5 | * be able to map a name to a field 6 | * understand embedded structs 7 | * understand mapping names to fields by a particular tag 8 | * user specified name -> field mapping functions 9 | 10 | These behaviors mimic the behaviors by the standard library marshallers and also the 11 | behavior of standard Go accessors. 12 | 13 | The first two are amply taken care of by `Reflect.Value.FieldByName`, and the third is 14 | addressed by `Reflect.Value.FieldByNameFunc`, but these don't quite understand struct 15 | tags in the ways that are vital to most marshallers, and they are slow. 16 | 17 | This reflectx package extends reflect to achieve these goals. 18 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/jmoiron/sqlx/types/README.md: -------------------------------------------------------------------------------- 1 | # types 2 | 3 | The types package provides some useful types which implement the `sql.Scanner` 4 | and `driver.Valuer` interfaces, suitable for use as scan and value targets with 5 | database/sql. 6 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/opentracing/opentracing-go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 The OpenTracing Authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/opentracing/opentracing-go/globaltracer.go: -------------------------------------------------------------------------------- 1 | package opentracing 2 | 3 | var ( 4 | globalTracer Tracer = NoopTracer{} 5 | ) 6 | 7 | // SetGlobalTracer sets the [singleton] opentracing.Tracer returned by 8 | // GlobalTracer(). Those who use GlobalTracer (rather than directly manage an 9 | // opentracing.Tracer instance) should call SetGlobalTracer as early as 10 | // possible in main(), prior to calling the `StartSpan` global func below. 11 | // Prior to calling `SetGlobalTracer`, any Spans started via the `StartSpan` 12 | // (etc) globals are noops. 13 | func SetGlobalTracer(tracer Tracer) { 14 | globalTracer = tracer 15 | } 16 | 17 | // GlobalTracer returns the global singleton `Tracer` implementation. 18 | // Before `SetGlobalTracer()` is called, the `GlobalTracer()` is a noop 19 | // implementation that drops all data handed to it. 20 | func GlobalTracer() Tracer { 21 | return globalTracer 22 | } 23 | 24 | // StartSpan defers to `Tracer.StartSpan`. See `GlobalTracer()`. 25 | func StartSpan(operationName string, opts ...StartSpanOption) Span { 26 | return globalTracer.StartSpan(operationName, opts...) 27 | } 28 | 29 | // InitGlobalTracer is deprecated. Please use SetGlobalTracer. 30 | func InitGlobalTracer(tracer Tracer) { 31 | SetGlobalTracer(tracer) 32 | } 33 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/opentracing/opentracing-go/log/util.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import "fmt" 4 | 5 | // InterleavedKVToFields converts keyValues a la Span.LogKV() to a Field slice 6 | // a la Span.LogFields(). 7 | func InterleavedKVToFields(keyValues ...interface{}) ([]Field, error) { 8 | if len(keyValues)%2 != 0 { 9 | return nil, fmt.Errorf("non-even keyValues len: %d", len(keyValues)) 10 | } 11 | fields := make([]Field, len(keyValues)/2) 12 | for i := 0; i*2 < len(keyValues); i++ { 13 | key, ok := keyValues[i*2].(string) 14 | if !ok { 15 | return nil, fmt.Errorf( 16 | "non-string key (pair #%d): %T", 17 | i, keyValues[i*2]) 18 | } 19 | switch typedVal := keyValues[i*2+1].(type) { 20 | case bool: 21 | fields[i] = Bool(key, typedVal) 22 | case string: 23 | fields[i] = String(key, typedVal) 24 | case int: 25 | fields[i] = Int(key, typedVal) 26 | case int8: 27 | fields[i] = Int32(key, int32(typedVal)) 28 | case int16: 29 | fields[i] = Int32(key, int32(typedVal)) 30 | case int32: 31 | fields[i] = Int32(key, typedVal) 32 | case int64: 33 | fields[i] = Int64(key, typedVal) 34 | case uint: 35 | fields[i] = Uint64(key, uint64(typedVal)) 36 | case uint64: 37 | fields[i] = Uint64(key, typedVal) 38 | case uint8: 39 | fields[i] = Uint32(key, uint32(typedVal)) 40 | case uint16: 41 | fields[i] = Uint32(key, uint32(typedVal)) 42 | case uint32: 43 | fields[i] = Uint32(key, typedVal) 44 | case float32: 45 | fields[i] = Float32(key, typedVal) 46 | case float64: 47 | fields[i] = Float64(key, typedVal) 48 | default: 49 | // When in doubt, coerce to a string 50 | fields[i] = String(key, fmt.Sprint(typedVal)) 51 | } 52 | } 53 | return fields, nil 54 | } 55 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/patrickmn/go-cache/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | This is a list of people who have contributed code to go-cache. They, or their 2 | employers, are the copyright holders of the contributed code. Contributed code 3 | is subject to the license restrictions listed in LICENSE (as they were when the 4 | code was contributed.) 5 | 6 | Dustin Sallings 7 | Jason Mooberry 8 | Sergey Shepelev 9 | Alex Edwards 10 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/patrickmn/go-cache/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2017 Patrick Mylund Nielsen and the go-cache contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/pressly/chi/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-present Peter Kieltyka (https://github.com/pkieltyka), Google Inc. 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/rubyist/circuitbreaker/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2014 Scott Barron 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/soheilhy/cmux/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # The list of people who have contributed code to the cmux repository. 2 | # 3 | # Auto-generated with: 4 | # git log --oneline --pretty=format:'%an <%aE>' | sort -u 5 | # 6 | Andreas Jaekle 7 | Dmitri Shuralyov 8 | Ethan Mosbaugh 9 | Soheil Hassas Yeganeh 10 | Soheil Hassas Yeganeh 11 | Tamir Duberstein 12 | Tamir Duberstein 13 | -------------------------------------------------------------------------------- /skeefree/vendor/github.com/soheilhy/cmux/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The CMux Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 | // implied. See the License for the specific language governing 13 | // permissions and limitations under the License. 14 | 15 | // Package cmux is a library to multiplex network connections based on 16 | // their payload. Using cmux, you can serve different protocols from the 17 | // same listener. 18 | package cmux 19 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | ## Filing issues 8 | 9 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 10 | 11 | 1. What version of Go are you using (`go version`)? 12 | 2. What operating system and processor architecture are you using? 13 | 3. What did you do? 14 | 4. What did you expect to see? 15 | 5. What did you see instead? 16 | 17 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 18 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 19 | 20 | ## Contributing code 21 | 22 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 23 | before sending patches. 24 | 25 | Unless otherwise noted, the Go source files are distributed under 26 | the BSD-style license found in the LICENSE file. 27 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/README.md: -------------------------------------------------------------------------------- 1 | # Go Cryptography 2 | 3 | This repository holds supplementary Go cryptography libraries. 4 | 5 | ## Download/Install 6 | 7 | The easiest way to install is to run `go get -u golang.org/x/crypto/...`. You 8 | can also manually git clone the repository to `$GOPATH/src/golang.org/x/crypto`. 9 | 10 | ## Report Issues / Send Patches 11 | 12 | This repository uses Gerrit for code changes. To learn how to submit changes to 13 | this repository, see https://golang.org/doc/contribute.html. 14 | 15 | The main issue tracker for the crypto repository is located at 16 | https://github.com/golang/go/issues. Prefix your issue with "x/crypto:" in the 17 | subject line, so it is easy to find. 18 | 19 | Note that contributions to the cryptography package receive additional scrutiny 20 | due to their sensitive nature. Patches may take longer than normal to receive 21 | feedback. 22 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/acme/autocert/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package autocert_test 6 | 7 | import ( 8 | "fmt" 9 | "log" 10 | "net/http" 11 | 12 | "golang.org/x/crypto/acme/autocert" 13 | ) 14 | 15 | func ExampleNewListener() { 16 | mux := http.NewServeMux() 17 | mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 18 | fmt.Fprintf(w, "Hello, TLS user! Your config: %+v", r.TLS) 19 | }) 20 | log.Fatal(http.Serve(autocert.NewListener("example.com"), mux)) 21 | } 22 | 23 | func ExampleManager() { 24 | m := &autocert.Manager{ 25 | Cache: autocert.DirCache("secret-dir"), 26 | Prompt: autocert.AcceptTOS, 27 | HostPolicy: autocert.HostWhitelist("example.org", "www.example.org"), 28 | } 29 | s := &http.Server{ 30 | Addr: ":https", 31 | TLSConfig: m.TLSConfig(), 32 | } 33 | s.ListenAndServeTLS("", "") 34 | } 35 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/acme/version_go112.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.12 6 | 7 | package acme 8 | 9 | import "runtime/debug" 10 | 11 | func init() { 12 | // Set packageVersion if the binary was built in modules mode and x/crypto 13 | // was not replaced with a different module. 14 | info, ok := debug.ReadBuildInfo() 15 | if !ok { 16 | return 17 | } 18 | for _, m := range info.Deps { 19 | if m.Path != "golang.org/x/crypto" { 20 | continue 21 | } 22 | if m.Replace == nil { 23 | packageVersion = m.Version 24 | } 25 | break 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/argon2/blake2b.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package argon2 6 | 7 | import ( 8 | "encoding/binary" 9 | "hash" 10 | 11 | "golang.org/x/crypto/blake2b" 12 | ) 13 | 14 | // blake2bHash computes an arbitrary long hash value of in 15 | // and writes the hash to out. 16 | func blake2bHash(out []byte, in []byte) { 17 | var b2 hash.Hash 18 | if n := len(out); n < blake2b.Size { 19 | b2, _ = blake2b.New(n, nil) 20 | } else { 21 | b2, _ = blake2b.New512(nil) 22 | } 23 | 24 | var buffer [blake2b.Size]byte 25 | binary.LittleEndian.PutUint32(buffer[:4], uint32(len(out))) 26 | b2.Write(buffer[:4]) 27 | b2.Write(in) 28 | 29 | if len(out) <= blake2b.Size { 30 | b2.Sum(out[:0]) 31 | return 32 | } 33 | 34 | outLen := len(out) 35 | b2.Sum(buffer[:0]) 36 | b2.Reset() 37 | copy(out, buffer[:32]) 38 | out = out[32:] 39 | for len(out) > blake2b.Size { 40 | b2.Write(buffer[:]) 41 | b2.Sum(buffer[:0]) 42 | copy(out, buffer[:32]) 43 | out = out[32:] 44 | b2.Reset() 45 | } 46 | 47 | if outLen%blake2b.Size > 0 { // outLen > 64 48 | r := ((outLen + 31) / 32) - 2 // ⌈τ /32⌉-2 49 | b2, _ = blake2b.New(outLen-32*r, nil) 50 | } 51 | b2.Write(buffer[:]) 52 | b2.Sum(out[:0]) 53 | } 54 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/argon2/blamka_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | package argon2 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | func init() { 12 | useSSE4 = cpu.X86.HasSSE41 13 | } 14 | 15 | //go:noescape 16 | func mixBlocksSSE2(out, a, b, c *block) 17 | 18 | //go:noescape 19 | func xorBlocksSSE2(out, a, b, c *block) 20 | 21 | //go:noescape 22 | func blamkaSSE4(b *block) 23 | 24 | func processBlockSSE(out, in1, in2 *block, xor bool) { 25 | var t block 26 | mixBlocksSSE2(&t, in1, in2, &t) 27 | if useSSE4 { 28 | blamkaSSE4(&t) 29 | } else { 30 | for i := 0; i < blockLength; i += 16 { 31 | blamkaGeneric( 32 | &t[i+0], &t[i+1], &t[i+2], &t[i+3], 33 | &t[i+4], &t[i+5], &t[i+6], &t[i+7], 34 | &t[i+8], &t[i+9], &t[i+10], &t[i+11], 35 | &t[i+12], &t[i+13], &t[i+14], &t[i+15], 36 | ) 37 | } 38 | for i := 0; i < blockLength/8; i += 2 { 39 | blamkaGeneric( 40 | &t[i], &t[i+1], &t[16+i], &t[16+i+1], 41 | &t[32+i], &t[32+i+1], &t[48+i], &t[48+i+1], 42 | &t[64+i], &t[64+i+1], &t[80+i], &t[80+i+1], 43 | &t[96+i], &t[96+i+1], &t[112+i], &t[112+i+1], 44 | ) 45 | } 46 | } 47 | if xor { 48 | xorBlocksSSE2(out, in1, in2, &t) 49 | } else { 50 | mixBlocksSSE2(out, in1, in2, &t) 51 | } 52 | } 53 | 54 | func processBlock(out, in1, in2 *block) { 55 | processBlockSSE(out, in1, in2, false) 56 | } 57 | 58 | func processBlockXOR(out, in1, in2 *block) { 59 | processBlockSSE(out, in1, in2, true) 60 | } 61 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/argon2/blamka_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine gccgo 6 | 7 | package argon2 8 | 9 | func processBlock(out, in1, in2 *block) { 10 | processBlockGeneric(out, in1, in2, false) 11 | } 12 | 13 | func processBlockXOR(out, in1, in2 *block) { 14 | processBlockGeneric(out, in1, in2, true) 15 | } 16 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/bcrypt/base64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bcrypt 6 | 7 | import "encoding/base64" 8 | 9 | const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" 10 | 11 | var bcEncoding = base64.NewEncoding(alphabet) 12 | 13 | func base64Encode(src []byte) []byte { 14 | n := bcEncoding.EncodedLen(len(src)) 15 | dst := make([]byte, n) 16 | bcEncoding.Encode(dst, src) 17 | for dst[n-1] == '=' { 18 | n-- 19 | } 20 | return dst[:n] 21 | } 22 | 23 | func base64Decode(src []byte) ([]byte, error) { 24 | numOfEquals := 4 - (len(src) % 4) 25 | for i := 0; i < numOfEquals; i++ { 26 | src = append(src, '=') 27 | } 28 | 29 | dst := make([]byte, bcEncoding.DecodedLen(len(src))) 30 | n, err := bcEncoding.Decode(dst, src) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return dst[:n], nil 35 | } 36 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7,amd64,!gccgo,!appengine 6 | 7 | package blake2b 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | func init() { 12 | useAVX2 = cpu.X86.HasAVX2 13 | useAVX = cpu.X86.HasAVX 14 | useSSE4 = cpu.X86.HasSSE41 15 | } 16 | 17 | //go:noescape 18 | func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 19 | 20 | //go:noescape 21 | func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 22 | 23 | //go:noescape 24 | func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 25 | 26 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 27 | switch { 28 | case useAVX2: 29 | hashBlocksAVX2(h, c, flag, blocks) 30 | case useAVX: 31 | hashBlocksAVX(h, c, flag, blocks) 32 | case useSSE4: 33 | hashBlocksSSE4(h, c, flag, blocks) 34 | default: 35 | hashBlocksGeneric(h, c, flag, blocks) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7,amd64,!gccgo,!appengine 6 | 7 | package blake2b 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | func init() { 12 | useSSE4 = cpu.X86.HasSSE41 13 | } 14 | 15 | //go:noescape 16 | func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 17 | 18 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 19 | if useSSE4 { 20 | hashBlocksSSE4(h, c, flag, blocks) 21 | } else { 22 | hashBlocksGeneric(h, c, flag, blocks) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/blake2b/blake2b_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine gccgo 6 | 7 | package blake2b 8 | 9 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 10 | hashBlocksGeneric(h, c, flag, blocks) 11 | } 12 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/blake2b/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package blake2b 8 | 9 | import ( 10 | "crypto" 11 | "hash" 12 | ) 13 | 14 | func init() { 15 | newHash256 := func() hash.Hash { 16 | h, _ := New256(nil) 17 | return h 18 | } 19 | newHash384 := func() hash.Hash { 20 | h, _ := New384(nil) 21 | return h 22 | } 23 | 24 | newHash512 := func() hash.Hash { 25 | h, _ := New512(nil) 26 | return h 27 | } 28 | 29 | crypto.RegisterHash(crypto.BLAKE2b_256, newHash256) 30 | crypto.RegisterHash(crypto.BLAKE2b_384, newHash384) 31 | crypto.RegisterHash(crypto.BLAKE2b_512, newHash512) 32 | } 33 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/blake2s/blake2s_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,!gccgo,!appengine 6 | 7 | package blake2s 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | var ( 12 | useSSE4 = false 13 | useSSSE3 = cpu.X86.HasSSSE3 14 | useSSE2 = cpu.X86.HasSSE2 15 | ) 16 | 17 | //go:noescape 18 | func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 19 | 20 | //go:noescape 21 | func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 22 | 23 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 24 | switch { 25 | case useSSSE3: 26 | hashBlocksSSSE3(h, c, flag, blocks) 27 | case useSSE2: 28 | hashBlocksSSE2(h, c, flag, blocks) 29 | default: 30 | hashBlocksGeneric(h, c, flag, blocks) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/blake2s/blake2s_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | package blake2s 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | var ( 12 | useSSE4 = cpu.X86.HasSSE41 13 | useSSSE3 = cpu.X86.HasSSSE3 14 | useSSE2 = cpu.X86.HasSSE2 15 | ) 16 | 17 | //go:noescape 18 | func hashBlocksSSE2(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 19 | 20 | //go:noescape 21 | func hashBlocksSSSE3(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 22 | 23 | //go:noescape 24 | func hashBlocksSSE4(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) 25 | 26 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 27 | switch { 28 | case useSSE4: 29 | hashBlocksSSE4(h, c, flag, blocks) 30 | case useSSSE3: 31 | hashBlocksSSSE3(h, c, flag, blocks) 32 | case useSSE2: 33 | hashBlocksSSE2(h, c, flag, blocks) 34 | default: 35 | hashBlocksGeneric(h, c, flag, blocks) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/blake2s/blake2s_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386 gccgo appengine 6 | 7 | package blake2s 8 | 9 | var ( 10 | useSSE4 = false 11 | useSSSE3 = false 12 | useSSE2 = false 13 | ) 14 | 15 | func hashBlocks(h *[8]uint32, c *[2]uint32, flag uint32, blocks []byte) { 16 | hashBlocksGeneric(h, c, flag, blocks) 17 | } 18 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/blake2s/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package blake2s 8 | 9 | import ( 10 | "crypto" 11 | "hash" 12 | ) 13 | 14 | func init() { 15 | newHash256 := func() hash.Hash { 16 | h, _ := New256(nil) 17 | return h 18 | } 19 | 20 | crypto.RegisterHash(crypto.BLAKE2s_256, newHash256) 21 | } 22 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/bn256/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bn256 6 | 7 | import ( 8 | "crypto/rand" 9 | ) 10 | 11 | func ExamplePair() { 12 | // This implements the tripartite Diffie-Hellman algorithm from "A One 13 | // Round Protocol for Tripartite Diffie-Hellman", A. Joux. 14 | // http://www.springerlink.com/content/cddc57yyva0hburb/fulltext.pdf 15 | 16 | // Each of three parties, a, b and c, generate a private value. 17 | a, _ := rand.Int(rand.Reader, Order) 18 | b, _ := rand.Int(rand.Reader, Order) 19 | c, _ := rand.Int(rand.Reader, Order) 20 | 21 | // Then each party calculates g₁ and g₂ times their private value. 22 | pa := new(G1).ScalarBaseMult(a) 23 | qa := new(G2).ScalarBaseMult(a) 24 | 25 | pb := new(G1).ScalarBaseMult(b) 26 | qb := new(G2).ScalarBaseMult(b) 27 | 28 | pc := new(G1).ScalarBaseMult(c) 29 | qc := new(G2).ScalarBaseMult(c) 30 | 31 | // Now each party exchanges its public values with the other two and 32 | // all parties can calculate the shared key. 33 | k1 := Pair(pb, qc) 34 | k1.ScalarMult(k1, a) 35 | 36 | k2 := Pair(pc, qa) 37 | k2.ScalarMult(k2, b) 38 | 39 | k3 := Pair(pa, qb) 40 | k3.ScalarMult(k3, c) 41 | 42 | // k1, k2 and k3 will all be equal. 43 | } 44 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/chacha20poly1305/chacha20poly1305_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 !go1.7 gccgo appengine 6 | 7 | package chacha20poly1305 8 | 9 | func (c *chacha20poly1305) seal(dst, nonce, plaintext, additionalData []byte) []byte { 10 | return c.sealGeneric(dst, nonce, plaintext, additionalData) 11 | } 12 | 13 | func (c *chacha20poly1305) open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) { 14 | return c.openGeneric(dst, nonce, ciphertext, additionalData) 15 | } 16 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/curve25519/const_amd64.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | #define REDMASK51 0x0007FFFFFFFFFFFF 9 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/curve25519/const_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | // These constants cannot be encoded in non-MOVQ immediates. 11 | // We access them directly from memory instead. 12 | 13 | DATA ·_121666_213(SB)/8, $996687872 14 | GLOBL ·_121666_213(SB), 8, $8 15 | 16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA 17 | GLOBL ·_2P0(SB), 8, $8 18 | 19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE 20 | GLOBL ·_2P1234(SB), 8, $8 21 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/curve25519/cswap_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | // func cswap(inout *[4][5]uint64, v uint64) 8 | TEXT ·cswap(SB),7,$0 9 | MOVQ inout+0(FP),DI 10 | MOVQ v+8(FP),SI 11 | 12 | SUBQ $1, SI 13 | NOTQ SI 14 | MOVQ SI, X15 15 | PSHUFD $0x44, X15, X15 16 | 17 | MOVOU 0(DI), X0 18 | MOVOU 16(DI), X2 19 | MOVOU 32(DI), X4 20 | MOVOU 48(DI), X6 21 | MOVOU 64(DI), X8 22 | MOVOU 80(DI), X1 23 | MOVOU 96(DI), X3 24 | MOVOU 112(DI), X5 25 | MOVOU 128(DI), X7 26 | MOVOU 144(DI), X9 27 | 28 | MOVO X1, X10 29 | MOVO X3, X11 30 | MOVO X5, X12 31 | MOVO X7, X13 32 | MOVO X9, X14 33 | 34 | PXOR X0, X10 35 | PXOR X2, X11 36 | PXOR X4, X12 37 | PXOR X6, X13 38 | PXOR X8, X14 39 | PAND X15, X10 40 | PAND X15, X11 41 | PAND X15, X12 42 | PAND X15, X13 43 | PAND X15, X14 44 | PXOR X10, X0 45 | PXOR X10, X1 46 | PXOR X11, X2 47 | PXOR X11, X3 48 | PXOR X12, X4 49 | PXOR X12, X5 50 | PXOR X13, X6 51 | PXOR X13, X7 52 | PXOR X14, X8 53 | PXOR X14, X9 54 | 55 | MOVOU X0, 0(DI) 56 | MOVOU X2, 16(DI) 57 | MOVOU X4, 32(DI) 58 | MOVOU X6, 48(DI) 59 | MOVOU X8, 64(DI) 60 | MOVOU X1, 80(DI) 61 | MOVOU X3, 96(DI) 62 | MOVOU X5, 112(DI) 63 | MOVOU X7, 128(DI) 64 | MOVOU X9, 144(DI) 65 | RET 66 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/curve25519/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package curve25519 provides an implementation of scalar multiplication on 6 | // the elliptic curve known as curve25519. See https://cr.yp.to/ecdh.html 7 | package curve25519 // import "golang.org/x/crypto/curve25519" 8 | 9 | // basePoint is the x coordinate of the generator of the curve. 10 | var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} 11 | 12 | // ScalarMult sets dst to the product in*base where dst and base are the x 13 | // coordinates of group points and all values are in little-endian form. 14 | func ScalarMult(dst, in, base *[32]byte) { 15 | scalarMult(dst, in, base) 16 | } 17 | 18 | // ScalarBaseMult sets dst to the product in*base where dst and base are the x 19 | // coordinates of group points, base is the standard generator and all values 20 | // are in little-endian form. 21 | func ScalarBaseMult(dst, in *[32]byte) { 22 | ScalarMult(dst, in, &basePoint) 23 | } 24 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/curve25519/freeze_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | #include "const_amd64.h" 11 | 12 | // func freeze(inout *[5]uint64) 13 | TEXT ·freeze(SB),7,$0-8 14 | MOVQ inout+0(FP), DI 15 | 16 | MOVQ 0(DI),SI 17 | MOVQ 8(DI),DX 18 | MOVQ 16(DI),CX 19 | MOVQ 24(DI),R8 20 | MOVQ 32(DI),R9 21 | MOVQ $REDMASK51,AX 22 | MOVQ AX,R10 23 | SUBQ $18,R10 24 | MOVQ $3,R11 25 | REDUCELOOP: 26 | MOVQ SI,R12 27 | SHRQ $51,R12 28 | ANDQ AX,SI 29 | ADDQ R12,DX 30 | MOVQ DX,R12 31 | SHRQ $51,R12 32 | ANDQ AX,DX 33 | ADDQ R12,CX 34 | MOVQ CX,R12 35 | SHRQ $51,R12 36 | ANDQ AX,CX 37 | ADDQ R12,R8 38 | MOVQ R8,R12 39 | SHRQ $51,R12 40 | ANDQ AX,R8 41 | ADDQ R12,R9 42 | MOVQ R9,R12 43 | SHRQ $51,R12 44 | ANDQ AX,R9 45 | IMUL3Q $19,R12,R12 46 | ADDQ R12,SI 47 | SUBQ $1,R11 48 | JA REDUCELOOP 49 | MOVQ $1,R12 50 | CMPQ R10,SI 51 | CMOVQLT R11,R12 52 | CMPQ AX,DX 53 | CMOVQNE R11,R12 54 | CMPQ AX,CX 55 | CMOVQNE R11,R12 56 | CMPQ AX,R8 57 | CMOVQNE R11,R12 58 | CMPQ AX,R9 59 | CMOVQNE R11,R12 60 | NEGQ R12 61 | ANDQ R12,AX 62 | ANDQ R12,R10 63 | SUBQ R10,SI 64 | SUBQ AX,DX 65 | SUBQ AX,CX 66 | SUBQ AX,R8 67 | SUBQ AX,R9 68 | MOVQ SI,0(DI) 69 | MOVQ DX,8(DI) 70 | MOVQ CX,16(DI) 71 | MOVQ R8,24(DI) 72 | MOVQ R9,32(DI) 73 | RET 74 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ed25519/go113_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.13 6 | 7 | package ed25519_test 8 | 9 | import ( 10 | ed25519std "crypto/ed25519" 11 | "golang.org/x/crypto/ed25519" 12 | "testing" 13 | ) 14 | 15 | func TestTypeAlias(t *testing.T) { 16 | var zero zeroReader 17 | public, private, _ := ed25519std.GenerateKey(zero) 18 | 19 | message := []byte("test message") 20 | sig := ed25519.Sign(private, message) 21 | if !ed25519.Verify(public, message, sig) { 22 | t.Errorf("valid signature rejected") 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/github/gh-mysql-tools/8bdf0cb85bdd63c87b09ab24333272efcf3325c0/skeefree/vendor/golang.org/x/crypto/ed25519/testdata/sign.input.gz -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/go.mod: -------------------------------------------------------------------------------- 1 | module golang.org/x/crypto 2 | 3 | require ( 4 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 5 | golang.org/x/sys v0.0.0-20190412213103-97732733099d 6 | ) 7 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 2 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= 3 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 4 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 5 | golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= 6 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 7 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 8 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 9 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/hkdf/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package hkdf_test 6 | 7 | import ( 8 | "bytes" 9 | "crypto/rand" 10 | "crypto/sha256" 11 | "fmt" 12 | "io" 13 | 14 | "golang.org/x/crypto/hkdf" 15 | ) 16 | 17 | // Usage example that expands one master secret into three other 18 | // cryptographically secure keys. 19 | func Example_usage() { 20 | // Underlying hash function for HMAC. 21 | hash := sha256.New 22 | 23 | // Cryptographically secure master secret. 24 | secret := []byte{0x00, 0x01, 0x02, 0x03} // i.e. NOT this. 25 | 26 | // Non-secret salt, optional (can be nil). 27 | // Recommended: hash-length random value. 28 | salt := make([]byte, hash().Size()) 29 | if _, err := rand.Read(salt); err != nil { 30 | panic(err) 31 | } 32 | 33 | // Non-secret context info, optional (can be nil). 34 | info := []byte("hkdf example") 35 | 36 | // Generate three 128-bit derived keys. 37 | hkdf := hkdf.New(hash, secret, salt, info) 38 | 39 | var keys [][]byte 40 | for i := 0; i < 3; i++ { 41 | key := make([]byte, 16) 42 | if _, err := io.ReadFull(hkdf, key); err != nil { 43 | panic(err) 44 | } 45 | keys = append(keys, key) 46 | } 47 | 48 | for i := range keys { 49 | fmt.Printf("Key #%d: %v\n", i+1, !bytes.Equal(keys[i], make([]byte, 16))) 50 | } 51 | 52 | // Output: 53 | // Key #1: true 54 | // Key #2: true 55 | // Key #3: true 56 | } 57 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/internal/chacha20/chacha_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.11 6 | // +build !gccgo 7 | 8 | package chacha20 9 | 10 | const ( 11 | haveAsm = true 12 | bufSize = 256 13 | ) 14 | 15 | //go:noescape 16 | func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32) 17 | 18 | func (c *Cipher) xorKeyStreamAsm(dst, src []byte) { 19 | 20 | if len(src) >= bufSize { 21 | xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter) 22 | } 23 | 24 | if len(src)%bufSize != 0 { 25 | i := len(src) - len(src)%bufSize 26 | c.buf = [bufSize]byte{} 27 | copy(c.buf[:], src[i:]) 28 | xorKeyStreamVX(c.buf[:], c.buf[:], &c.key, &c.nonce, &c.counter) 29 | c.len = bufSize - copy(dst[i:], c.buf[:len(src)%bufSize]) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/internal/chacha20/chacha_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !ppc64le,!arm64,!s390x arm64,!go1.11 gccgo appengine 6 | 7 | package chacha20 8 | 9 | const ( 10 | bufSize = 64 11 | haveAsm = false 12 | ) 13 | 14 | func (*Cipher) xorKeyStreamAsm(dst, src []byte) { 15 | panic("not implemented") 16 | } 17 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/internal/chacha20/chacha_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x,!gccgo,!appengine 6 | 7 | package chacha20 8 | 9 | import ( 10 | "golang.org/x/sys/cpu" 11 | ) 12 | 13 | var haveAsm = cpu.S390X.HasVX 14 | 15 | const bufSize = 256 16 | 17 | // xorKeyStreamVX is an assembly implementation of XORKeyStream. It must only 18 | // be called when the vector facility is available. 19 | // Implementation in asm_s390x.s. 20 | //go:noescape 21 | func xorKeyStreamVX(dst, src []byte, key *[8]uint32, nonce *[3]uint32, counter *uint32, buf *[256]byte, len *int) 22 | 23 | func (c *Cipher) xorKeyStreamAsm(dst, src []byte) { 24 | xorKeyStreamVX(dst, src, &c.key, &c.nonce, &c.counter, &c.buf, &c.len) 25 | } 26 | 27 | // EXRL targets, DO NOT CALL! 28 | func mvcSrcToBuf() 29 | func mvcBufToDst() 30 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/internal/chacha20/xor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found src the LICENSE file. 4 | 5 | package chacha20 6 | 7 | import ( 8 | "runtime" 9 | ) 10 | 11 | // Platforms that have fast unaligned 32-bit little endian accesses. 12 | const unaligned = runtime.GOARCH == "386" || 13 | runtime.GOARCH == "amd64" || 14 | runtime.GOARCH == "arm64" || 15 | runtime.GOARCH == "ppc64le" || 16 | runtime.GOARCH == "s390x" 17 | 18 | // xor reads a little endian uint32 from src, XORs it with u and 19 | // places the result in little endian byte order in dst. 20 | func xor(dst, src []byte, u uint32) { 21 | _, _ = src[3], dst[3] // eliminate bounds checks 22 | if unaligned { 23 | // The compiler should optimize this code into 24 | // 32-bit unaligned little endian loads and stores. 25 | // TODO: delete once the compiler does a reliably 26 | // good job with the generic code below. 27 | // See issue #25111 for more details. 28 | v := uint32(src[0]) 29 | v |= uint32(src[1]) << 8 30 | v |= uint32(src[2]) << 16 31 | v |= uint32(src[3]) << 24 32 | v ^= u 33 | dst[0] = byte(v) 34 | dst[1] = byte(v >> 8) 35 | dst[2] = byte(v >> 16) 36 | dst[3] = byte(v >> 24) 37 | } else { 38 | dst[0] = src[0] ^ byte(u) 39 | dst[1] = src[1] ^ byte(u>>8) 40 | dst[2] = src[2] ^ byte(u>>16) 41 | dst[3] = src[3] ^ byte(u>>24) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/internal/subtle/aliasing.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | // Package subtle implements functions that are often useful in cryptographic 8 | // code but require careful thought to use correctly. 9 | package subtle // import "golang.org/x/crypto/internal/subtle" 10 | 11 | import "unsafe" 12 | 13 | // AnyOverlap reports whether x and y share memory at any (not necessarily 14 | // corresponding) index. The memory beyond the slice length is ignored. 15 | func AnyOverlap(x, y []byte) bool { 16 | return len(x) > 0 && len(y) > 0 && 17 | uintptr(unsafe.Pointer(&x[0])) <= uintptr(unsafe.Pointer(&y[len(y)-1])) && 18 | uintptr(unsafe.Pointer(&y[0])) <= uintptr(unsafe.Pointer(&x[len(x)-1])) 19 | } 20 | 21 | // InexactOverlap reports whether x and y share memory at any non-corresponding 22 | // index. The memory beyond the slice length is ignored. Note that x and y can 23 | // have different lengths and still not have any inexact overlap. 24 | // 25 | // InexactOverlap can be used to implement the requirements of the crypto/cipher 26 | // AEAD, Block, BlockMode and Stream interfaces. 27 | func InexactOverlap(x, y []byte) bool { 28 | if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] { 29 | return false 30 | } 31 | return AnyOverlap(x, y) 32 | } 33 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/internal/subtle/aliasing_appengine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | // Package subtle implements functions that are often useful in cryptographic 8 | // code but require careful thought to use correctly. 9 | package subtle // import "golang.org/x/crypto/internal/subtle" 10 | 11 | // This is the Google App Engine standard variant based on reflect 12 | // because the unsafe package and cgo are disallowed. 13 | 14 | import "reflect" 15 | 16 | // AnyOverlap reports whether x and y share memory at any (not necessarily 17 | // corresponding) index. The memory beyond the slice length is ignored. 18 | func AnyOverlap(x, y []byte) bool { 19 | return len(x) > 0 && len(y) > 0 && 20 | reflect.ValueOf(&x[0]).Pointer() <= reflect.ValueOf(&y[len(y)-1]).Pointer() && 21 | reflect.ValueOf(&y[0]).Pointer() <= reflect.ValueOf(&x[len(x)-1]).Pointer() 22 | } 23 | 24 | // InexactOverlap reports whether x and y share memory at any non-corresponding 25 | // index. The memory beyond the slice length is ignored. Note that x and y can 26 | // have different lengths and still not have any inexact overlap. 27 | // 28 | // InexactOverlap can be used to implement the requirements of the crypto/cipher 29 | // AEAD, Block, BlockMode and Stream interfaces. 30 | func InexactOverlap(x, y []byte) bool { 31 | if len(x) == 0 || len(y) == 0 || &x[0] == &y[0] { 32 | return false 33 | } 34 | return AnyOverlap(x, y) 35 | } 36 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/internal/subtle/aliasing_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package subtle_test 6 | 7 | import ( 8 | "testing" 9 | 10 | "golang.org/x/crypto/internal/subtle" 11 | ) 12 | 13 | var a, b [100]byte 14 | 15 | var aliasingTests = []struct { 16 | x, y []byte 17 | anyOverlap, inexactOverlap bool 18 | }{ 19 | {a[:], b[:], false, false}, 20 | {a[:], b[:0], false, false}, 21 | {a[:], b[:50], false, false}, 22 | {a[40:50], a[50:60], false, false}, 23 | {a[40:50], a[60:70], false, false}, 24 | {a[:51], a[50:], true, true}, 25 | {a[:], a[:], true, false}, 26 | {a[:50], a[:60], true, false}, 27 | {a[:], nil, false, false}, 28 | {nil, nil, false, false}, 29 | {a[:], a[:0], false, false}, 30 | {a[:10], a[:10:20], true, false}, 31 | {a[:10], a[5:10:20], true, true}, 32 | } 33 | 34 | func testAliasing(t *testing.T, i int, x, y []byte, anyOverlap, inexactOverlap bool) { 35 | any := subtle.AnyOverlap(x, y) 36 | if any != anyOverlap { 37 | t.Errorf("%d: wrong AnyOverlap result, expected %v, got %v", i, anyOverlap, any) 38 | } 39 | inexact := subtle.InexactOverlap(x, y) 40 | if inexact != inexactOverlap { 41 | t.Errorf("%d: wrong InexactOverlap result, expected %v, got %v", i, inexactOverlap, any) 42 | } 43 | } 44 | 45 | func TestAliasing(t *testing.T) { 46 | for i, tt := range aliasingTests { 47 | testAliasing(t, i, tt.x, tt.y, tt.anyOverlap, tt.inexactOverlap) 48 | testAliasing(t, i, tt.y, tt.x, tt.anyOverlap, tt.inexactOverlap) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/md4/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package md4_test 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | 11 | "golang.org/x/crypto/md4" 12 | ) 13 | 14 | func ExampleNew() { 15 | h := md4.New() 16 | data := "These pretzels are making me thirsty." 17 | io.WriteString(h, data) 18 | fmt.Printf("%x", h.Sum(nil)) 19 | // Output: 48c4e365090b30a32f084c4888deceaa 20 | } 21 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/nacl/auth/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package auth_test 6 | 7 | import ( 8 | "encoding/hex" 9 | "fmt" 10 | 11 | "golang.org/x/crypto/nacl/auth" 12 | ) 13 | 14 | func Example() { 15 | // Load your secret key from a safe place and reuse it across multiple 16 | // Sum calls. (Obviously don't use this example key for anything 17 | // real.) If you want to convert a passphrase to a key, use a suitable 18 | // package like bcrypt or scrypt. 19 | secretKeyBytes, err := hex.DecodeString("6368616e676520746869732070617373776f726420746f206120736563726574") 20 | if err != nil { 21 | panic(err) 22 | } 23 | 24 | var secretKey [32]byte 25 | copy(secretKey[:], secretKeyBytes) 26 | 27 | mac := auth.Sum([]byte("hello world"), &secretKey) 28 | fmt.Printf("%x\n", *mac) 29 | result := auth.Verify(mac[:], []byte("hello world"), &secretKey) 30 | fmt.Println(result) 31 | badResult := auth.Verify(mac[:], []byte("different message"), &secretKey) 32 | fmt.Println(badResult) 33 | // Output: eca5a521f3d77b63f567fb0cb6f5f2d200641bc8dada42f60c5f881260c30317 34 | // true 35 | // false 36 | } 37 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/openpgp/canonical_text.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package openpgp 6 | 7 | import "hash" 8 | 9 | // NewCanonicalTextHash reformats text written to it into the canonical 10 | // form and then applies the hash h. See RFC 4880, section 5.2.1. 11 | func NewCanonicalTextHash(h hash.Hash) hash.Hash { 12 | return &canonicalTextHash{h, 0} 13 | } 14 | 15 | type canonicalTextHash struct { 16 | h hash.Hash 17 | s int 18 | } 19 | 20 | var newline = []byte{'\r', '\n'} 21 | 22 | func (cth *canonicalTextHash) Write(buf []byte) (int, error) { 23 | start := 0 24 | 25 | for i, c := range buf { 26 | switch cth.s { 27 | case 0: 28 | if c == '\r' { 29 | cth.s = 1 30 | } else if c == '\n' { 31 | cth.h.Write(buf[start:i]) 32 | cth.h.Write(newline) 33 | start = i + 1 34 | } 35 | case 1: 36 | cth.s = 0 37 | } 38 | } 39 | 40 | cth.h.Write(buf[start:]) 41 | return len(buf), nil 42 | } 43 | 44 | func (cth *canonicalTextHash) Sum(in []byte) []byte { 45 | return cth.h.Sum(in) 46 | } 47 | 48 | func (cth *canonicalTextHash) Reset() { 49 | cth.h.Reset() 50 | cth.s = 0 51 | } 52 | 53 | func (cth *canonicalTextHash) Size() int { 54 | return cth.h.Size() 55 | } 56 | 57 | func (cth *canonicalTextHash) BlockSize() int { 58 | return cth.h.BlockSize() 59 | } 60 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/openpgp/canonical_text_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package openpgp 6 | 7 | import ( 8 | "bytes" 9 | "testing" 10 | ) 11 | 12 | type recordingHash struct { 13 | buf *bytes.Buffer 14 | } 15 | 16 | func (r recordingHash) Write(b []byte) (n int, err error) { 17 | return r.buf.Write(b) 18 | } 19 | 20 | func (r recordingHash) Sum(in []byte) []byte { 21 | return append(in, r.buf.Bytes()...) 22 | } 23 | 24 | func (r recordingHash) Reset() { 25 | panic("shouldn't be called") 26 | } 27 | 28 | func (r recordingHash) Size() int { 29 | panic("shouldn't be called") 30 | } 31 | 32 | func (r recordingHash) BlockSize() int { 33 | panic("shouldn't be called") 34 | } 35 | 36 | func testCanonicalText(t *testing.T, input, expected string) { 37 | r := recordingHash{bytes.NewBuffer(nil)} 38 | c := NewCanonicalTextHash(r) 39 | c.Write([]byte(input)) 40 | result := c.Sum(nil) 41 | if expected != string(result) { 42 | t.Errorf("input: %x got: %x want: %x", input, result, expected) 43 | } 44 | } 45 | 46 | func TestCanonicalText(t *testing.T) { 47 | testCanonicalText(t, "foo\n", "foo\r\n") 48 | testCanonicalText(t, "foo", "foo") 49 | testCanonicalText(t, "foo\r\n", "foo\r\n") 50 | testCanonicalText(t, "foo\r\nbar", "foo\r\nbar") 51 | testCanonicalText(t, "foo\r\nbar\n\n", "foo\r\nbar\r\n\r\n") 52 | } 53 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/openpgp/packet/compressed_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package packet 6 | 7 | import ( 8 | "bytes" 9 | "encoding/hex" 10 | "io" 11 | "io/ioutil" 12 | "testing" 13 | ) 14 | 15 | func TestCompressed(t *testing.T) { 16 | packet, err := Read(readerFromHex(compressedHex)) 17 | if err != nil { 18 | t.Errorf("failed to read Compressed: %s", err) 19 | return 20 | } 21 | 22 | c, ok := packet.(*Compressed) 23 | if !ok { 24 | t.Error("didn't find Compressed packet") 25 | return 26 | } 27 | 28 | contents, err := ioutil.ReadAll(c.Body) 29 | if err != nil && err != io.EOF { 30 | t.Error(err) 31 | return 32 | } 33 | 34 | expected, _ := hex.DecodeString(compressedExpectedHex) 35 | if !bytes.Equal(expected, contents) { 36 | t.Errorf("got:%x want:%x", contents, expected) 37 | } 38 | } 39 | 40 | const compressedHex = "a3013b2d90c4e02b72e25f727e5e496a5e49b11e1700" 41 | const compressedExpectedHex = "cb1062004d14c8fe636f6e74656e74732e0a" 42 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/openpgp/packet/ocfb_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package packet 6 | 7 | import ( 8 | "bytes" 9 | "crypto/aes" 10 | "crypto/rand" 11 | "testing" 12 | ) 13 | 14 | var commonKey128 = []byte{0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c} 15 | 16 | func testOCFB(t *testing.T, resync OCFBResyncOption) { 17 | block, err := aes.NewCipher(commonKey128) 18 | if err != nil { 19 | t.Error(err) 20 | return 21 | } 22 | 23 | plaintext := []byte("this is the plaintext, which is long enough to span several blocks.") 24 | randData := make([]byte, block.BlockSize()) 25 | rand.Reader.Read(randData) 26 | ocfb, prefix := NewOCFBEncrypter(block, randData, resync) 27 | ciphertext := make([]byte, len(plaintext)) 28 | ocfb.XORKeyStream(ciphertext, plaintext) 29 | 30 | ocfbdec := NewOCFBDecrypter(block, prefix, resync) 31 | if ocfbdec == nil { 32 | t.Errorf("NewOCFBDecrypter failed (resync: %t)", resync) 33 | return 34 | } 35 | plaintextCopy := make([]byte, len(plaintext)) 36 | ocfbdec.XORKeyStream(plaintextCopy, ciphertext) 37 | 38 | if !bytes.Equal(plaintextCopy, plaintext) { 39 | t.Errorf("got: %x, want: %x (resync: %t)", plaintextCopy, plaintext, resync) 40 | } 41 | } 42 | 43 | func TestOCFB(t *testing.T) { 44 | testOCFB(t, OCFBNoResync) 45 | testOCFB(t, OCFBResync) 46 | } 47 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/pkcs12/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import "errors" 8 | 9 | var ( 10 | // ErrDecryption represents a failure to decrypt the input. 11 | ErrDecryption = errors.New("pkcs12: decryption error, incorrect padding") 12 | 13 | // ErrIncorrectPassword is returned when an incorrect password is detected. 14 | // Usually, P12/PFX data is signed to be able to verify the password. 15 | ErrIncorrectPassword = errors.New("pkcs12: decryption password incorrect") 16 | ) 17 | 18 | // NotImplementedError indicates that the input is not currently supported. 19 | type NotImplementedError string 20 | 21 | func (e NotImplementedError) Error() string { 22 | return "pkcs12: " + string(e) 23 | } 24 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/pkcs12/internal/rc2/bench_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package rc2 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func BenchmarkEncrypt(b *testing.B) { 12 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) 13 | b.ResetTimer() 14 | var src [8]byte 15 | for i := 0; i < b.N; i++ { 16 | r.Encrypt(src[:], src[:]) 17 | } 18 | } 19 | 20 | func BenchmarkDecrypt(b *testing.B) { 21 | r, _ := New([]byte{0, 0, 0, 0, 0, 0, 0, 0}, 64) 22 | b.ResetTimer() 23 | var src [8]byte 24 | for i := 0; i < b.N; i++ { 25 | r.Decrypt(src[:], src[:]) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/pkcs12/mac.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import ( 8 | "crypto/hmac" 9 | "crypto/sha1" 10 | "crypto/x509/pkix" 11 | "encoding/asn1" 12 | ) 13 | 14 | type macData struct { 15 | Mac digestInfo 16 | MacSalt []byte 17 | Iterations int `asn1:"optional,default:1"` 18 | } 19 | 20 | // from PKCS#7: 21 | type digestInfo struct { 22 | Algorithm pkix.AlgorithmIdentifier 23 | Digest []byte 24 | } 25 | 26 | var ( 27 | oidSHA1 = asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}) 28 | ) 29 | 30 | func verifyMac(macData *macData, message, password []byte) error { 31 | if !macData.Mac.Algorithm.Algorithm.Equal(oidSHA1) { 32 | return NotImplementedError("unknown digest algorithm: " + macData.Mac.Algorithm.Algorithm.String()) 33 | } 34 | 35 | key := pbkdf(sha1Sum, 20, 64, macData.MacSalt, password, macData.Iterations, 3, 20) 36 | 37 | mac := hmac.New(sha1.New, key) 38 | mac.Write(message) 39 | expectedMAC := mac.Sum(nil) 40 | 41 | if !hmac.Equal(macData.Mac.Digest, expectedMAC) { 42 | return ErrIncorrectPassword 43 | } 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/pkcs12/mac_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import ( 8 | "encoding/asn1" 9 | "testing" 10 | ) 11 | 12 | func TestVerifyMac(t *testing.T) { 13 | td := macData{ 14 | Mac: digestInfo{ 15 | Digest: []byte{0x18, 0x20, 0x3d, 0xff, 0x1e, 0x16, 0xf4, 0x92, 0xf2, 0xaf, 0xc8, 0x91, 0xa9, 0xba, 0xd6, 0xca, 0x9d, 0xee, 0x51, 0x93}, 16 | }, 17 | MacSalt: []byte{1, 2, 3, 4, 5, 6, 7, 8}, 18 | Iterations: 2048, 19 | } 20 | 21 | message := []byte{11, 12, 13, 14, 15} 22 | password, _ := bmpString("") 23 | 24 | td.Mac.Algorithm.Algorithm = asn1.ObjectIdentifier([]int{1, 2, 3}) 25 | err := verifyMac(&td, message, password) 26 | if _, ok := err.(NotImplementedError); !ok { 27 | t.Errorf("err: %v", err) 28 | } 29 | 30 | td.Mac.Algorithm.Algorithm = asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26}) 31 | err = verifyMac(&td, message, password) 32 | if err != ErrIncorrectPassword { 33 | t.Errorf("Expected incorrect password, got err: %v", err) 34 | } 35 | 36 | password, _ = bmpString("Sesame open") 37 | err = verifyMac(&td, message, password) 38 | if err != nil { 39 | t.Errorf("err: %v", err) 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/pkcs12/pbkdf_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package pkcs12 6 | 7 | import ( 8 | "bytes" 9 | "testing" 10 | ) 11 | 12 | func TestThatPBKDFWorksCorrectlyForLongKeys(t *testing.T) { 13 | cipherInfo := shaWithTripleDESCBC{} 14 | 15 | salt := []byte("\xff\xff\xff\xff\xff\xff\xff\xff") 16 | password, _ := bmpString("sesame") 17 | key := cipherInfo.deriveKey(salt, password, 2048) 18 | 19 | if expected := []byte("\x7c\xd9\xfd\x3e\x2b\x3b\xe7\x69\x1a\x44\xe3\xbe\xf0\xf9\xea\x0f\xb9\xb8\x97\xd4\xe3\x25\xd9\xd1"); bytes.Compare(key, expected) != 0 { 20 | t.Fatalf("expected key '%x', but found '%x'", expected, key) 21 | } 22 | } 23 | 24 | func TestThatPBKDFHandlesLeadingZeros(t *testing.T) { 25 | // This test triggers a case where I_j (in step 6C) ends up with leading zero 26 | // byte, meaning that len(Ijb) < v (leading zeros get stripped by big.Int). 27 | // This was previously causing bug whereby certain inputs would break the 28 | // derivation and produce the wrong output. 29 | key := pbkdf(sha1Sum, 20, 64, []byte("\xf3\x7e\x05\xb5\x18\x32\x4b\x4b"), []byte("\x00\x00"), 2048, 1, 24) 30 | expected := []byte("\x00\xf7\x59\xff\x47\xd1\x4d\xd0\x36\x65\xd5\x94\x3c\xb3\xc4\xa3\x9a\x25\x55\xc0\x2a\xed\x66\xe1") 31 | if bytes.Compare(key, expected) != 0 { 32 | t.Fatalf("expected key '%x', but found '%x'", expected, key) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/poly1305/mac_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!ppc64le gccgo appengine 6 | 7 | package poly1305 8 | 9 | type mac struct{ macGeneric } 10 | 11 | func newMAC(key *[32]byte) mac { return mac{newMACGeneric(key)} } 12 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/poly1305/sum_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,!gccgo,!appengine,!nacl 6 | 7 | package poly1305 8 | 9 | // This function is implemented in sum_arm.s 10 | //go:noescape 11 | func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]byte) 12 | 13 | // Sum generates an authenticator for m using a one-time key and puts the 14 | // 16-byte result into out. Authenticating two different messages with the same 15 | // key allows an attacker to forge messages at will. 16 | func Sum(out *[16]byte, m []byte, key *[32]byte) { 17 | var mPtr *byte 18 | if len(m) > 0 { 19 | mPtr = &m[0] 20 | } 21 | poly1305_auth_armv6(out, mPtr, uint32(len(m)), key) 22 | } 23 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/poly1305/sum_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x,!go1.11 !arm,!amd64,!s390x,!ppc64le gccgo appengine nacl 6 | 7 | package poly1305 8 | 9 | // Sum generates an authenticator for msg using a one-time key and puts the 10 | // 16-byte result into out. Authenticating two different messages with the same 11 | // key allows an attacker to forge messages at will. 12 | func Sum(out *[TagSize]byte, msg []byte, key *[32]byte) { 13 | h := newMAC(key) 14 | h.Write(msg) 15 | h.Sum(out) 16 | } 17 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/poly1305/sum_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x,go1.11,!gccgo,!appengine 6 | 7 | package poly1305 8 | 9 | import ( 10 | "golang.org/x/sys/cpu" 11 | ) 12 | 13 | // poly1305vx is an assembly implementation of Poly1305 that uses vector 14 | // instructions. It must only be called if the vector facility (vx) is 15 | // available. 16 | //go:noescape 17 | func poly1305vx(out *[16]byte, m *byte, mlen uint64, key *[32]byte) 18 | 19 | // poly1305vmsl is an assembly implementation of Poly1305 that uses vector 20 | // instructions, including VMSL. It must only be called if the vector facility (vx) is 21 | // available and if VMSL is supported. 22 | //go:noescape 23 | func poly1305vmsl(out *[16]byte, m *byte, mlen uint64, key *[32]byte) 24 | 25 | // Sum generates an authenticator for m using a one-time key and puts the 26 | // 16-byte result into out. Authenticating two different messages with the same 27 | // key allows an attacker to forge messages at will. 28 | func Sum(out *[16]byte, m []byte, key *[32]byte) { 29 | if cpu.S390X.HasVX { 30 | var mPtr *byte 31 | if len(m) > 0 { 32 | mPtr = &m[0] 33 | } 34 | if cpu.S390X.HasVXE && len(m) > 256 { 35 | poly1305vmsl(out, mPtr, uint64(len(m)), key) 36 | } else { 37 | poly1305vx(out, mPtr, uint64(len(m)), key) 38 | } 39 | } else { 40 | sumGeneric(out, m, key) 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package salsa 8 | 9 | //go:noescape 10 | 11 | // salsa2020XORKeyStream is implemented in salsa20_amd64.s. 12 | func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) 13 | 14 | // XORKeyStream crypts bytes from in to out using the given key and counters. 15 | // In and out must overlap entirely or not at all. Counter 16 | // contains the raw salsa20 counter bytes (both nonce and block counter). 17 | func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { 18 | if len(in) == 0 { 19 | return 20 | } 21 | _ = out[len(in)-1] 22 | salsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0]) 23 | } 24 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package salsa 8 | 9 | import ( 10 | "bytes" 11 | "testing" 12 | ) 13 | 14 | func TestCounterOverflow(t *testing.T) { 15 | in := make([]byte, 4096) 16 | key := &[32]byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 17 | 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2} 18 | for n, counter := range []*[16]byte{ 19 | &[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0}, // zero counter 20 | &[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff}, // counter about to overflow 32 bits 21 | &[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 0xff, 0xff, 0xff, 0xff}, // counter above 32 bits 22 | } { 23 | out := make([]byte, 4096) 24 | XORKeyStream(out, in, counter, key) 25 | outGeneric := make([]byte, 4096) 26 | genericXORKeyStream(outGeneric, in, counter, key) 27 | if !bytes.Equal(out, outGeneric) { 28 | t.Errorf("%d: assembly and go implementations disagree", n) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/salsa20/salsa/salsa20_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64 appengine gccgo 6 | 7 | package salsa 8 | 9 | // XORKeyStream crypts bytes from in to out using the given key and counters. 10 | // In and out must overlap entirely or not at all. Counter 11 | // contains the raw salsa20 counter bytes (both nonce and block counter). 12 | func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { 13 | genericXORKeyStream(out, in, counter, key) 14 | } 15 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/scrypt/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package scrypt_test 6 | 7 | import ( 8 | "encoding/base64" 9 | "fmt" 10 | "log" 11 | 12 | "golang.org/x/crypto/scrypt" 13 | ) 14 | 15 | func Example() { 16 | // DO NOT use this salt value; generate your own random salt. 8 bytes is 17 | // a good length. 18 | salt := []byte{0xc8, 0x28, 0xf2, 0x58, 0xa7, 0x6a, 0xad, 0x7b} 19 | 20 | dk, err := scrypt.Key([]byte("some password"), salt, 1<<15, 8, 1, 32) 21 | if err != nil { 22 | log.Fatal(err) 23 | } 24 | fmt.Println(base64.StdEncoding.EncodeToString(dk)) 25 | // Output: lGnMz8io0AUkfzn6Pls1qX20Vs7PGN6sbYQ2TQgY12M= 26 | } 27 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/sha3/hashes_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //+build gccgo appengine !s390x 6 | 7 | package sha3 8 | 9 | import ( 10 | "hash" 11 | ) 12 | 13 | // new224Asm returns an assembly implementation of SHA3-224 if available, 14 | // otherwise it returns nil. 15 | func new224Asm() hash.Hash { return nil } 16 | 17 | // new256Asm returns an assembly implementation of SHA3-256 if available, 18 | // otherwise it returns nil. 19 | func new256Asm() hash.Hash { return nil } 20 | 21 | // new384Asm returns an assembly implementation of SHA3-384 if available, 22 | // otherwise it returns nil. 23 | func new384Asm() hash.Hash { return nil } 24 | 25 | // new512Asm returns an assembly implementation of SHA3-512 if available, 26 | // otherwise it returns nil. 27 | func new512Asm() hash.Hash { return nil } 28 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/sha3/keccakf_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package sha3 8 | 9 | // This function is implemented in keccakf_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func keccakF1600(a *[25]uint64) 14 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/sha3/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package sha3 8 | 9 | import ( 10 | "crypto" 11 | ) 12 | 13 | func init() { 14 | crypto.RegisterHash(crypto.SHA3_224, New224) 15 | crypto.RegisterHash(crypto.SHA3_256, New256) 16 | crypto.RegisterHash(crypto.SHA3_384, New384) 17 | crypto.RegisterHash(crypto.SHA3_512, New512) 18 | } 19 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/sha3/sha3_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //+build !gccgo,!appengine 6 | 7 | #include "textflag.h" 8 | 9 | // func kimd(function code, chain *[200]byte, src []byte) 10 | TEXT ·kimd(SB), NOFRAME|NOSPLIT, $0-40 11 | MOVD function+0(FP), R0 12 | MOVD chain+8(FP), R1 13 | LMG src+16(FP), R2, R3 // R2=base, R3=len 14 | 15 | continue: 16 | WORD $0xB93E0002 // KIMD --, R2 17 | BVS continue // continue if interrupted 18 | MOVD $0, R0 // reset R0 for pre-go1.8 compilers 19 | RET 20 | 21 | // func klmd(function code, chain *[200]byte, dst, src []byte) 22 | TEXT ·klmd(SB), NOFRAME|NOSPLIT, $0-64 23 | // TODO: SHAKE support 24 | MOVD function+0(FP), R0 25 | MOVD chain+8(FP), R1 26 | LMG dst+16(FP), R2, R3 // R2=base, R3=len 27 | LMG src+40(FP), R4, R5 // R4=base, R5=len 28 | 29 | continue: 30 | WORD $0xB93F0024 // KLMD R2, R4 31 | BVS continue // continue if interrupted 32 | MOVD $0, R0 // reset R0 for pre-go1.8 compilers 33 | RET 34 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/sha3/shake_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //+build gccgo appengine !s390x 6 | 7 | package sha3 8 | 9 | // newShake128Asm returns an assembly implementation of SHAKE-128 if available, 10 | // otherwise it returns nil. 11 | func newShake128Asm() ShakeHash { 12 | return nil 13 | } 14 | 15 | // newShake256Asm returns an assembly implementation of SHAKE-256 if available, 16 | // otherwise it returns nil. 17 | func newShake256Asm() ShakeHash { 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/github/gh-mysql-tools/8bdf0cb85bdd63c87b09ab24333272efcf3325c0/skeefree/vendor/golang.org/x/crypto/sha3/testdata/keccakKats.json.deflate -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/sha3/xor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386,!ppc64le appengine 6 | 7 | package sha3 8 | 9 | var ( 10 | xorIn = xorInGeneric 11 | copyOut = copyOutGeneric 12 | xorInUnaligned = xorInGeneric 13 | copyOutUnaligned = copyOutGeneric 14 | ) 15 | 16 | const xorImplementationUnaligned = "generic" 17 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/sha3/xor_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package sha3 6 | 7 | import "encoding/binary" 8 | 9 | // xorInGeneric xors the bytes in buf into the state; it 10 | // makes no non-portable assumptions about memory layout 11 | // or alignment. 12 | func xorInGeneric(d *state, buf []byte) { 13 | n := len(buf) / 8 14 | 15 | for i := 0; i < n; i++ { 16 | a := binary.LittleEndian.Uint64(buf) 17 | d.a[i] ^= a 18 | buf = buf[8:] 19 | } 20 | } 21 | 22 | // copyOutGeneric copies ulint64s to a byte buffer. 23 | func copyOutGeneric(d *state, b []byte) { 24 | for i := 0; len(b) >= 8; i++ { 25 | binary.LittleEndian.PutUint64(b, d.a[i]) 26 | b = b[8:] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/sha3/xor_unaligned.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 386 ppc64le 6 | // +build !appengine 7 | 8 | package sha3 9 | 10 | import "unsafe" 11 | 12 | func xorInUnaligned(d *state, buf []byte) { 13 | bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0])) 14 | n := len(buf) 15 | if n >= 72 { 16 | d.a[0] ^= bw[0] 17 | d.a[1] ^= bw[1] 18 | d.a[2] ^= bw[2] 19 | d.a[3] ^= bw[3] 20 | d.a[4] ^= bw[4] 21 | d.a[5] ^= bw[5] 22 | d.a[6] ^= bw[6] 23 | d.a[7] ^= bw[7] 24 | d.a[8] ^= bw[8] 25 | } 26 | if n >= 104 { 27 | d.a[9] ^= bw[9] 28 | d.a[10] ^= bw[10] 29 | d.a[11] ^= bw[11] 30 | d.a[12] ^= bw[12] 31 | } 32 | if n >= 136 { 33 | d.a[13] ^= bw[13] 34 | d.a[14] ^= bw[14] 35 | d.a[15] ^= bw[15] 36 | d.a[16] ^= bw[16] 37 | } 38 | if n >= 144 { 39 | d.a[17] ^= bw[17] 40 | } 41 | if n >= 168 { 42 | d.a[18] ^= bw[18] 43 | d.a[19] ^= bw[19] 44 | d.a[20] ^= bw[20] 45 | } 46 | } 47 | 48 | func copyOutUnaligned(d *state, buf []byte) { 49 | ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0])) 50 | copy(buf, ab[:]) 51 | } 52 | 53 | var ( 54 | xorIn = xorInUnaligned 55 | copyOut = copyOutUnaligned 56 | ) 57 | 58 | const xorImplementationUnaligned = "unaligned" 59 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/agent/example_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package agent_test 6 | 7 | import ( 8 | "log" 9 | "net" 10 | "os" 11 | 12 | "golang.org/x/crypto/ssh" 13 | "golang.org/x/crypto/ssh/agent" 14 | ) 15 | 16 | func ExampleClientAgent() { 17 | // ssh-agent has a UNIX socket under $SSH_AUTH_SOCK 18 | socket := os.Getenv("SSH_AUTH_SOCK") 19 | conn, err := net.Dial("unix", socket) 20 | if err != nil { 21 | log.Fatalf("net.Dial: %v", err) 22 | } 23 | agentClient := agent.NewClient(conn) 24 | config := &ssh.ClientConfig{ 25 | User: "username", 26 | Auth: []ssh.AuthMethod{ 27 | // Use a callback rather than PublicKeys 28 | // so we only consult the agent once the remote server 29 | // wants it. 30 | ssh.PublicKeysCallback(agentClient.Signers), 31 | }, 32 | HostKeyCallback: ssh.InsecureIgnoreHostKey(), 33 | } 34 | 35 | sshc, err := ssh.Dial("tcp", "localhost:22", config) 36 | if err != nil { 37 | log.Fatalf("Dial: %v", err) 38 | } 39 | // .. use sshc 40 | sshc.Close() 41 | } 42 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package ssh implements an SSH client and server. 7 | 8 | SSH is a transport security protocol, an authentication protocol and a 9 | family of application protocols. The most typical application level 10 | protocol is a remote shell and this is specifically implemented. However, 11 | the multiplexed nature of SSH is exposed to users that wish to support 12 | others. 13 | 14 | References: 15 | [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD 16 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 17 | 18 | This package does not fall under the stability promise of the Go language itself, 19 | so its API may be changed when pressing needs arise. 20 | */ 21 | package ssh // import "golang.org/x/crypto/ssh" 22 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/kex_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ssh 6 | 7 | // Key exchange tests. 8 | 9 | import ( 10 | "crypto/rand" 11 | "reflect" 12 | "testing" 13 | ) 14 | 15 | func TestKexes(t *testing.T) { 16 | type kexResultErr struct { 17 | result *kexResult 18 | err error 19 | } 20 | 21 | for name, kex := range kexAlgoMap { 22 | a, b := memPipe() 23 | 24 | s := make(chan kexResultErr, 1) 25 | c := make(chan kexResultErr, 1) 26 | var magics handshakeMagics 27 | go func() { 28 | r, e := kex.Client(a, rand.Reader, &magics) 29 | a.Close() 30 | c <- kexResultErr{r, e} 31 | }() 32 | go func() { 33 | r, e := kex.Server(b, rand.Reader, &magics, testSigners["ecdsa"]) 34 | b.Close() 35 | s <- kexResultErr{r, e} 36 | }() 37 | 38 | clientRes := <-c 39 | serverRes := <-s 40 | if clientRes.err != nil { 41 | t.Errorf("client: %v", clientRes.err) 42 | } 43 | if serverRes.err != nil { 44 | t.Errorf("server: %v", serverRes.err) 45 | } 46 | if !reflect.DeepEqual(clientRes.result, serverRes.result) { 47 | t.Errorf("kex %q: mismatch %#v, %#v", name, clientRes.result, serverRes.result) 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/mac.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ssh 6 | 7 | // Message authentication support 8 | 9 | import ( 10 | "crypto/hmac" 11 | "crypto/sha1" 12 | "crypto/sha256" 13 | "hash" 14 | ) 15 | 16 | type macMode struct { 17 | keySize int 18 | etm bool 19 | new func(key []byte) hash.Hash 20 | } 21 | 22 | // truncatingMAC wraps around a hash.Hash and truncates the output digest to 23 | // a given size. 24 | type truncatingMAC struct { 25 | length int 26 | hmac hash.Hash 27 | } 28 | 29 | func (t truncatingMAC) Write(data []byte) (int, error) { 30 | return t.hmac.Write(data) 31 | } 32 | 33 | func (t truncatingMAC) Sum(in []byte) []byte { 34 | out := t.hmac.Sum(in) 35 | return out[:len(in)+t.length] 36 | } 37 | 38 | func (t truncatingMAC) Reset() { 39 | t.hmac.Reset() 40 | } 41 | 42 | func (t truncatingMAC) Size() int { 43 | return t.length 44 | } 45 | 46 | func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } 47 | 48 | var macModes = map[string]*macMode{ 49 | "hmac-sha2-256-etm@openssh.com": {32, true, func(key []byte) hash.Hash { 50 | return hmac.New(sha256.New, key) 51 | }}, 52 | "hmac-sha2-256": {32, false, func(key []byte) hash.Hash { 53 | return hmac.New(sha256.New, key) 54 | }}, 55 | "hmac-sha1": {20, false, func(key []byte) hash.Hash { 56 | return hmac.New(sha1.New, key) 57 | }}, 58 | "hmac-sha1-96": {20, false, func(key []byte) hash.Hash { 59 | return truncatingMAC{12, hmac.New(sha1.New, key)} 60 | }}, 61 | } 62 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/tcpip_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ssh 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func TestAutoPortListenBroken(t *testing.T) { 12 | broken := "SSH-2.0-OpenSSH_5.9hh11" 13 | works := "SSH-2.0-OpenSSH_6.1" 14 | if !isBrokenOpenSSHVersion(broken) { 15 | t.Errorf("version %q not marked as broken", broken) 16 | } 17 | if isBrokenOpenSSHVersion(works) { 18 | t.Errorf("version %q marked as broken", works) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/terminal/util_aix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TCGETS 12 | const ioctlWriteTermios = unix.TCSETS 13 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/test/banner_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package test 8 | 9 | import ( 10 | "testing" 11 | ) 12 | 13 | func TestBannerCallbackAgainstOpenSSH(t *testing.T) { 14 | server := newServer(t) 15 | defer server.Shutdown() 16 | 17 | clientConf := clientConfig() 18 | 19 | var receivedBanner string 20 | clientConf.BannerCallback = func(message string) error { 21 | receivedBanner = message 22 | return nil 23 | } 24 | 25 | conn := server.Dial(clientConf) 26 | defer conn.Close() 27 | 28 | expected := "Server Banner" 29 | if receivedBanner != expected { 30 | t.Fatalf("got %v; want %v", receivedBanner, expected) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/test/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package test contains integration tests for the 6 | // golang.org/x/crypto/ssh package. 7 | package test // import "golang.org/x/crypto/ssh/test" 8 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/crypto/ssh/testdata/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This package contains test data shared between the various subpackages of 6 | // the golang.org/x/crypto/ssh package. Under no circumstance should 7 | // this data be used for production code. 8 | package testdata // import "golang.org/x/crypto/ssh/testdata" 9 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/http2/flow.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Flow control 6 | 7 | package http2 8 | 9 | // flow is the flow control window's size. 10 | type flow struct { 11 | // n is the number of DATA bytes we're allowed to send. 12 | // A flow is kept both on a conn and a per-stream. 13 | n int32 14 | 15 | // conn points to the shared connection-level flow that is 16 | // shared by all streams on that conn. It is nil for the flow 17 | // that's on the conn directly. 18 | conn *flow 19 | } 20 | 21 | func (f *flow) setConnFlow(cf *flow) { f.conn = cf } 22 | 23 | func (f *flow) available() int32 { 24 | n := f.n 25 | if f.conn != nil && f.conn.n < n { 26 | n = f.conn.n 27 | } 28 | return n 29 | } 30 | 31 | func (f *flow) take(n int32) { 32 | if n > f.available() { 33 | panic("internal error: took too much") 34 | } 35 | f.n -= n 36 | if f.conn != nil { 37 | f.conn.n -= n 38 | } 39 | } 40 | 41 | // add adds n bytes (positive or negative) to the flow control window. 42 | // It returns false if the sum would exceed 2^31-1. 43 | func (f *flow) add(n int32) bool { 44 | remain := (1<<31 - 1) - f.n 45 | if n > remain { 46 | return false 47 | } 48 | f.n += n 49 | return true 50 | } 51 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/http2/go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 15 | return t1.ExpectContinueTimeout 16 | } 17 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/http2/go17_not18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7,!go1.8 6 | 7 | package http2 8 | 9 | import "crypto/tls" 10 | 11 | // temporary copy of Go 1.7's private tls.Config.clone: 12 | func cloneTLSConfig(c *tls.Config) *tls.Config { 13 | return &tls.Config{ 14 | Rand: c.Rand, 15 | Time: c.Time, 16 | Certificates: c.Certificates, 17 | NameToCertificate: c.NameToCertificate, 18 | GetCertificate: c.GetCertificate, 19 | RootCAs: c.RootCAs, 20 | NextProtos: c.NextProtos, 21 | ServerName: c.ServerName, 22 | ClientAuth: c.ClientAuth, 23 | ClientCAs: c.ClientCAs, 24 | InsecureSkipVerify: c.InsecureSkipVerify, 25 | CipherSuites: c.CipherSuites, 26 | PreferServerCipherSuites: c.PreferServerCipherSuites, 27 | SessionTicketsDisabled: c.SessionTicketsDisabled, 28 | SessionTicketKey: c.SessionTicketKey, 29 | ClientSessionCache: c.ClientSessionCache, 30 | MinVersion: c.MinVersion, 31 | MaxVersion: c.MaxVersion, 32 | CurvePreferences: c.CurvePreferences, 33 | DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, 34 | Renegotiation: c.Renegotiation, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/http2/go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "crypto/tls" 11 | "io" 12 | "net/http" 13 | ) 14 | 15 | func cloneTLSConfig(c *tls.Config) *tls.Config { 16 | c2 := c.Clone() 17 | c2.GetClientCertificate = c.GetClientCertificate // golang.org/issue/19264 18 | return c2 19 | } 20 | 21 | var _ http.Pusher = (*responseWriter)(nil) 22 | 23 | // Push implements http.Pusher. 24 | func (w *responseWriter) Push(target string, opts *http.PushOptions) error { 25 | internalOpts := pushOptions{} 26 | if opts != nil { 27 | internalOpts.Method = opts.Method 28 | internalOpts.Header = opts.Header 29 | } 30 | return w.push(target, internalOpts) 31 | } 32 | 33 | func configureServer18(h1 *http.Server, h2 *Server) error { 34 | if h2.IdleTimeout == 0 { 35 | if h1.IdleTimeout != 0 { 36 | h2.IdleTimeout = h1.IdleTimeout 37 | } else { 38 | h2.IdleTimeout = h1.ReadTimeout 39 | } 40 | } 41 | return nil 42 | } 43 | 44 | func shouldLogPanic(panicValue interface{}) bool { 45 | return panicValue != nil && panicValue != http.ErrAbortHandler 46 | } 47 | 48 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 49 | return req.GetBody 50 | } 51 | 52 | func reqBodyIsNoBody(body io.ReadCloser) bool { 53 | return body == http.NoBody 54 | } 55 | 56 | func go18httpNoBody() io.ReadCloser { return http.NoBody } // for tests only 57 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/http2/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | s.RegisterOnShutdown(conf.state.startGracefulShutdown) 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/http2/not_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func configureTransport(t1 *http.Transport) (*Transport, error) { 15 | return nil, errTransportVersion 16 | } 17 | 18 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 19 | return 0 20 | 21 | } 22 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/http2/not_go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | func configureServer18(h1 *http.Server, h2 *Server) error { 15 | // No IdleTimeout to sync prior to Go 1.8. 16 | return nil 17 | } 18 | 19 | func shouldLogPanic(panicValue interface{}) bool { 20 | return panicValue != nil 21 | } 22 | 23 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 24 | return nil 25 | } 26 | 27 | func reqBodyIsNoBody(io.ReadCloser) bool { return false } 28 | 29 | func go18httpNoBody() io.ReadCloser { return nil } // for tests only 30 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/http2/not_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | // not supported prior to go1.9 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/trace/trace_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7 6 | 7 | package trace 8 | 9 | import "golang.org/x/net/context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/net/trace/trace_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package trace 8 | 9 | import "context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - tip 5 | 6 | install: 7 | - export GOPATH="$HOME/gopath" 8 | - mkdir -p "$GOPATH/src/golang.org/x" 9 | - mv "$TRAVIS_BUILD_DIR" "$GOPATH/src/golang.org/x/oauth2" 10 | - go get -v -t -d golang.org/x/oauth2/... 11 | 12 | script: 13 | - go test -v golang.org/x/oauth2/... 14 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | ## Filing issues 8 | 9 | When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: 10 | 11 | 1. What version of Go are you using (`go version`)? 12 | 2. What operating system and processor architecture are you using? 13 | 3. What did you do? 14 | 4. What did you expect to see? 15 | 5. What did you see instead? 16 | 17 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 18 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 19 | 20 | ## Contributing code 21 | 22 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 23 | before sending patches. 24 | 25 | Unless otherwise noted, the Go source files are distributed under 26 | the BSD-style license found in the LICENSE file. 27 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/google/appengine_hook.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine appenginevm 6 | 7 | package google 8 | 9 | import "google.golang.org/appengine" 10 | 11 | func init() { 12 | appengineTokenFunc = appengine.AccessToken 13 | appengineAppIDFunc = appengine.AppID 14 | } 15 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/google/appengineflex_hook.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appenginevm 6 | 7 | package google 8 | 9 | func init() { 10 | appengineFlex = true // Flex doesn't support appengine.AccessToken; depend on metadata server. 11 | } 12 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/internal/client_appengine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package internal 8 | 9 | import "google.golang.org/appengine/urlfetch" 10 | 11 | func init() { 12 | appengineClientHook = urlfetch.Client 13 | } 14 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/internal/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package internal contains support packages for oauth2 package. 6 | package internal 7 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/internal/oauth2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "crypto/rsa" 9 | "crypto/x509" 10 | "encoding/pem" 11 | "errors" 12 | "fmt" 13 | ) 14 | 15 | // ParseKey converts the binary contents of a private key file 16 | // to an *rsa.PrivateKey. It detects whether the private key is in a 17 | // PEM container or not. If so, it extracts the the private key 18 | // from PEM container before conversion. It only supports PEM 19 | // containers with no passphrase. 20 | func ParseKey(key []byte) (*rsa.PrivateKey, error) { 21 | block, _ := pem.Decode(key) 22 | if block != nil { 23 | key = block.Bytes 24 | } 25 | parsedKey, err := x509.ParsePKCS8PrivateKey(key) 26 | if err != nil { 27 | parsedKey, err = x509.ParsePKCS1PrivateKey(key) 28 | if err != nil { 29 | return nil, fmt.Errorf("private key should be a PEM or plain PKSC1 or PKCS8; parse error: %v", err) 30 | } 31 | } 32 | parsed, ok := parsedKey.(*rsa.PrivateKey) 33 | if !ok { 34 | return nil, errors.New("private key is invalid") 35 | } 36 | return parsed, nil 37 | } 38 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/oauth2/internal/transport.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package internal 6 | 7 | import ( 8 | "net/http" 9 | 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // HTTPClient is the context key to use with golang.org/x/net/context's 14 | // WithValue function to associate an *http.Client value with a context. 15 | var HTTPClient ContextKey 16 | 17 | // ContextKey is just an empty struct. It exists so HTTPClient can be 18 | // an immutable public variable with a unique type. It's immutable 19 | // because nobody else can create a ContextKey, being unexported. 20 | type ContextKey struct{} 21 | 22 | var appengineClientHook func(context.Context) *http.Client 23 | 24 | func ContextClient(ctx context.Context) *http.Client { 25 | if ctx != nil { 26 | if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { 27 | return hc 28 | } 29 | } 30 | if appengineClientHook != nil { 31 | return appengineClientHook(ctx) 32 | } 33 | return http.DefaultClient 34 | } 35 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/sync/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/sync/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/sync/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/sync/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/collate/index.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package collate 6 | 7 | import "golang.org/x/text/internal/colltab" 8 | 9 | const blockSize = 64 10 | 11 | func getTable(t tableIndex) *colltab.Table { 12 | return &colltab.Table{ 13 | Index: colltab.Trie{ 14 | Index0: mainLookup[:][blockSize*t.lookupOffset:], 15 | Values0: mainValues[:][blockSize*t.valuesOffset:], 16 | Index: mainLookup[:], 17 | Values: mainValues[:], 18 | }, 19 | ExpandElem: mainExpandElem[:], 20 | ContractTries: colltab.ContractTrieSet(mainCTEntries[:]), 21 | ContractElem: mainContractElem[:], 22 | MaxContractLen: 18, 23 | VariableTop: varTop, 24 | } 25 | } 26 | 27 | // tableIndex holds information for constructing a table 28 | // for a certain locale based on the main table. 29 | type tableIndex struct { 30 | lookupOffset uint32 31 | valuesOffset uint32 32 | } 33 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/internal/colltab/weighter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package colltab // import "golang.org/x/text/internal/colltab" 6 | 7 | // A Weighter can be used as a source for Collator and Searcher. 8 | type Weighter interface { 9 | // Start finds the start of the segment that includes position p. 10 | Start(p int, b []byte) int 11 | 12 | // StartString finds the start of the segment that includes position p. 13 | StartString(p int, s string) int 14 | 15 | // AppendNext appends Elems to buf corresponding to the longest match 16 | // of a single character or contraction from the start of s. 17 | // It returns the new buf and the number of bytes consumed. 18 | AppendNext(buf []Elem, s []byte) (ce []Elem, n int) 19 | 20 | // AppendNextString appends Elems to buf corresponding to the longest match 21 | // of a single character or contraction from the start of s. 22 | // It returns the new buf and the number of bytes consumed. 23 | AppendNextString(buf []Elem, s string) (ce []Elem, n int) 24 | 25 | // Domain returns a slice of all single characters and contractions for which 26 | // collation elements are defined in this table. 27 | Domain() []string 28 | 29 | // Top returns the highest variable primary value. 30 | Top() uint32 31 | } 32 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/internal/format/format.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package format contains types for defining language-specific formatting of 6 | // values. 7 | // 8 | // This package is internal now, but will eventually be exposed after the API 9 | // settles. 10 | package format // import "golang.org/x/text/internal/format" 11 | 12 | import ( 13 | "fmt" 14 | 15 | "golang.org/x/text/language" 16 | ) 17 | 18 | // State represents the printer state passed to custom formatters. It provides 19 | // access to the fmt.State interface and the sentence and language-related 20 | // context. 21 | type State interface { 22 | fmt.State 23 | 24 | // Language reports the requested language in which to render a message. 25 | Language() language.Tag 26 | 27 | // TODO: consider this and removing rune from the Format method in the 28 | // Formatter interface. 29 | // 30 | // Verb returns the format variant to render, analogous to the types used 31 | // in fmt. Use 'v' for the default or only variant. 32 | // Verb() rune 33 | 34 | // TODO: more info: 35 | // - sentence context such as linguistic features passed by the translator. 36 | } 37 | 38 | // Formatter is analogous to fmt.Formatter. 39 | type Formatter interface { 40 | Format(state State, verb rune) 41 | } 42 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/internal/gen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | package main 8 | 9 | import ( 10 | "log" 11 | 12 | "golang.org/x/text/internal/gen" 13 | "golang.org/x/text/language" 14 | "golang.org/x/text/unicode/cldr" 15 | ) 16 | 17 | func main() { 18 | r := gen.OpenCLDRCoreZip() 19 | defer r.Close() 20 | 21 | d := &cldr.Decoder{} 22 | data, err := d.DecodeZip(r) 23 | if err != nil { 24 | log.Fatalf("DecodeZip: %v", err) 25 | } 26 | 27 | w := gen.NewCodeWriter() 28 | defer w.WriteGoFile("tables.go", "internal") 29 | 30 | // Create parents table. 31 | parents := make([]uint16, language.NumCompactTags) 32 | for _, loc := range data.Locales() { 33 | tag := language.MustParse(loc) 34 | index, ok := language.CompactIndex(tag) 35 | if !ok { 36 | continue 37 | } 38 | parentIndex := 0 // und 39 | for p := tag.Parent(); p != language.Und; p = p.Parent() { 40 | if x, ok := language.CompactIndex(p); ok { 41 | parentIndex = x 42 | break 43 | } 44 | } 45 | parents[index] = uint16(parentIndex) 46 | } 47 | 48 | w.WriteComment(` 49 | Parent maps a compact index of a tag to the compact index of the parent of 50 | this tag.`) 51 | w.WriteVar("Parent", parents) 52 | } 53 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/internal/internal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:generate go run gen.go 6 | 7 | // Package internal contains non-exported functionality that are used by 8 | // packages in the text repository. 9 | package internal // import "golang.org/x/text/internal" 10 | 11 | import ( 12 | "sort" 13 | 14 | "golang.org/x/text/language" 15 | ) 16 | 17 | // SortTags sorts tags in place. 18 | func SortTags(tags []language.Tag) { 19 | sort.Sort(sorter(tags)) 20 | } 21 | 22 | type sorter []language.Tag 23 | 24 | func (s sorter) Len() int { 25 | return len(s) 26 | } 27 | 28 | func (s sorter) Swap(i, j int) { 29 | s[i], s[j] = s[j], s[i] 30 | } 31 | 32 | func (s sorter) Less(i, j int) bool { 33 | return s[i].String() < s[j].String() 34 | } 35 | 36 | // UniqueTags sorts and filters duplicate tags in place and returns a slice with 37 | // only unique tags. 38 | func UniqueTags(tags []language.Tag) []language.Tag { 39 | if len(tags) <= 1 { 40 | return tags 41 | } 42 | SortTags(tags) 43 | k := 0 44 | for i := 1; i < len(tags); i++ { 45 | if tags[k].String() < tags[i].String() { 46 | k++ 47 | tags[k] = tags[i] 48 | } 49 | } 50 | return tags[:k+1] 51 | } 52 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/internal/number/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package number 4 | 5 | import "unicode/utf8" 6 | 7 | // A system identifies a CLDR numbering system. 8 | type system byte 9 | 10 | type systemData struct { 11 | id system 12 | digitSize byte // number of UTF-8 bytes per digit 13 | zero [utf8.UTFMax]byte // UTF-8 sequence of zero digit. 14 | } 15 | 16 | // A SymbolType identifies a symbol of a specific kind. 17 | type SymbolType int 18 | 19 | const ( 20 | SymDecimal SymbolType = iota 21 | SymGroup 22 | SymList 23 | SymPercentSign 24 | SymPlusSign 25 | SymMinusSign 26 | SymExponential 27 | SymSuperscriptingExponent 28 | SymPerMille 29 | SymInfinity 30 | SymNan 31 | SymTimeSeparator 32 | 33 | NumSymbolTypes 34 | ) 35 | 36 | const hasNonLatnMask = 0x8000 37 | 38 | // symOffset is an offset into altSymData if the bit indicated by hasNonLatnMask 39 | // is not 0 (with this bit masked out), and an offset into symIndex otherwise. 40 | // 41 | // TODO: this type can be a byte again if we use an indirection into altsymData 42 | // and introduce an alt -> offset slice (the length of this will be number of 43 | // alternatives plus 1). This also allows getting rid of the compactTag field 44 | // in altSymData. In total this will save about 1K. 45 | type symOffset uint16 46 | 47 | type altSymData struct { 48 | compactTag uint16 49 | symIndex symOffset 50 | system system 51 | } 52 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/internal/number/gen_common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | package main 8 | 9 | import "unicode/utf8" 10 | 11 | // A system identifies a CLDR numbering system. 12 | type system byte 13 | 14 | type systemData struct { 15 | id system 16 | digitSize byte // number of UTF-8 bytes per digit 17 | zero [utf8.UTFMax]byte // UTF-8 sequence of zero digit. 18 | } 19 | 20 | // A SymbolType identifies a symbol of a specific kind. 21 | type SymbolType int 22 | 23 | const ( 24 | SymDecimal SymbolType = iota 25 | SymGroup 26 | SymList 27 | SymPercentSign 28 | SymPlusSign 29 | SymMinusSign 30 | SymExponential 31 | SymSuperscriptingExponent 32 | SymPerMille 33 | SymInfinity 34 | SymNan 35 | SymTimeSeparator 36 | 37 | NumSymbolTypes 38 | ) 39 | 40 | const hasNonLatnMask = 0x8000 41 | 42 | // symOffset is an offset into altSymData if the bit indicated by hasNonLatnMask 43 | // is not 0 (with this bit masked out), and an offset into symIndex otherwise. 44 | // 45 | // TODO: this type can be a byte again if we use an indirection into altsymData 46 | // and introduce an alt -> offset slice (the length of this will be number of 47 | // alternatives plus 1). This also allows getting rid of the compactTag field 48 | // in altSymData. In total this will save about 1K. 49 | type symOffset uint16 50 | 51 | type altSymData struct { 52 | compactTag uint16 53 | symIndex symOffset 54 | system system 55 | } 56 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/internal/number/roundingmode_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type RoundingMode"; DO NOT EDIT. 2 | 3 | package number 4 | 5 | import "fmt" 6 | 7 | const _RoundingMode_name = "ToNearestEvenToNearestZeroToNearestAwayToPositiveInfToNegativeInfToZeroAwayFromZeronumModes" 8 | 9 | var _RoundingMode_index = [...]uint8{0, 13, 26, 39, 52, 65, 71, 83, 91} 10 | 11 | func (i RoundingMode) String() string { 12 | if i >= RoundingMode(len(_RoundingMode_index)-1) { 13 | return fmt.Sprintf("RoundingMode(%d)", i) 14 | } 15 | return _RoundingMode_name[_RoundingMode_index[i]:_RoundingMode_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // langAliasType is the type of an alias in langAliasMap. 8 | type langAliasType int8 9 | 10 | const ( 11 | langDeprecated langAliasType = iota 12 | langMacro 13 | langLegacy 14 | 15 | langAliasTypeUnknown langAliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/language/gen_common.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | package main 8 | 9 | // This file contains code common to the maketables.go and the package code. 10 | 11 | // langAliasType is the type of an alias in langAliasMap. 12 | type langAliasType int8 13 | 14 | const ( 15 | langDeprecated langAliasType = iota 16 | langMacro 17 | langLegacy 18 | 19 | langAliasTypeUnknown langAliasType = -1 20 | ) 21 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/language/go1_1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | func sortStable(s sort.Interface) { 12 | ss := stableSort{ 13 | s: s, 14 | pos: make([]int, s.Len()), 15 | } 16 | for i := range ss.pos { 17 | ss.pos[i] = i 18 | } 19 | sort.Sort(&ss) 20 | } 21 | 22 | type stableSort struct { 23 | s sort.Interface 24 | pos []int 25 | } 26 | 27 | func (s *stableSort) Len() int { 28 | return len(s.pos) 29 | } 30 | 31 | func (s *stableSort) Less(i, j int) bool { 32 | return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j] 33 | } 34 | 35 | func (s *stableSort) Swap(i, j int) { 36 | s.s.Swap(i, j) 37 | s.pos[i], s.pos[j] = s.pos[j], s.pos[i] 38 | } 39 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/language/go1_2.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | var sortStable = sort.Stable 12 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/message/catalog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package message 6 | 7 | // TODO: some types in this file will need to be made public at some time. 8 | // Documentation and method names will reflect this by using the exported name. 9 | 10 | import ( 11 | "golang.org/x/text/language" 12 | "golang.org/x/text/message/catalog" 13 | ) 14 | 15 | // MatchLanguage reports the matched tag obtained from language.MatchStrings for 16 | // the Matcher of the DefaultCatalog. 17 | func MatchLanguage(preferred ...string) language.Tag { 18 | c := DefaultCatalog 19 | tag, _ := language.MatchStrings(c.Matcher(), preferred...) 20 | return tag 21 | } 22 | 23 | // DefaultCatalog is used by SetString. 24 | var DefaultCatalog catalog.Catalog = defaultCatalog 25 | 26 | var defaultCatalog = catalog.NewBuilder() 27 | 28 | // SetString calls SetString on the initial default Catalog. 29 | func SetString(tag language.Tag, key string, msg string) error { 30 | return defaultCatalog.SetString(tag, key, msg) 31 | } 32 | 33 | // Set calls Set on the initial default Catalog. 34 | func Set(tag language.Tag, key string, msg ...catalog.Message) error { 35 | return defaultCatalog.Set(tag, key, msg...) 36 | } 37 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/message/catalog/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package catalog 8 | 9 | import "golang.org/x/text/internal/catmsg" 10 | 11 | // A Message holds a collection of translations for the same phrase that may 12 | // vary based on the values of substitution arguments. 13 | type Message = catmsg.Message 14 | 15 | type firstInSequence = catmsg.FirstOf 16 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/message/catalog/gopre19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package catalog 8 | 9 | import "golang.org/x/text/internal/catmsg" 10 | 11 | // A Message holds a collection of translations for the same phrase that may 12 | // vary based on the values of substitution arguments. 13 | type Message interface { 14 | catmsg.Message 15 | } 16 | 17 | func firstInSequence(m []Message) catmsg.Message { 18 | a := []catmsg.Message{} 19 | for _, m := range m { 20 | a = append(a, m) 21 | } 22 | return catmsg.FirstOf(a) 23 | } 24 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 11 | } 12 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | if !t.isRTL() { 11 | return true 12 | } 13 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 14 | } 15 | -------------------------------------------------------------------------------- /skeefree/vendor/golang.org/x/text/unicode/norm/trie.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package norm 6 | 7 | type valueRange struct { 8 | value uint16 // header: value:stride 9 | lo, hi byte // header: lo:n 10 | } 11 | 12 | type sparseBlocks struct { 13 | values []valueRange 14 | offset []uint16 15 | } 16 | 17 | var nfcSparse = sparseBlocks{ 18 | values: nfcSparseValues[:], 19 | offset: nfcSparseOffset[:], 20 | } 21 | 22 | var nfkcSparse = sparseBlocks{ 23 | values: nfkcSparseValues[:], 24 | offset: nfkcSparseOffset[:], 25 | } 26 | 27 | var ( 28 | nfcData = newNfcTrie(0) 29 | nfkcData = newNfkcTrie(0) 30 | ) 31 | 32 | // lookupValue determines the type of block n and looks up the value for b. 33 | // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block 34 | // is a list of ranges with an accompanying value. Given a matching range r, 35 | // the value for b is by r.value + (b - r.lo) * stride. 36 | func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { 37 | offset := t.offset[n] 38 | header := t.values[offset] 39 | lo := offset + 1 40 | hi := lo + uint16(header.lo) 41 | for lo < hi { 42 | m := lo + (hi-lo)/2 43 | r := t.values[m] 44 | if r.lo <= b && b <= r.hi { 45 | return r.value + uint16(b-r.lo)*header.value 46 | } 47 | if b < r.lo { 48 | hi = m 49 | } else { 50 | lo = m + 1 51 | } 52 | } 53 | return 0 54 | } 55 | -------------------------------------------------------------------------------- /skeefree/vendor/google.golang.org/grpc/AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | -------------------------------------------------------------------------------- /skeefree/vendor/google.golang.org/grpc/credentials/credentials_util_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package credentials 22 | 23 | import ( 24 | "crypto/tls" 25 | ) 26 | 27 | // cloneTLSConfig returns a shallow clone of the exported 28 | // fields of cfg, ignoring the unexported sync.Once, which 29 | // contains a mutex and must not be copied. 30 | // 31 | // If cfg is nil, a new zero tls.Config is returned. 32 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 33 | if cfg == nil { 34 | return &tls.Config{} 35 | } 36 | 37 | return cfg.Clone() 38 | } 39 | -------------------------------------------------------------------------------- /skeefree/vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | /* 20 | Package grpc implements an RPC system called gRPC. 21 | 22 | See grpc.io for more information about gRPC. 23 | */ 24 | package grpc // import "google.golang.org/grpc" 25 | -------------------------------------------------------------------------------- /skeefree/vendor/google.golang.org/grpc/internal/internal.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 gRPC authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | // Package internal contains gRPC-internal code for testing, to avoid polluting 19 | // the godoc of the top-level grpc package. 20 | package internal 21 | 22 | // TestingUseHandlerImpl enables the http.Handler-based server implementation. 23 | // It must be called before Serve and requires TLS credentials. 24 | // 25 | // The provided grpcServer must be of type *grpc.Server. It is untyped 26 | // for circular dependency reasons. 27 | var TestingUseHandlerImpl func(grpcServer interface{}) 28 | -------------------------------------------------------------------------------- /skeefree/vendor/google.golang.org/grpc/naming/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6,!go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | ) 35 | -------------------------------------------------------------------------------- /skeefree/vendor/google.golang.org/grpc/naming/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | ) 29 | -------------------------------------------------------------------------------- /skeefree/vendor/google.golang.org/grpc/resolver/dns/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6, !go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | lookupTXT = func(ctx context.Context, name string) ([]string, error) { return net.LookupTXT(name) } 35 | ) 36 | -------------------------------------------------------------------------------- /skeefree/vendor/google.golang.org/grpc/resolver/dns/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | lookupTXT = net.DefaultResolver.LookupTXT 29 | ) 30 | -------------------------------------------------------------------------------- /skeefree/vendor/google.golang.org/grpc/transport/log.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2017 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // This file contains wrappers for grpclog functions. 20 | // The transport package only logs to verbose level 2 by default. 21 | 22 | package transport 23 | 24 | import "google.golang.org/grpc/grpclog" 25 | 26 | const logLevel = 2 27 | 28 | func infof(format string, args ...interface{}) { 29 | if grpclog.V(logLevel) { 30 | grpclog.Infof(format, args...) 31 | } 32 | } 33 | 34 | func warningf(format string, args ...interface{}) { 35 | if grpclog.V(logLevel) { 36 | grpclog.Warningf(format, args...) 37 | } 38 | } 39 | 40 | func errorf(format string, args ...interface{}) { 41 | if grpclog.V(logLevel) { 42 | grpclog.Errorf(format, args...) 43 | } 44 | } 45 | 46 | func fatalf(format string, args ...interface{}) { 47 | if grpclog.V(logLevel) { 48 | grpclog.Fatalf(format, args...) 49 | } 50 | } 51 | --------------------------------------------------------------------------------