├── .github └── workflows │ ├── build-test.yml │ └── lint.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── broker.go ├── broker └── kafka │ ├── kafka.go │ └── kafka_test.go ├── broker_mock.go ├── dispatcher.go ├── dispatcher_test.go ├── doc └── graphics │ ├── code-coverage-badge.svg │ └── outbox.drawio ├── examples └── mySQL-Kafka │ ├── docker-compose.yml │ ├── main.go │ └── schema │ └── outbox.sql ├── go.mod ├── go.sum ├── internal ├── time │ ├── mock_time.go │ └── time.go └── uuid │ ├── mock_uuid.go │ └── uuid.go ├── publisher.go ├── publisher_test.go ├── record_cleaner.go ├── record_cleaner_mock.go ├── record_cleaner_test.go ├── record_processor.go ├── record_processor_mock.go ├── record_processor_test.go ├── record_unlocker.go ├── record_unlocker_mock.go ├── record_unlocker_test.go ├── store.go ├── store └── mysql │ └── mysql.go ├── store_mock.go └── vendor ├── filippo.io └── edwards25519 │ ├── LICENSE │ ├── README.md │ ├── doc.go │ ├── edwards25519.go │ ├── extra.go │ ├── field │ ├── fe.go │ ├── fe_amd64.go │ ├── fe_amd64.s │ ├── fe_amd64_noasm.go │ ├── fe_arm64.go │ ├── fe_arm64.s │ ├── fe_arm64_noasm.go │ ├── fe_extra.go │ └── fe_generic.go │ ├── scalar.go │ ├── scalar_fiat.go │ ├── scalarmult.go │ └── tables.go ├── github.com ├── IBM │ └── sarama │ │ ├── .gitignore │ │ ├── .golangci.yml │ │ ├── .pre-commit-config.yaml │ │ ├── CHANGELOG.md │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── Dockerfile.kafka │ │ ├── LICENSE.md │ │ ├── Makefile │ │ ├── README.md │ │ ├── SECURITY.md │ │ ├── Vagrantfile │ │ ├── acl_bindings.go │ │ ├── acl_create_request.go │ │ ├── acl_create_response.go │ │ ├── acl_delete_request.go │ │ ├── acl_delete_response.go │ │ ├── acl_describe_request.go │ │ ├── acl_describe_response.go │ │ ├── acl_filter.go │ │ ├── acl_types.go │ │ ├── add_offsets_to_txn_request.go │ │ ├── add_offsets_to_txn_response.go │ │ ├── add_partitions_to_txn_request.go │ │ ├── add_partitions_to_txn_response.go │ │ ├── admin.go │ │ ├── alter_client_quotas_request.go │ │ ├── alter_client_quotas_response.go │ │ ├── alter_configs_request.go │ │ ├── alter_configs_response.go │ │ ├── alter_partition_reassignments_request.go │ │ ├── alter_partition_reassignments_response.go │ │ ├── alter_user_scram_credentials_request.go │ │ ├── alter_user_scram_credentials_response.go │ │ ├── api_versions_request.go │ │ ├── api_versions_response.go │ │ ├── async_producer.go │ │ ├── balance_strategy.go │ │ ├── broker.go │ │ ├── client.go │ │ ├── compress.go │ │ ├── config.go │ │ ├── config_resource_type.go │ │ ├── consumer.go │ │ ├── consumer_group.go │ │ ├── consumer_group_members.go │ │ ├── consumer_metadata_request.go │ │ ├── consumer_metadata_response.go │ │ ├── control_record.go │ │ ├── crc32_field.go │ │ ├── create_partitions_request.go │ │ ├── create_partitions_response.go │ │ ├── create_topics_request.go │ │ ├── create_topics_response.go │ │ ├── decompress.go │ │ ├── delete_groups_request.go │ │ ├── delete_groups_response.go │ │ ├── delete_offsets_request.go │ │ ├── delete_offsets_response.go │ │ ├── delete_records_request.go │ │ ├── delete_records_response.go │ │ ├── delete_topics_request.go │ │ ├── delete_topics_response.go │ │ ├── describe_client_quotas_request.go │ │ ├── describe_client_quotas_response.go │ │ ├── describe_configs_request.go │ │ ├── describe_configs_response.go │ │ ├── describe_groups_request.go │ │ ├── describe_groups_response.go │ │ ├── describe_log_dirs_request.go │ │ ├── describe_log_dirs_response.go │ │ ├── describe_user_scram_credentials_request.go │ │ ├── describe_user_scram_credentials_response.go │ │ ├── dev.yml │ │ ├── docker-compose.yml │ │ ├── elect_leaders_request.go │ │ ├── elect_leaders_response.go │ │ ├── election_type.go │ │ ├── encoder_decoder.go │ │ ├── end_txn_request.go │ │ ├── end_txn_response.go │ │ ├── entrypoint.sh │ │ ├── errors.go │ │ ├── fetch_request.go │ │ ├── fetch_response.go │ │ ├── find_coordinator_request.go │ │ ├── find_coordinator_response.go │ │ ├── gssapi_kerberos.go │ │ ├── heartbeat_request.go │ │ ├── heartbeat_response.go │ │ ├── incremental_alter_configs_request.go │ │ ├── incremental_alter_configs_response.go │ │ ├── init_producer_id_request.go │ │ ├── init_producer_id_response.go │ │ ├── interceptors.go │ │ ├── join_group_request.go │ │ ├── join_group_response.go │ │ ├── kerberos_client.go │ │ ├── leave_group_request.go │ │ ├── leave_group_response.go │ │ ├── length_field.go │ │ ├── list_groups_request.go │ │ ├── list_groups_response.go │ │ ├── list_partition_reassignments_request.go │ │ ├── list_partition_reassignments_response.go │ │ ├── message.go │ │ ├── message_set.go │ │ ├── metadata_request.go │ │ ├── metadata_response.go │ │ ├── metrics.go │ │ ├── mockbroker.go │ │ ├── mockkerberos.go │ │ ├── mockresponses.go │ │ ├── offset_commit_request.go │ │ ├── offset_commit_response.go │ │ ├── offset_fetch_request.go │ │ ├── offset_fetch_response.go │ │ ├── offset_manager.go │ │ ├── offset_request.go │ │ ├── offset_response.go │ │ ├── packet_decoder.go │ │ ├── packet_encoder.go │ │ ├── partitioner.go │ │ ├── prep_encoder.go │ │ ├── produce_request.go │ │ ├── produce_response.go │ │ ├── produce_set.go │ │ ├── quota_types.go │ │ ├── real_decoder.go │ │ ├── real_encoder.go │ │ ├── record.go │ │ ├── record_batch.go │ │ ├── records.go │ │ ├── request.go │ │ ├── response_header.go │ │ ├── sarama.go │ │ ├── sasl_authenticate_request.go │ │ ├── sasl_authenticate_response.go │ │ ├── sasl_handshake_request.go │ │ ├── sasl_handshake_response.go │ │ ├── scram_formatter.go │ │ ├── sticky_assignor_user_data.go │ │ ├── sync_group_request.go │ │ ├── sync_group_response.go │ │ ├── sync_producer.go │ │ ├── timestamp.go │ │ ├── transaction_manager.go │ │ ├── txn_offset_commit_request.go │ │ ├── txn_offset_commit_response.go │ │ ├── utils.go │ │ ├── version.go │ │ └── zstd.go ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── eapache │ ├── go-resiliency │ │ ├── LICENSE │ │ └── breaker │ │ │ ├── README.md │ │ │ └── breaker.go │ ├── go-xerial-snappy │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── snappy.go │ └── queue │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── queue.go ├── go-sql-driver │ └── mysql │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── atomic_bool.go │ │ ├── atomic_bool_go118.go │ │ ├── auth.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── conncheck.go │ │ ├── conncheck_dummy.go │ │ ├── connection.go │ │ ├── connector.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── dsn.go │ │ ├── errors.go │ │ ├── fields.go │ │ ├── infile.go │ │ ├── nulltime.go │ │ ├── packets.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── transaction.go │ │ └── utils.go ├── golang │ └── snappy │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README │ │ ├── decode.go │ │ ├── decode_amd64.s │ │ ├── decode_arm64.s │ │ ├── decode_asm.go │ │ ├── decode_other.go │ │ ├── encode.go │ │ ├── encode_amd64.s │ │ ├── encode_arm64.s │ │ ├── encode_asm.go │ │ ├── encode_other.go │ │ └── snappy.go ├── google │ └── uuid │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── dce.go │ │ ├── doc.go │ │ ├── hash.go │ │ ├── marshal.go │ │ ├── node.go │ │ ├── node_js.go │ │ ├── node_net.go │ │ ├── null.go │ │ ├── sql.go │ │ ├── time.go │ │ ├── util.go │ │ ├── uuid.go │ │ ├── version1.go │ │ ├── version4.go │ │ ├── version6.go │ │ └── version7.go ├── hashicorp │ ├── errwrap │ │ ├── LICENSE │ │ ├── README.md │ │ └── errwrap.go │ ├── go-multierror │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── append.go │ │ ├── flatten.go │ │ ├── format.go │ │ ├── group.go │ │ ├── multierror.go │ │ ├── prefix.go │ │ └── sort.go │ └── go-uuid │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ └── uuid.go ├── jcmturner │ ├── aescts │ │ └── v2 │ │ │ ├── LICENSE │ │ │ └── aescts.go │ ├── dnsutils │ │ └── v2 │ │ │ ├── LICENSE │ │ │ └── srv.go │ ├── gofork │ │ ├── LICENSE │ │ ├── encoding │ │ │ └── asn1 │ │ │ │ ├── README.md │ │ │ │ ├── asn1.go │ │ │ │ ├── common.go │ │ │ │ └── marshal.go │ │ └── x │ │ │ └── crypto │ │ │ └── pbkdf2 │ │ │ └── pbkdf2.go │ ├── gokrb5 │ │ └── v8 │ │ │ ├── LICENSE │ │ │ ├── asn1tools │ │ │ └── tools.go │ │ │ ├── client │ │ │ ├── ASExchange.go │ │ │ ├── TGSExchange.go │ │ │ ├── cache.go │ │ │ ├── client.go │ │ │ ├── network.go │ │ │ ├── passwd.go │ │ │ ├── session.go │ │ │ └── settings.go │ │ │ ├── config │ │ │ ├── error.go │ │ │ ├── hosts.go │ │ │ └── krb5conf.go │ │ │ ├── credentials │ │ │ ├── ccache.go │ │ │ └── credentials.go │ │ │ ├── crypto │ │ │ ├── aes128-cts-hmac-sha1-96.go │ │ │ ├── aes128-cts-hmac-sha256-128.go │ │ │ ├── aes256-cts-hmac-sha1-96.go │ │ │ ├── aes256-cts-hmac-sha384-192.go │ │ │ ├── common │ │ │ │ └── common.go │ │ │ ├── crypto.go │ │ │ ├── des3-cbc-sha1-kd.go │ │ │ ├── etype │ │ │ │ └── etype.go │ │ │ ├── rc4-hmac.go │ │ │ ├── rfc3961 │ │ │ │ ├── encryption.go │ │ │ │ ├── keyDerivation.go │ │ │ │ └── nfold.go │ │ │ ├── rfc3962 │ │ │ │ ├── encryption.go │ │ │ │ └── keyDerivation.go │ │ │ ├── rfc4757 │ │ │ │ ├── checksum.go │ │ │ │ ├── encryption.go │ │ │ │ ├── keyDerivation.go │ │ │ │ └── msgtype.go │ │ │ └── rfc8009 │ │ │ │ ├── encryption.go │ │ │ │ └── keyDerivation.go │ │ │ ├── gssapi │ │ │ ├── MICToken.go │ │ │ ├── README.md │ │ │ ├── contextFlags.go │ │ │ ├── gssapi.go │ │ │ └── wrapToken.go │ │ │ ├── iana │ │ │ ├── addrtype │ │ │ │ └── constants.go │ │ │ ├── adtype │ │ │ │ └── constants.go │ │ │ ├── asnAppTag │ │ │ │ └── constants.go │ │ │ ├── chksumtype │ │ │ │ └── constants.go │ │ │ ├── constants.go │ │ │ ├── errorcode │ │ │ │ └── constants.go │ │ │ ├── etypeID │ │ │ │ └── constants.go │ │ │ ├── flags │ │ │ │ └── constants.go │ │ │ ├── keyusage │ │ │ │ └── constants.go │ │ │ ├── msgtype │ │ │ │ └── constants.go │ │ │ ├── nametype │ │ │ │ └── constants.go │ │ │ └── patype │ │ │ │ └── constants.go │ │ │ ├── kadmin │ │ │ ├── changepasswddata.go │ │ │ ├── message.go │ │ │ └── passwd.go │ │ │ ├── keytab │ │ │ └── keytab.go │ │ │ ├── krberror │ │ │ └── error.go │ │ │ ├── messages │ │ │ ├── APRep.go │ │ │ ├── APReq.go │ │ │ ├── KDCRep.go │ │ │ ├── KDCReq.go │ │ │ ├── KRBCred.go │ │ │ ├── KRBError.go │ │ │ ├── KRBPriv.go │ │ │ ├── KRBSafe.go │ │ │ └── Ticket.go │ │ │ ├── pac │ │ │ ├── client_claims.go │ │ │ ├── client_info.go │ │ │ ├── credentials_info.go │ │ │ ├── device_claims.go │ │ │ ├── device_info.go │ │ │ ├── kerb_validation_info.go │ │ │ ├── pac_type.go │ │ │ ├── s4u_delegation_info.go │ │ │ ├── signature_data.go │ │ │ ├── supplemental_cred.go │ │ │ └── upn_dns_info.go │ │ │ └── types │ │ │ ├── Authenticator.go │ │ │ ├── AuthorizationData.go │ │ │ ├── Cryptosystem.go │ │ │ ├── HostAddress.go │ │ │ ├── KerberosFlags.go │ │ │ ├── PAData.go │ │ │ ├── PrincipalName.go │ │ │ └── TypedData.go │ └── rpc │ │ └── v2 │ │ ├── LICENSE │ │ ├── mstypes │ │ ├── claims.go │ │ ├── common.go │ │ ├── filetime.go │ │ ├── group_membership.go │ │ ├── kerb_sid_and_attributes.go │ │ ├── reader.go │ │ ├── rpc_unicode_string.go │ │ ├── sid.go │ │ └── user_session_key.go │ │ └── ndr │ │ ├── arrays.go │ │ ├── decoder.go │ │ ├── error.go │ │ ├── header.go │ │ ├── pipe.go │ │ ├── primitives.go │ │ ├── rawbytes.go │ │ ├── strings.go │ │ ├── tags.go │ │ └── union.go ├── klauspost │ └── compress │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .goreleaser.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── SECURITY.md │ │ ├── compressible.go │ │ ├── flate │ │ ├── deflate.go │ │ ├── dict_decoder.go │ │ ├── fast_encoder.go │ │ ├── huffman_bit_writer.go │ │ ├── huffman_code.go │ │ ├── huffman_sortByFreq.go │ │ ├── huffman_sortByLiteral.go │ │ ├── inflate.go │ │ ├── inflate_gen.go │ │ ├── level1.go │ │ ├── level2.go │ │ ├── level3.go │ │ ├── level4.go │ │ ├── level5.go │ │ ├── level6.go │ │ ├── matchlen_amd64.go │ │ ├── matchlen_amd64.s │ │ ├── matchlen_generic.go │ │ ├── regmask_amd64.go │ │ ├── regmask_other.go │ │ ├── stateless.go │ │ └── token.go │ │ ├── fse │ │ ├── README.md │ │ ├── bitreader.go │ │ ├── bitwriter.go │ │ ├── bytereader.go │ │ ├── compress.go │ │ ├── decompress.go │ │ └── fse.go │ │ ├── gen.sh │ │ ├── gzip │ │ ├── gunzip.go │ │ └── gzip.go │ │ ├── huff0 │ │ ├── .gitignore │ │ ├── README.md │ │ ├── bitreader.go │ │ ├── bitwriter.go │ │ ├── compress.go │ │ ├── decompress.go │ │ ├── decompress_amd64.go │ │ ├── decompress_amd64.s │ │ ├── decompress_generic.go │ │ └── huff0.go │ │ ├── internal │ │ ├── cpuinfo │ │ │ ├── cpuinfo.go │ │ │ ├── cpuinfo_amd64.go │ │ │ └── cpuinfo_amd64.s │ │ └── snapref │ │ │ ├── LICENSE │ │ │ ├── decode.go │ │ │ ├── decode_other.go │ │ │ ├── encode.go │ │ │ ├── encode_other.go │ │ │ └── snappy.go │ │ ├── s2sx.mod │ │ ├── s2sx.sum │ │ └── zstd │ │ ├── README.md │ │ ├── bitreader.go │ │ ├── bitwriter.go │ │ ├── blockdec.go │ │ ├── blockenc.go │ │ ├── blocktype_string.go │ │ ├── bytebuf.go │ │ ├── bytereader.go │ │ ├── decodeheader.go │ │ ├── decoder.go │ │ ├── decoder_options.go │ │ ├── dict.go │ │ ├── enc_base.go │ │ ├── enc_best.go │ │ ├── enc_better.go │ │ ├── enc_dfast.go │ │ ├── enc_fast.go │ │ ├── encoder.go │ │ ├── encoder_options.go │ │ ├── framedec.go │ │ ├── frameenc.go │ │ ├── fse_decoder.go │ │ ├── fse_decoder_amd64.go │ │ ├── fse_decoder_amd64.s │ │ ├── fse_decoder_generic.go │ │ ├── fse_encoder.go │ │ ├── fse_predefined.go │ │ ├── hash.go │ │ ├── history.go │ │ ├── internal │ │ └── xxhash │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── xxhash.go │ │ │ ├── xxhash_amd64.s │ │ │ ├── xxhash_arm64.s │ │ │ ├── xxhash_asm.go │ │ │ ├── xxhash_other.go │ │ │ └── xxhash_safe.go │ │ ├── matchlen_amd64.go │ │ ├── matchlen_amd64.s │ │ ├── matchlen_generic.go │ │ ├── seqdec.go │ │ ├── seqdec_amd64.go │ │ ├── seqdec_amd64.s │ │ ├── seqdec_generic.go │ │ ├── seqenc.go │ │ ├── snappy.go │ │ ├── zip.go │ │ └── zstd.go ├── pierrec │ └── lz4 │ │ └── v4 │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── compressing_reader.go │ │ ├── internal │ │ ├── lz4block │ │ │ ├── block.go │ │ │ ├── blocks.go │ │ │ ├── decode_amd64.s │ │ │ ├── decode_arm.s │ │ │ ├── decode_arm64.s │ │ │ ├── decode_asm.go │ │ │ └── decode_other.go │ │ ├── lz4errors │ │ │ └── errors.go │ │ ├── lz4stream │ │ │ ├── block.go │ │ │ ├── frame.go │ │ │ └── frame_gen.go │ │ └── xxh32 │ │ │ ├── xxh32zero.go │ │ │ ├── xxh32zero_arm.go │ │ │ ├── xxh32zero_arm.s │ │ │ └── xxh32zero_other.go │ │ ├── lz4.go │ │ ├── options.go │ │ ├── options_gen.go │ │ ├── reader.go │ │ ├── state.go │ │ ├── state_gen.go │ │ └── writer.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── rcrowley │ └── go-metrics │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── counter.go │ │ ├── debug.go │ │ ├── ewma.go │ │ ├── gauge.go │ │ ├── gauge_float64.go │ │ ├── graphite.go │ │ ├── healthcheck.go │ │ ├── histogram.go │ │ ├── json.go │ │ ├── log.go │ │ ├── memory.md │ │ ├── meter.go │ │ ├── metrics.go │ │ ├── opentsdb.go │ │ ├── registry.go │ │ ├── runtime.go │ │ ├── runtime_cgo.go │ │ ├── runtime_gccpufraction.go │ │ ├── runtime_no_cgo.go │ │ ├── runtime_no_gccpufraction.go │ │ ├── sample.go │ │ ├── syslog.go │ │ ├── timer.go │ │ ├── validate.sh │ │ └── writer.go └── stretchr │ ├── objx │ ├── .codeclimate.yml │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── Taskfile.yml │ ├── accessors.go │ ├── conversions.go │ ├── doc.go │ ├── map.go │ ├── mutations.go │ ├── security.go │ ├── tests.go │ ├── type_specific.go │ ├── type_specific_codegen.go │ └── value.go │ └── testify │ ├── LICENSE │ ├── assert │ ├── assertion_compare.go │ ├── assertion_format.go │ ├── assertion_format.go.tmpl │ ├── assertion_forward.go │ ├── assertion_forward.go.tmpl │ ├── assertion_order.go │ ├── assertions.go │ ├── doc.go │ ├── errors.go │ ├── forward_assertions.go │ ├── http_assertions.go │ └── yaml │ │ ├── yaml_custom.go │ │ ├── yaml_default.go │ │ └── yaml_fail.go │ └── mock │ ├── doc.go │ └── mock.go ├── golang.org └── x │ ├── crypto │ ├── LICENSE │ ├── PATENTS │ ├── md4 │ │ ├── md4.go │ │ └── md4block.go │ └── pbkdf2 │ │ └── pbkdf2.go │ └── net │ ├── LICENSE │ ├── PATENTS │ ├── http2 │ └── hpack │ │ ├── encode.go │ │ ├── hpack.go │ │ ├── huffman.go │ │ ├── static_table.go │ │ └── tables.go │ ├── internal │ └── socks │ │ ├── client.go │ │ └── socks.go │ └── proxy │ ├── dial.go │ ├── direct.go │ ├── per_host.go │ ├── proxy.go │ └── socks5.go ├── gopkg.in └── yaml.v3 │ ├── LICENSE │ ├── NOTICE │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── modules.txt /.github/workflows/build-test.yml: -------------------------------------------------------------------------------- 1 | name: Go Build & Test 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | 9 | jobs: 10 | 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | 16 | - name: Set up Go 17 | uses: actions/setup-go@v2 18 | with: 19 | go-version: 1.22 20 | 21 | - name: Build 22 | run: go build -v ./... 23 | 24 | - name: Test 25 | run: go test -v -race -coverprofile=coverage.out -covermode=atomic $(go list ./... | grep -v /examples/) 26 | 27 | - name: Codecov 28 | uses: codecov/codecov-action@v3.1.0 29 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: golangci-lint 2 | on: 3 | push: 4 | tags: 5 | - v* 6 | branches: [ main ] 7 | pull_request: 8 | branches: [ main ] 9 | jobs: 10 | golangci: 11 | name: lint 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: golangci-lint 16 | uses: golangci/golangci-lint-action@v2 17 | with: 18 | # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version 19 | version: latest 20 | 21 | # Optional: working directory, useful for monorepos 22 | # working-directory: somedir 23 | 24 | # Optional: golangci-lint command line arguments. 25 | args: --disable-all -E revive --exclude-use-default=false --modules-download-mode=vendor 26 | 27 | # Optional: show only new issues if it's a pull request. The default value is `false`. 28 | # only-new-issues: true 29 | 30 | # Optional: if set to true then the action will use pre-installed Go. 31 | # skip-go-installation: true 32 | 33 | # Optional: if set to true then the action don't cache or restore ~/go/pkg. 34 | # skip-pkg-cache: true 35 | 36 | # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. 37 | # skip-build-cache: true 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | *.DS_Store 8 | debug/ 9 | .env 10 | main 11 | go-outbox 12 | 13 | # JetBrains 14 | .idea/* 15 | *.iws 16 | out/ 17 | .idea_modules/ 18 | 19 | 20 | # Test binary, built with `go test -c` 21 | *.test 22 | 23 | # Output of the go coverage tool, specifically when used with LiteIDE 24 | *.out 25 | 26 | # Dependency directories (remove the comment below to include it) 27 | # vendor/ 28 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL := help 2 | 3 | # `make help` generates a help message for each target that 4 | # has a comment starting with ## 5 | help: 6 | @echo "Please use 'make ' where is one of the following:" 7 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 8 | 9 | lint: ## Perform linting 10 | golangci-lint run --disable-all -E revive --exclude-use-default=false --modules-download-mode=vendor 11 | 12 | test: ## Run unit tests 13 | go test -mod=vendor `go list ./... | grep -v 'doc'` -race -cover 14 | 15 | test-int: ## Run all tests 16 | go test -mod=vendor `go list ./... | grep -v 'doc'` -race -tags=integration 17 | 18 | build: ## Build the app executable for Linux 19 | CGO_ENABLED=0 GOOS=linux GO111MODULE=on go build -mod=vendor -a ./... 20 | 21 | fmt: ## Format the source code 22 | go fmt ./... 23 | 24 | 25 | -------------------------------------------------------------------------------- /broker.go: -------------------------------------------------------------------------------- 1 | // Package outbox provides an interface for message brokers to send Message objects 2 | package outbox 3 | 4 | // MessageBroker provides an interface for message brokers to send Message objects 5 | type MessageBroker interface { 6 | Send(message Message) error 7 | } 8 | -------------------------------------------------------------------------------- /broker/kafka/kafka.go: -------------------------------------------------------------------------------- 1 | // Package kafka provides a Kafka message broker implementation 2 | package kafka 3 | 4 | import ( 5 | "github.com/IBM/sarama" 6 | 7 | "github.com/pkritiotis/outbox" 8 | ) 9 | 10 | // Broker implements the MessageBroker interface 11 | type Broker struct { 12 | producer sarama.SyncProducer 13 | } 14 | 15 | // NewBroker constructor 16 | func NewBroker(brokers []string, config *sarama.Config) (*Broker, error) { 17 | config.Producer.Return.Successes = true 18 | producer, err := sarama.NewSyncProducer(brokers, config) 19 | if err != nil { 20 | return nil, err 21 | } 22 | return &Broker{producer: producer}, nil 23 | } 24 | 25 | // Send delivers the message to kafka 26 | func (b Broker) Send(event outbox.Message) error { 27 | var headers []sarama.RecordHeader 28 | 29 | for k, v := range event.Headers { 30 | headers = append(headers, sarama.RecordHeader{ 31 | Key: sarama.ByteEncoder(k), 32 | Value: sarama.ByteEncoder(v), 33 | }) 34 | } 35 | 36 | msg := &sarama.ProducerMessage{ 37 | Topic: event.Topic, 38 | Key: sarama.StringEncoder(event.Key), 39 | Value: sarama.StringEncoder(event.Body), 40 | } 41 | _, _, err := b.producer.SendMessage(msg) 42 | 43 | return err 44 | } 45 | -------------------------------------------------------------------------------- /broker_mock.go: -------------------------------------------------------------------------------- 1 | package outbox 2 | 3 | import "github.com/stretchr/testify/mock" 4 | 5 | // MockBroker mocks the Broker interface 6 | type MockBroker struct { 7 | mock.Mock 8 | } 9 | 10 | // Send method mock 11 | func (m *MockBroker) Send(message Message) error { 12 | args := m.Called(message) 13 | return args.Error(0) 14 | } 15 | -------------------------------------------------------------------------------- /doc/graphics/code-coverage-badge.svg: -------------------------------------------------------------------------------- 1 | coverage: 97.1%coverage97.1% -------------------------------------------------------------------------------- /examples/mySQL-Kafka/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | mysql: 4 | image: mysql:5.6 5 | restart: always 6 | ports: 7 | - 3306:3306 8 | environment: 9 | MYSQL_ROOT_PASSWORD: "a123456" 10 | MYSQL_PASSWORD: "a123456" 11 | MYSQL_DATABASE: "outbox" 12 | TIMEZONE: "UTC" 13 | volumes: 14 | - ./schema:/docker-entrypoint-initdb.d 15 | 16 | zookeeper: 17 | image: confluentinc/cp-zookeeper:latest 18 | environment: 19 | ZOOKEEPER_CLIENT_PORT: 2181 20 | ZOOKEEPER_TICK_TIME: 2000 21 | ports: 22 | - 22181:2181 23 | 24 | kafka: 25 | image: confluentinc/cp-kafka:latest 26 | depends_on: 27 | - zookeeper 28 | ports: 29 | - 29092:29092 30 | environment: 31 | KAFKA_BROKER_ID: 1 32 | KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 33 | KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092 34 | KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT 35 | KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT 36 | KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 -------------------------------------------------------------------------------- /examples/mySQL-Kafka/schema/outbox.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE outbox ( 2 | id varchar(100) NOT NULL, 3 | data BLOB NOT NULL, 4 | state INT NOT NULL, 5 | created_on DATETIME NOT NULL, 6 | locked_by varchar(100) NULL, 7 | locked_on DATETIME NULL, 8 | processed_on DATETIME NULL, 9 | number_of_attempts INT NOT NULL, 10 | last_attempted_on DATETIME NULL, 11 | error varchar(1000) NULL 12 | ) -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/pkritiotis/outbox 2 | 3 | go 1.22 4 | 5 | require ( 6 | github.com/IBM/sarama v1.44.0 7 | github.com/go-sql-driver/mysql v1.8.1 8 | github.com/google/uuid v1.6.0 9 | github.com/stretchr/testify v1.10.0 10 | ) 11 | 12 | require ( 13 | filippo.io/edwards25519 v1.1.0 // indirect 14 | github.com/davecgh/go-spew v1.1.1 // indirect 15 | github.com/eapache/go-resiliency v1.7.0 // indirect 16 | github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect 17 | github.com/eapache/queue v1.1.0 // indirect 18 | github.com/golang/snappy v0.0.4 // indirect 19 | github.com/hashicorp/errwrap v1.1.0 // indirect 20 | github.com/hashicorp/go-multierror v1.1.1 // indirect 21 | github.com/hashicorp/go-uuid v1.0.3 // indirect 22 | github.com/jcmturner/aescts/v2 v2.0.0 // indirect 23 | github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect 24 | github.com/jcmturner/gofork v1.7.6 // indirect 25 | github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect 26 | github.com/jcmturner/rpc/v2 v2.0.3 // indirect 27 | github.com/klauspost/compress v1.17.11 // indirect 28 | github.com/kr/text v0.2.0 // indirect 29 | github.com/pierrec/lz4/v4 v4.1.22 // indirect 30 | github.com/pmezard/go-difflib v1.0.0 // indirect 31 | github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect 32 | github.com/rogpeppe/go-internal v1.6.1 // indirect 33 | github.com/stretchr/objx v0.5.2 // indirect 34 | golang.org/x/crypto v0.31.0 // indirect 35 | golang.org/x/net v0.33.0 // indirect 36 | gopkg.in/yaml.v3 v3.0.1 // indirect 37 | ) 38 | -------------------------------------------------------------------------------- /internal/time/mock_time.go: -------------------------------------------------------------------------------- 1 | // Package time provides a time mock provider 2 | package time 3 | 4 | import ( 5 | "time" 6 | 7 | "github.com/stretchr/testify/mock" 8 | ) 9 | 10 | // MockProvider mocks Provider 11 | type MockProvider struct { 12 | mock.Mock 13 | } 14 | 15 | // Now returns the mocked time 16 | func (m *MockProvider) Now() time.Time { 17 | args := m.Called() 18 | return args.Get(0).(time.Time) 19 | } 20 | -------------------------------------------------------------------------------- /internal/time/time.go: -------------------------------------------------------------------------------- 1 | package time 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | // Provider provides an interface for abstracting time 8 | type Provider interface { 9 | Now() time.Time 10 | } 11 | 12 | type timeProvider struct{} 13 | 14 | // NewTimeProvider Provider constructor that returns the default time provider 15 | func NewTimeProvider() Provider { 16 | return timeProvider{} 17 | } 18 | 19 | // Now returns the current time 20 | func (t timeProvider) Now() time.Time { 21 | return time.Now() 22 | } 23 | -------------------------------------------------------------------------------- /internal/uuid/mock_uuid.go: -------------------------------------------------------------------------------- 1 | // Package uuid provides a UUID mock provider 2 | package uuid 3 | 4 | import ( 5 | "github.com/google/uuid" 6 | "github.com/stretchr/testify/mock" 7 | ) 8 | 9 | // MockProvider mocks UUID provider 10 | type MockProvider struct { 11 | mock.Mock 12 | } 13 | 14 | // NewUUID returns the mocked UUID 15 | func (m *MockProvider) NewUUID() uuid.UUID { 16 | args := m.Called() 17 | return args.Get(0).(uuid.UUID) 18 | } 19 | -------------------------------------------------------------------------------- /internal/uuid/uuid.go: -------------------------------------------------------------------------------- 1 | package uuid 2 | 3 | import "github.com/google/uuid" 4 | 5 | // Provider abstracts the UUID generation 6 | type Provider interface { 7 | NewUUID() uuid.UUID 8 | } 9 | 10 | // NewUUIDProvider constructor that returns default UUID generation 11 | func NewUUIDProvider() Provider { 12 | return uuidProvider{} 13 | } 14 | 15 | type uuidProvider struct{} 16 | 17 | // NewUUID generates a new UUID 18 | func (u uuidProvider) NewUUID() uuid.UUID { 19 | return uuid.New() 20 | } 21 | -------------------------------------------------------------------------------- /publisher.go: -------------------------------------------------------------------------------- 1 | package outbox 2 | 3 | import ( 4 | "database/sql" 5 | 6 | "github.com/pkritiotis/outbox/internal/time" 7 | "github.com/pkritiotis/outbox/internal/uuid" 8 | ) 9 | 10 | // Publisher encapsulates the save functionality of the outbox pattern 11 | type Publisher struct { 12 | store Store 13 | time time.Provider 14 | uuid uuid.Provider 15 | } 16 | 17 | // NewPublisher is the Publisher constructor 18 | func NewPublisher(store Store) Publisher { 19 | return Publisher{store: store, time: time.NewTimeProvider(), uuid: uuid.NewUUIDProvider()} 20 | } 21 | 22 | // Message encapsulates the contents of the message to be sent 23 | type Message struct { 24 | Key string 25 | Headers map[string]string 26 | Body []byte 27 | Topic string 28 | } 29 | 30 | // Send stores the provided Message within the provided sql.Tx 31 | func (o Publisher) Send(msg Message, tx *sql.Tx) error { 32 | newID := o.uuid.NewUUID() 33 | record := Record{ 34 | ID: newID, 35 | Message: msg, 36 | State: PendingDelivery, 37 | CreatedOn: o.time.Now().UTC(), 38 | LockID: nil, 39 | LockedOn: nil, 40 | ProcessedOn: nil, 41 | } 42 | 43 | return o.store.AddRecordTx(record, tx) 44 | } 45 | -------------------------------------------------------------------------------- /record_cleaner.go: -------------------------------------------------------------------------------- 1 | package outbox 2 | 3 | import ( 4 | time2 "time" 5 | 6 | "github.com/pkritiotis/outbox/internal/time" 7 | ) 8 | 9 | type recordCleaner struct { 10 | store Store 11 | time time.Provider 12 | MaxRecordLifetime time2.Duration 13 | } 14 | 15 | func newRecordCleaner(store Store, maxRecordLifetime time2.Duration) recordCleaner { 16 | return recordCleaner{MaxRecordLifetime: maxRecordLifetime, store: store, time: time.NewTimeProvider()} 17 | } 18 | 19 | func (d recordCleaner) RemoveExpiredMessages() error { 20 | expiryTime := d.time.Now().UTC().Add(-d.MaxRecordLifetime) 21 | err := d.store.RemoveRecordsBeforeDatetime(expiryTime) 22 | if err != nil { 23 | return err 24 | } 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /record_cleaner_mock.go: -------------------------------------------------------------------------------- 1 | package outbox 2 | 3 | import ( 4 | "github.com/stretchr/testify/mock" 5 | ) 6 | 7 | type mockRecordCleaner struct { 8 | mock.Mock 9 | } 10 | 11 | func (m *mockRecordCleaner) RemoveExpiredMessages() error { 12 | args := m.Called() 13 | return args.Error(0) 14 | } 15 | -------------------------------------------------------------------------------- /record_processor_mock.go: -------------------------------------------------------------------------------- 1 | package outbox 2 | 3 | import ( 4 | "sync" 5 | 6 | "github.com/stretchr/testify/mock" 7 | ) 8 | 9 | type mockRecordProcessor struct { 10 | wg sync.WaitGroup 11 | mock.Mock 12 | } 13 | 14 | func (m mockRecordProcessor) ProcessRecords() error { 15 | args := m.Called() 16 | return args.Error(0) 17 | } 18 | -------------------------------------------------------------------------------- /record_unlocker.go: -------------------------------------------------------------------------------- 1 | package outbox 2 | 3 | import ( 4 | time2 "time" 5 | 6 | "github.com/pkritiotis/outbox/internal/time" 7 | ) 8 | 9 | type recordUnlocker struct { 10 | store Store 11 | time time.Provider 12 | MaxLockTimeDurationMins time2.Duration 13 | } 14 | 15 | func newRecordUnlocker(store Store, maxLockTimeDurationMins time2.Duration) recordUnlocker { 16 | return recordUnlocker{MaxLockTimeDurationMins: maxLockTimeDurationMins, store: store, time: time.NewTimeProvider()} 17 | } 18 | 19 | func (d recordUnlocker) UnlockExpiredMessages() error { 20 | expiryTime := d.time.Now().UTC().Add(-d.MaxLockTimeDurationMins) 21 | clearErr := d.store.ClearLocksWithDurationBeforeDate(expiryTime) 22 | if clearErr != nil { 23 | return clearErr 24 | } 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /record_unlocker_mock.go: -------------------------------------------------------------------------------- 1 | package outbox 2 | 3 | import ( 4 | "github.com/stretchr/testify/mock" 5 | ) 6 | 7 | type mockRecordUnlocker struct { 8 | mock.Mock 9 | } 10 | 11 | func (m *mockRecordUnlocker) UnlockExpiredMessages() error { 12 | args := m.Called() 13 | return args.Error(0) 14 | } 15 | -------------------------------------------------------------------------------- /store_mock.go: -------------------------------------------------------------------------------- 1 | package outbox 2 | 3 | import ( 4 | "database/sql" 5 | "time" 6 | 7 | "github.com/stretchr/testify/mock" 8 | ) 9 | 10 | // MockStore mocks the Store 11 | type MockStore struct { 12 | mock.Mock 13 | } 14 | 15 | // AddRecordTx method mock 16 | func (m *MockStore) AddRecordTx(record Record, tx *sql.Tx) error { 17 | args := m.Called(record, tx) 18 | return args.Error(0) 19 | } 20 | 21 | // GetRecordsByLockID method mock 22 | func (m *MockStore) GetRecordsByLockID(lockID string) ([]Record, error) { 23 | args := m.Called(lockID) 24 | return args.Get(0).([]Record), args.Error(1) 25 | } 26 | 27 | // UpdateRecordLockByState method mock 28 | func (m *MockStore) UpdateRecordLockByState(lockID string, lockedOn time.Time, state RecordState) error { 29 | args := m.Called(lockID, lockedOn, state) 30 | return args.Error(0) 31 | } 32 | 33 | // UpdateRecordByID method mock 34 | func (m *MockStore) UpdateRecordByID(message Record) error { 35 | args := m.Called(message) 36 | return args.Error(0) 37 | } 38 | 39 | // ClearLocksWithDurationBeforeDate method mock 40 | func (m *MockStore) ClearLocksWithDurationBeforeDate(time time.Time) error { 41 | args := m.Called(time) 42 | return args.Error(0) 43 | } 44 | 45 | // ClearLocksByLockID method mock 46 | func (m *MockStore) ClearLocksByLockID(lockID string) error { 47 | args := m.Called(lockID) 48 | return args.Error(0) 49 | } 50 | 51 | // RemoveRecordsBeforeDatetime method mock 52 | func (m *MockStore) RemoveRecordsBeforeDatetime(expiryTime time.Time) error { 53 | args := m.Called(expiryTime) 54 | return args.Error(0) 55 | } 56 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/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 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/README.md: -------------------------------------------------------------------------------- 1 | # filippo.io/edwards25519 2 | 3 | ``` 4 | import "filippo.io/edwards25519" 5 | ``` 6 | 7 | This library implements the edwards25519 elliptic curve, exposing the necessary APIs to build a wide array of higher-level primitives. 8 | Read the docs at [pkg.go.dev/filippo.io/edwards25519](https://pkg.go.dev/filippo.io/edwards25519). 9 | 10 | The code is originally derived from Adam Langley's internal implementation in the Go standard library, and includes George Tankersley's [performance improvements](https://golang.org/cl/71950). It was then further developed by Henry de Valence for use in ristretto255, and was finally [merged back into the Go standard library](https://golang.org/cl/276272) as of Go 1.17. It now tracks the upstream codebase and extends it with additional functionality. 11 | 12 | Most users don't need this package, and should instead use `crypto/ed25519` for signatures, `golang.org/x/crypto/curve25519` for Diffie-Hellman, or `github.com/gtank/ristretto255` for prime order group logic. However, for anyone currently using a fork of `crypto/internal/edwards25519`/`crypto/ed25519/internal/edwards25519` or `github.com/agl/edwards25519`, this package should be a safer, faster, and more powerful alternative. 13 | 14 | Since this package is meant to curb proliferation of edwards25519 implementations in the Go ecosystem, it welcomes requests for new APIs or reviewable performance improvements. 15 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 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 edwards25519 implements group logic for the twisted Edwards curve 6 | // 7 | // -x^2 + y^2 = 1 + -(121665/121666)*x^2*y^2 8 | // 9 | // This is better known as the Edwards curve equivalent to Curve25519, and is 10 | // the curve used by the Ed25519 signature scheme. 11 | // 12 | // Most users don't need this package, and should instead use crypto/ed25519 for 13 | // signatures, golang.org/x/crypto/curve25519 for Diffie-Hellman, or 14 | // github.com/gtank/ristretto255 for prime order group logic. 15 | // 16 | // However, developers who do need to interact with low-level edwards25519 17 | // operations can use this package, which is an extended version of 18 | // crypto/internal/edwards25519 from the standard library repackaged as 19 | // an importable module. 20 | package edwards25519 21 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_amd64.go: -------------------------------------------------------------------------------- 1 | // Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. 2 | 3 | //go:build amd64 && gc && !purego 4 | // +build amd64,gc,!purego 5 | 6 | package field 7 | 8 | // feMul sets out = a * b. It works like feMulGeneric. 9 | // 10 | //go:noescape 11 | func feMul(out *Element, a *Element, b *Element) 12 | 13 | // feSquare sets out = a * a. It works like feSquareGeneric. 14 | // 15 | //go:noescape 16 | func feSquare(out *Element, a *Element) 17 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_amd64_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 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 | //go:build !amd64 || !gc || purego 6 | // +build !amd64 !gc purego 7 | 8 | package field 9 | 10 | func feMul(v, x, y *Element) { feMulGeneric(v, x, y) } 11 | 12 | func feSquare(v, x *Element) { feSquareGeneric(v, x) } 13 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 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:build arm64 && gc && !purego 6 | // +build arm64,gc,!purego 7 | 8 | package field 9 | 10 | //go:noescape 11 | func carryPropagate(v *Element) 12 | 13 | func (v *Element) carryPropagate() *Element { 14 | carryPropagate(v) 15 | return v 16 | } 17 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 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:build arm64 && gc && !purego 6 | 7 | #include "textflag.h" 8 | 9 | // carryPropagate works exactly like carryPropagateGeneric and uses the 10 | // same AND, ADD, and LSR+MADD instructions emitted by the compiler, but 11 | // avoids loading R0-R4 twice and uses LDP and STP. 12 | // 13 | // See https://golang.org/issues/43145 for the main compiler issue. 14 | // 15 | // func carryPropagate(v *Element) 16 | TEXT ·carryPropagate(SB),NOFRAME|NOSPLIT,$0-8 17 | MOVD v+0(FP), R20 18 | 19 | LDP 0(R20), (R0, R1) 20 | LDP 16(R20), (R2, R3) 21 | MOVD 32(R20), R4 22 | 23 | AND $0x7ffffffffffff, R0, R10 24 | AND $0x7ffffffffffff, R1, R11 25 | AND $0x7ffffffffffff, R2, R12 26 | AND $0x7ffffffffffff, R3, R13 27 | AND $0x7ffffffffffff, R4, R14 28 | 29 | ADD R0>>51, R11, R11 30 | ADD R1>>51, R12, R12 31 | ADD R2>>51, R13, R13 32 | ADD R3>>51, R14, R14 33 | // R4>>51 * 19 + R10 -> R10 34 | LSR $51, R4, R21 35 | MOVD $19, R22 36 | MADD R22, R10, R21, R10 37 | 38 | STP (R10, R11), 0(R20) 39 | STP (R12, R13), 16(R20) 40 | MOVD R14, 32(R20) 41 | 42 | RET 43 | -------------------------------------------------------------------------------- /vendor/filippo.io/edwards25519/field/fe_arm64_noasm.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 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:build !arm64 || !gc || purego 6 | // +build !arm64 !gc purego 7 | 8 | package field 9 | 10 | func (v *Element) carryPropagate() *Element { 11 | return v.carryPropagateGeneric() 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | *.test 6 | 7 | # Folders 8 | _obj 9 | _test 10 | .vagrant 11 | 12 | # Architecture specific extensions/prefixes 13 | *.[568vq] 14 | [568vq].out 15 | 16 | *.cgo1.go 17 | *.cgo2.c 18 | _cgo_defun.c 19 | _cgo_gotypes.go 20 | _cgo_export.* 21 | 22 | _testmain.go 23 | 24 | *.exe 25 | 26 | /bin 27 | /coverage.txt 28 | /profile.out 29 | /output.json 30 | 31 | .idea 32 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | fail_fast: false 2 | default_install_hook_types: [pre-commit, commit-msg] 3 | repos: 4 | - repo: https://github.com/pre-commit/pre-commit-hooks 5 | rev: v5.0.0 6 | hooks: 7 | - id: check-merge-conflict 8 | - id: check-yaml 9 | - id: end-of-file-fixer 10 | - id: fix-byte-order-marker 11 | - id: mixed-line-ending 12 | - id: trailing-whitespace 13 | - repo: local 14 | hooks: 15 | - id: conventional-commit-msg-validation 16 | name: commit message conventional validation 17 | language: pygrep 18 | entry: '^(?:fixup! )?(breaking|build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w `])+([\s\S]*)' 19 | args: [--multiline, --negate] 20 | stages: [commit-msg] 21 | - id: commit-msg-needs-to-be-signed-off 22 | name: commit message needs to be signed off 23 | language: pygrep 24 | entry: "^Signed-off-by:" 25 | args: [--multiline, --negate] 26 | stages: [commit-msg] 27 | - id: gofmt 28 | name: gofmt 29 | description: Format files with gofmt. 30 | entry: gofmt -l 31 | language: golang 32 | files: \.go$ 33 | args: [] 34 | - repo: https://github.com/gitleaks/gitleaks 35 | rev: v8.21.2 36 | hooks: 37 | - id: gitleaks 38 | - repo: https://github.com/golangci/golangci-lint 39 | rev: v1.61.0 40 | hooks: 41 | - id: golangci-lint 42 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2013 Shopify 4 | 5 | Copyright (c) 2023 IBM Corporation 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/Makefile: -------------------------------------------------------------------------------- 1 | default: fmt get update test lint 2 | 3 | GO := go 4 | GOBIN := $(shell pwd)/bin 5 | GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG) 6 | GOTEST := $(GO) test -v -race -coverprofile=profile.out -covermode=atomic 7 | 8 | FILES := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -not -name '*_test.go') 9 | TESTS := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -name '*_test.go') 10 | 11 | $(GOBIN)/tparse: 12 | GOBIN=$(GOBIN) go install github.com/mfridman/tparse@v0.11.1 13 | get: 14 | $(GO) get ./... 15 | $(GO) mod verify 16 | $(GO) mod tidy 17 | 18 | update: 19 | $(GO) get -u -v ./... 20 | $(GO) mod verify 21 | $(GO) mod tidy 22 | 23 | fmt: 24 | gofmt -s -l -w $(FILES) $(TESTS) 25 | 26 | lint: 27 | GOFLAGS="-tags=functional" golangci-lint run 28 | 29 | test: $(GOBIN)/tparse 30 | $(GOTEST) -timeout 2m -json ./... \ 31 | | tee output.json | $(GOBIN)/tparse -follow -all 32 | [ -z "$${GITHUB_STEP_SUMMARY}" ] \ 33 | || NO_COLOR=1 $(GOBIN)/tparse -format markdown -file output.json -all >"$${GITHUB_STEP_SUMMARY:-/dev/null}" 34 | .PHONY: test_functional 35 | test_functional: $(GOBIN)/tparse 36 | $(GOTEST) -timeout 15m -tags=functional -json ./... \ 37 | | tee output.json | $(GOBIN)/tparse -follow -all 38 | [ -z "$${GITHUB_STEP_SUMMARY:-}" ] \ 39 | || NO_COLOR=1 $(GOBIN)/tparse -format markdown -file output.json -all >"$${GITHUB_STEP_SUMMARY:-/dev/null}" 40 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | ## Reporting Security Issues 4 | 5 | **Please do not report security vulnerabilities through public GitHub issues.** 6 | 7 | The easiest way to report a security issue is privately through GitHub [here](https://github.com/IBM/sarama/security/advisories/new). 8 | 9 | See [Privately reporting a security vulnerability](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability) for full instructions. 10 | 11 | Alternatively, you can report them via e-mail or anonymous form to the IBM Product Security Incident Response Team (PSIRT) following the guidelines under the [IBM Security Vulnerability Management](https://www.ibm.com/support/pages/ibm-security-vulnerability-management) pages. 12 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/Vagrantfile: -------------------------------------------------------------------------------- 1 | # We have 5 * 192MB ZK processes and 5 * 320MB Kafka processes => 2560MB 2 | MEMORY = 3072 3 | 4 | Vagrant.configure("2") do |config| 5 | config.vm.box = "ubuntu/bionic64" 6 | 7 | config.vm.provision :shell, path: "vagrant/provision.sh" 8 | 9 | config.vm.network "private_network", ip: "192.168.100.67" 10 | 11 | config.vm.provider "virtualbox" do |v| 12 | v.memory = MEMORY 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/acl_delete_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | // DeleteAclsRequest is a delete acl request 4 | type DeleteAclsRequest struct { 5 | Version int 6 | Filters []*AclFilter 7 | } 8 | 9 | func (d *DeleteAclsRequest) encode(pe packetEncoder) error { 10 | if err := pe.putArrayLength(len(d.Filters)); err != nil { 11 | return err 12 | } 13 | 14 | for _, filter := range d.Filters { 15 | filter.Version = d.Version 16 | if err := filter.encode(pe); err != nil { 17 | return err 18 | } 19 | } 20 | 21 | return nil 22 | } 23 | 24 | func (d *DeleteAclsRequest) decode(pd packetDecoder, version int16) (err error) { 25 | d.Version = int(version) 26 | n, err := pd.getArrayLength() 27 | if err != nil { 28 | return err 29 | } 30 | 31 | d.Filters = make([]*AclFilter, n) 32 | for i := 0; i < n; i++ { 33 | d.Filters[i] = new(AclFilter) 34 | d.Filters[i].Version = int(version) 35 | if err := d.Filters[i].decode(pd, version); err != nil { 36 | return err 37 | } 38 | } 39 | 40 | return nil 41 | } 42 | 43 | func (d *DeleteAclsRequest) key() int16 { 44 | return 31 45 | } 46 | 47 | func (d *DeleteAclsRequest) version() int16 { 48 | return int16(d.Version) 49 | } 50 | 51 | func (d *DeleteAclsRequest) headerVersion() int16 { 52 | return 1 53 | } 54 | 55 | func (d *DeleteAclsRequest) isValidVersion() bool { 56 | return d.Version >= 0 && d.Version <= 1 57 | } 58 | 59 | func (d *DeleteAclsRequest) requiredVersion() KafkaVersion { 60 | switch d.Version { 61 | case 1: 62 | return V2_0_0_0 63 | default: 64 | return V0_11_0_0 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/acl_describe_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | // DescribeAclsRequest is a describe acl request type 4 | type DescribeAclsRequest struct { 5 | Version int 6 | AclFilter 7 | } 8 | 9 | func (d *DescribeAclsRequest) encode(pe packetEncoder) error { 10 | d.AclFilter.Version = d.Version 11 | return d.AclFilter.encode(pe) 12 | } 13 | 14 | func (d *DescribeAclsRequest) decode(pd packetDecoder, version int16) (err error) { 15 | d.Version = int(version) 16 | d.AclFilter.Version = int(version) 17 | return d.AclFilter.decode(pd, version) 18 | } 19 | 20 | func (d *DescribeAclsRequest) key() int16 { 21 | return 29 22 | } 23 | 24 | func (d *DescribeAclsRequest) version() int16 { 25 | return int16(d.Version) 26 | } 27 | 28 | func (d *DescribeAclsRequest) headerVersion() int16 { 29 | return 1 30 | } 31 | 32 | func (d *DescribeAclsRequest) isValidVersion() bool { 33 | return d.Version >= 0 && d.Version <= 1 34 | } 35 | 36 | func (d *DescribeAclsRequest) requiredVersion() KafkaVersion { 37 | switch d.Version { 38 | case 1: 39 | return V2_0_0_0 40 | default: 41 | return V0_11_0_0 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/add_offsets_to_txn_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | // AddOffsetsToTxnRequest adds offsets to a transaction request 4 | type AddOffsetsToTxnRequest struct { 5 | Version int16 6 | TransactionalID string 7 | ProducerID int64 8 | ProducerEpoch int16 9 | GroupID string 10 | } 11 | 12 | func (a *AddOffsetsToTxnRequest) encode(pe packetEncoder) error { 13 | if err := pe.putString(a.TransactionalID); err != nil { 14 | return err 15 | } 16 | 17 | pe.putInt64(a.ProducerID) 18 | 19 | pe.putInt16(a.ProducerEpoch) 20 | 21 | if err := pe.putString(a.GroupID); err != nil { 22 | return err 23 | } 24 | 25 | return nil 26 | } 27 | 28 | func (a *AddOffsetsToTxnRequest) decode(pd packetDecoder, version int16) (err error) { 29 | if a.TransactionalID, err = pd.getString(); err != nil { 30 | return err 31 | } 32 | if a.ProducerID, err = pd.getInt64(); err != nil { 33 | return err 34 | } 35 | if a.ProducerEpoch, err = pd.getInt16(); err != nil { 36 | return err 37 | } 38 | if a.GroupID, err = pd.getString(); err != nil { 39 | return err 40 | } 41 | return nil 42 | } 43 | 44 | func (a *AddOffsetsToTxnRequest) key() int16 { 45 | return 25 46 | } 47 | 48 | func (a *AddOffsetsToTxnRequest) version() int16 { 49 | return a.Version 50 | } 51 | 52 | func (a *AddOffsetsToTxnRequest) headerVersion() int16 { 53 | return 1 54 | } 55 | 56 | func (a *AddOffsetsToTxnRequest) isValidVersion() bool { 57 | return a.Version >= 0 && a.Version <= 2 58 | } 59 | 60 | func (a *AddOffsetsToTxnRequest) requiredVersion() KafkaVersion { 61 | switch a.Version { 62 | case 2: 63 | return V2_7_0_0 64 | case 1: 65 | return V2_0_0_0 66 | case 0: 67 | return V0_11_0_0 68 | default: 69 | return V2_7_0_0 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/add_offsets_to_txn_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | // AddOffsetsToTxnResponse is a response type for adding offsets to txns 8 | type AddOffsetsToTxnResponse struct { 9 | Version int16 10 | ThrottleTime time.Duration 11 | Err KError 12 | } 13 | 14 | func (a *AddOffsetsToTxnResponse) encode(pe packetEncoder) error { 15 | pe.putInt32(int32(a.ThrottleTime / time.Millisecond)) 16 | pe.putInt16(int16(a.Err)) 17 | return nil 18 | } 19 | 20 | func (a *AddOffsetsToTxnResponse) decode(pd packetDecoder, version int16) (err error) { 21 | throttleTime, err := pd.getInt32() 22 | if err != nil { 23 | return err 24 | } 25 | a.ThrottleTime = time.Duration(throttleTime) * time.Millisecond 26 | 27 | kerr, err := pd.getInt16() 28 | if err != nil { 29 | return err 30 | } 31 | a.Err = KError(kerr) 32 | 33 | return nil 34 | } 35 | 36 | func (a *AddOffsetsToTxnResponse) key() int16 { 37 | return 25 38 | } 39 | 40 | func (a *AddOffsetsToTxnResponse) version() int16 { 41 | return a.Version 42 | } 43 | 44 | func (a *AddOffsetsToTxnResponse) headerVersion() int16 { 45 | return 0 46 | } 47 | 48 | func (a *AddOffsetsToTxnResponse) isValidVersion() bool { 49 | return a.Version >= 0 && a.Version <= 2 50 | } 51 | 52 | func (a *AddOffsetsToTxnResponse) requiredVersion() KafkaVersion { 53 | switch a.Version { 54 | case 2: 55 | return V2_7_0_0 56 | case 1: 57 | return V2_0_0_0 58 | case 0: 59 | return V0_11_0_0 60 | default: 61 | return V2_7_0_0 62 | } 63 | } 64 | 65 | func (r *AddOffsetsToTxnResponse) throttleTime() time.Duration { 66 | return r.ThrottleTime 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/config_resource_type.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | // ConfigResourceType is a type for resources that have configs. 4 | type ConfigResourceType int8 5 | 6 | // Taken from: 7 | // https://github.com/apache/kafka/blob/ed7c071e07f1f90e4c2895582f61ca090ced3c42/clients/src/main/java/org/apache/kafka/common/config/ConfigResource.java#L32-L55 8 | 9 | const ( 10 | // UnknownResource constant type 11 | UnknownResource ConfigResourceType = 0 12 | // TopicResource constant type 13 | TopicResource ConfigResourceType = 2 14 | // BrokerResource constant type 15 | BrokerResource ConfigResourceType = 4 16 | // BrokerLoggerResource constant type 17 | BrokerLoggerResource ConfigResourceType = 8 18 | ) 19 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/consumer_metadata_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | // ConsumerMetadataRequest is used for metadata requests 4 | type ConsumerMetadataRequest struct { 5 | Version int16 6 | ConsumerGroup string 7 | } 8 | 9 | func (r *ConsumerMetadataRequest) encode(pe packetEncoder) error { 10 | tmp := new(FindCoordinatorRequest) 11 | tmp.CoordinatorKey = r.ConsumerGroup 12 | tmp.CoordinatorType = CoordinatorGroup 13 | tmp.Version = r.Version 14 | return tmp.encode(pe) 15 | } 16 | 17 | func (r *ConsumerMetadataRequest) decode(pd packetDecoder, version int16) (err error) { 18 | tmp := new(FindCoordinatorRequest) 19 | if err := tmp.decode(pd, version); err != nil { 20 | return err 21 | } 22 | r.ConsumerGroup = tmp.CoordinatorKey 23 | return nil 24 | } 25 | 26 | func (r *ConsumerMetadataRequest) key() int16 { 27 | return 10 28 | } 29 | 30 | func (r *ConsumerMetadataRequest) version() int16 { 31 | return r.Version 32 | } 33 | 34 | func (r *ConsumerMetadataRequest) headerVersion() int16 { 35 | return 1 36 | } 37 | 38 | func (r *ConsumerMetadataRequest) isValidVersion() bool { 39 | return r.Version >= 0 && r.Version <= 2 40 | } 41 | 42 | func (r *ConsumerMetadataRequest) requiredVersion() KafkaVersion { 43 | switch r.Version { 44 | case 2: 45 | return V2_0_0_0 46 | case 1: 47 | return V0_11_0_0 48 | default: 49 | return V0_8_2_0 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/delete_groups_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type DeleteGroupsRequest struct { 4 | Version int16 5 | Groups []string 6 | } 7 | 8 | func (r *DeleteGroupsRequest) encode(pe packetEncoder) error { 9 | return pe.putStringArray(r.Groups) 10 | } 11 | 12 | func (r *DeleteGroupsRequest) decode(pd packetDecoder, version int16) (err error) { 13 | r.Groups, err = pd.getStringArray() 14 | return 15 | } 16 | 17 | func (r *DeleteGroupsRequest) key() int16 { 18 | return 42 19 | } 20 | 21 | func (r *DeleteGroupsRequest) version() int16 { 22 | return r.Version 23 | } 24 | 25 | func (r *DeleteGroupsRequest) headerVersion() int16 { 26 | return 1 27 | } 28 | 29 | func (r *DeleteGroupsRequest) isValidVersion() bool { 30 | return r.Version >= 0 && r.Version <= 1 31 | } 32 | 33 | func (r *DeleteGroupsRequest) requiredVersion() KafkaVersion { 34 | switch r.Version { 35 | case 1: 36 | return V2_0_0_0 37 | case 0: 38 | return V1_1_0_0 39 | default: 40 | return V2_0_0_0 41 | } 42 | } 43 | 44 | func (r *DeleteGroupsRequest) AddGroup(group string) { 45 | r.Groups = append(r.Groups, group) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/delete_topics_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import "time" 4 | 5 | type DeleteTopicsRequest struct { 6 | Version int16 7 | Topics []string 8 | Timeout time.Duration 9 | } 10 | 11 | func (d *DeleteTopicsRequest) encode(pe packetEncoder) error { 12 | if err := pe.putStringArray(d.Topics); err != nil { 13 | return err 14 | } 15 | pe.putInt32(int32(d.Timeout / time.Millisecond)) 16 | 17 | return nil 18 | } 19 | 20 | func (d *DeleteTopicsRequest) decode(pd packetDecoder, version int16) (err error) { 21 | if d.Topics, err = pd.getStringArray(); err != nil { 22 | return err 23 | } 24 | timeout, err := pd.getInt32() 25 | if err != nil { 26 | return err 27 | } 28 | d.Timeout = time.Duration(timeout) * time.Millisecond 29 | d.Version = version 30 | return nil 31 | } 32 | 33 | func (d *DeleteTopicsRequest) key() int16 { 34 | return 20 35 | } 36 | 37 | func (d *DeleteTopicsRequest) version() int16 { 38 | return d.Version 39 | } 40 | 41 | func (d *DeleteTopicsRequest) headerVersion() int16 { 42 | return 1 43 | } 44 | 45 | func (d *DeleteTopicsRequest) isValidVersion() bool { 46 | return d.Version >= 0 && d.Version <= 3 47 | } 48 | 49 | func (d *DeleteTopicsRequest) requiredVersion() KafkaVersion { 50 | switch d.Version { 51 | case 3: 52 | return V2_1_0_0 53 | case 2: 54 | return V2_0_0_0 55 | case 1: 56 | return V0_11_0_0 57 | case 0: 58 | return V0_10_1_0 59 | default: 60 | return V2_2_0_0 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/describe_groups_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type DescribeGroupsRequest struct { 4 | Version int16 5 | Groups []string 6 | IncludeAuthorizedOperations bool 7 | } 8 | 9 | func (r *DescribeGroupsRequest) encode(pe packetEncoder) error { 10 | if err := pe.putStringArray(r.Groups); err != nil { 11 | return err 12 | } 13 | if r.Version >= 3 { 14 | pe.putBool(r.IncludeAuthorizedOperations) 15 | } 16 | return nil 17 | } 18 | 19 | func (r *DescribeGroupsRequest) decode(pd packetDecoder, version int16) (err error) { 20 | r.Version = version 21 | r.Groups, err = pd.getStringArray() 22 | if err != nil { 23 | return err 24 | } 25 | if r.Version >= 3 { 26 | if r.IncludeAuthorizedOperations, err = pd.getBool(); err != nil { 27 | return err 28 | } 29 | } 30 | return nil 31 | } 32 | 33 | func (r *DescribeGroupsRequest) key() int16 { 34 | return 15 35 | } 36 | 37 | func (r *DescribeGroupsRequest) version() int16 { 38 | return r.Version 39 | } 40 | 41 | func (r *DescribeGroupsRequest) headerVersion() int16 { 42 | return 1 43 | } 44 | 45 | func (r *DescribeGroupsRequest) isValidVersion() bool { 46 | return r.Version >= 0 && r.Version <= 4 47 | } 48 | 49 | func (r *DescribeGroupsRequest) requiredVersion() KafkaVersion { 50 | switch r.Version { 51 | case 4: 52 | return V2_4_0_0 53 | case 3: 54 | return V2_3_0_0 55 | case 2: 56 | return V2_0_0_0 57 | case 1: 58 | return V0_11_0_0 59 | case 0: 60 | return V0_9_0_0 61 | default: 62 | return V2_4_0_0 63 | } 64 | } 65 | 66 | func (r *DescribeGroupsRequest) AddGroup(group string) { 67 | r.Groups = append(r.Groups, group) 68 | } 69 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/dev.yml: -------------------------------------------------------------------------------- 1 | name: sarama 2 | 3 | up: 4 | - go: 5 | version: '1.17.6' 6 | 7 | commands: 8 | test: 9 | run: make test 10 | desc: 'run unit tests' 11 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/election_type.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type ElectionType int8 4 | 5 | const ( 6 | // PreferredElection constant type 7 | PreferredElection ElectionType = 0 8 | // UncleanElection constant type 9 | UncleanElection ElectionType = 1 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/end_txn_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type EndTxnRequest struct { 4 | Version int16 5 | TransactionalID string 6 | ProducerID int64 7 | ProducerEpoch int16 8 | TransactionResult bool 9 | } 10 | 11 | func (a *EndTxnRequest) encode(pe packetEncoder) error { 12 | if err := pe.putString(a.TransactionalID); err != nil { 13 | return err 14 | } 15 | 16 | pe.putInt64(a.ProducerID) 17 | 18 | pe.putInt16(a.ProducerEpoch) 19 | 20 | pe.putBool(a.TransactionResult) 21 | 22 | return nil 23 | } 24 | 25 | func (a *EndTxnRequest) decode(pd packetDecoder, version int16) (err error) { 26 | if a.TransactionalID, err = pd.getString(); err != nil { 27 | return err 28 | } 29 | if a.ProducerID, err = pd.getInt64(); err != nil { 30 | return err 31 | } 32 | if a.ProducerEpoch, err = pd.getInt16(); err != nil { 33 | return err 34 | } 35 | if a.TransactionResult, err = pd.getBool(); err != nil { 36 | return err 37 | } 38 | return nil 39 | } 40 | 41 | func (a *EndTxnRequest) key() int16 { 42 | return 26 43 | } 44 | 45 | func (a *EndTxnRequest) version() int16 { 46 | return a.Version 47 | } 48 | 49 | func (r *EndTxnRequest) headerVersion() int16 { 50 | return 1 51 | } 52 | 53 | func (a *EndTxnRequest) isValidVersion() bool { 54 | return a.Version >= 0 && a.Version <= 2 55 | } 56 | 57 | func (a *EndTxnRequest) requiredVersion() KafkaVersion { 58 | switch a.Version { 59 | case 2: 60 | return V2_7_0_0 61 | case 1: 62 | return V2_0_0_0 63 | default: 64 | return V0_11_0_0 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/end_txn_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | type EndTxnResponse struct { 8 | Version int16 9 | ThrottleTime time.Duration 10 | Err KError 11 | } 12 | 13 | func (e *EndTxnResponse) encode(pe packetEncoder) error { 14 | pe.putInt32(int32(e.ThrottleTime / time.Millisecond)) 15 | pe.putInt16(int16(e.Err)) 16 | return nil 17 | } 18 | 19 | func (e *EndTxnResponse) decode(pd packetDecoder, version int16) (err error) { 20 | throttleTime, err := pd.getInt32() 21 | if err != nil { 22 | return err 23 | } 24 | e.ThrottleTime = time.Duration(throttleTime) * time.Millisecond 25 | 26 | kerr, err := pd.getInt16() 27 | if err != nil { 28 | return err 29 | } 30 | e.Err = KError(kerr) 31 | 32 | return nil 33 | } 34 | 35 | func (e *EndTxnResponse) key() int16 { 36 | return 26 37 | } 38 | 39 | func (e *EndTxnResponse) version() int16 { 40 | return e.Version 41 | } 42 | 43 | func (r *EndTxnResponse) headerVersion() int16 { 44 | return 0 45 | } 46 | 47 | func (e *EndTxnResponse) isValidVersion() bool { 48 | return e.Version >= 0 && e.Version <= 2 49 | } 50 | 51 | func (e *EndTxnResponse) requiredVersion() KafkaVersion { 52 | switch e.Version { 53 | case 2: 54 | return V2_7_0_0 55 | case 1: 56 | return V2_0_0_0 57 | default: 58 | return V0_11_0_0 59 | } 60 | } 61 | 62 | func (r *EndTxnResponse) throttleTime() time.Duration { 63 | return r.ThrottleTime 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | set -o pipefail 5 | 6 | KAFKA_VERSION="${KAFKA_VERSION:-3.6.2}" 7 | KAFKA_HOME="/opt/kafka-${KAFKA_VERSION}" 8 | 9 | if [ ! -d "${KAFKA_HOME}" ]; then 10 | echo 'Error: KAFKA_VERSION '$KAFKA_VERSION' not available in this image at '$KAFKA_HOME 11 | exit 1 12 | fi 13 | 14 | cd "${KAFKA_HOME}" || exit 1 15 | 16 | # discard all empty/commented lines from default config and copy to /tmp 17 | sed -e '/^#/d' -e '/^$/d' config/server.properties >/tmp/server.properties 18 | 19 | echo "########################################################################" >>/tmp/server.properties 20 | 21 | # emulate kafka_configure_from_environment_variables from bitnami/bitnami-docker-kafka 22 | for var in "${!KAFKA_CFG_@}"; do 23 | key="$(echo "$var" | sed -e 's/^KAFKA_CFG_//g' -e 's/_/\./g' -e 's/.*/\L&/')" 24 | sed -e '/^'$key'/d' -i"" /tmp/server.properties 25 | value="${!var}" 26 | echo "$key=$value" >>/tmp/server.properties 27 | done 28 | 29 | sort /tmp/server.properties 30 | 31 | exec bin/kafka-server-start.sh /tmp/server.properties 32 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/find_coordinator_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type CoordinatorType int8 4 | 5 | const ( 6 | CoordinatorGroup CoordinatorType = iota 7 | CoordinatorTransaction 8 | ) 9 | 10 | type FindCoordinatorRequest struct { 11 | Version int16 12 | CoordinatorKey string 13 | CoordinatorType CoordinatorType 14 | } 15 | 16 | func (f *FindCoordinatorRequest) encode(pe packetEncoder) error { 17 | if err := pe.putString(f.CoordinatorKey); err != nil { 18 | return err 19 | } 20 | 21 | if f.Version >= 1 { 22 | pe.putInt8(int8(f.CoordinatorType)) 23 | } 24 | 25 | return nil 26 | } 27 | 28 | func (f *FindCoordinatorRequest) decode(pd packetDecoder, version int16) (err error) { 29 | if f.CoordinatorKey, err = pd.getString(); err != nil { 30 | return err 31 | } 32 | 33 | if version >= 1 { 34 | f.Version = version 35 | coordinatorType, err := pd.getInt8() 36 | if err != nil { 37 | return err 38 | } 39 | 40 | f.CoordinatorType = CoordinatorType(coordinatorType) 41 | } 42 | 43 | return nil 44 | } 45 | 46 | func (f *FindCoordinatorRequest) key() int16 { 47 | return 10 48 | } 49 | 50 | func (f *FindCoordinatorRequest) version() int16 { 51 | return f.Version 52 | } 53 | 54 | func (r *FindCoordinatorRequest) headerVersion() int16 { 55 | return 1 56 | } 57 | 58 | func (f *FindCoordinatorRequest) isValidVersion() bool { 59 | return f.Version >= 0 && f.Version <= 2 60 | } 61 | 62 | func (f *FindCoordinatorRequest) requiredVersion() KafkaVersion { 63 | switch f.Version { 64 | case 2: 65 | return V2_0_0_0 66 | case 1: 67 | return V0_11_0_0 68 | default: 69 | return V0_8_2_0 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/heartbeat_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type HeartbeatRequest struct { 4 | Version int16 5 | GroupId string 6 | GenerationId int32 7 | MemberId string 8 | GroupInstanceId *string 9 | } 10 | 11 | func (r *HeartbeatRequest) encode(pe packetEncoder) error { 12 | if err := pe.putString(r.GroupId); err != nil { 13 | return err 14 | } 15 | 16 | pe.putInt32(r.GenerationId) 17 | 18 | if err := pe.putString(r.MemberId); err != nil { 19 | return err 20 | } 21 | 22 | if r.Version >= 3 { 23 | if err := pe.putNullableString(r.GroupInstanceId); err != nil { 24 | return err 25 | } 26 | } 27 | 28 | return nil 29 | } 30 | 31 | func (r *HeartbeatRequest) decode(pd packetDecoder, version int16) (err error) { 32 | r.Version = version 33 | if r.GroupId, err = pd.getString(); err != nil { 34 | return 35 | } 36 | if r.GenerationId, err = pd.getInt32(); err != nil { 37 | return 38 | } 39 | if r.MemberId, err = pd.getString(); err != nil { 40 | return 41 | } 42 | if r.Version >= 3 { 43 | if r.GroupInstanceId, err = pd.getNullableString(); err != nil { 44 | return 45 | } 46 | } 47 | 48 | return nil 49 | } 50 | 51 | func (r *HeartbeatRequest) key() int16 { 52 | return 12 53 | } 54 | 55 | func (r *HeartbeatRequest) version() int16 { 56 | return r.Version 57 | } 58 | 59 | func (r *HeartbeatRequest) headerVersion() int16 { 60 | return 1 61 | } 62 | 63 | func (r *HeartbeatRequest) isValidVersion() bool { 64 | return r.Version >= 0 && r.Version <= 3 65 | } 66 | 67 | func (r *HeartbeatRequest) requiredVersion() KafkaVersion { 68 | switch r.Version { 69 | case 3: 70 | return V2_3_0_0 71 | case 2: 72 | return V2_0_0_0 73 | case 1: 74 | return V0_11_0_0 75 | case 0: 76 | return V0_8_2_0 77 | default: 78 | return V2_3_0_0 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/heartbeat_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import "time" 4 | 5 | type HeartbeatResponse struct { 6 | Version int16 7 | ThrottleTime int32 8 | Err KError 9 | } 10 | 11 | func (r *HeartbeatResponse) encode(pe packetEncoder) error { 12 | if r.Version >= 1 { 13 | pe.putInt32(r.ThrottleTime) 14 | } 15 | pe.putInt16(int16(r.Err)) 16 | return nil 17 | } 18 | 19 | func (r *HeartbeatResponse) decode(pd packetDecoder, version int16) error { 20 | var err error 21 | r.Version = version 22 | if r.Version >= 1 { 23 | if r.ThrottleTime, err = pd.getInt32(); err != nil { 24 | return err 25 | } 26 | } 27 | kerr, err := pd.getInt16() 28 | if err != nil { 29 | return err 30 | } 31 | r.Err = KError(kerr) 32 | 33 | return nil 34 | } 35 | 36 | func (r *HeartbeatResponse) key() int16 { 37 | return 12 38 | } 39 | 40 | func (r *HeartbeatResponse) version() int16 { 41 | return r.Version 42 | } 43 | 44 | func (r *HeartbeatResponse) headerVersion() int16 { 45 | return 0 46 | } 47 | 48 | func (r *HeartbeatResponse) isValidVersion() bool { 49 | return r.Version >= 0 && r.Version <= 3 50 | } 51 | 52 | func (r *HeartbeatResponse) requiredVersion() KafkaVersion { 53 | switch r.Version { 54 | case 3: 55 | return V2_3_0_0 56 | case 2: 57 | return V2_0_0_0 58 | case 1: 59 | return V0_11_0_0 60 | case 0: 61 | return V0_8_2_0 62 | default: 63 | return V2_3_0_0 64 | } 65 | } 66 | 67 | func (r *HeartbeatResponse) throttleTime() time.Duration { 68 | return time.Duration(r.ThrottleTime) * time.Millisecond 69 | } 70 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/interceptors.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | // ProducerInterceptor allows you to intercept (and possibly mutate) the records 4 | // received by the producer before they are published to the Kafka cluster. 5 | // https://cwiki.apache.org/confluence/display/KAFKA/KIP-42%3A+Add+Producer+and+Consumer+Interceptors#KIP42:AddProducerandConsumerInterceptors-Motivation 6 | type ProducerInterceptor interface { 7 | 8 | // OnSend is called when the producer message is intercepted. Please avoid 9 | // modifying the message until it's safe to do so, as this is _not_ a copy 10 | // of the message. 11 | OnSend(*ProducerMessage) 12 | } 13 | 14 | // ConsumerInterceptor allows you to intercept (and possibly mutate) the records 15 | // received by the consumer before they are sent to the messages channel. 16 | // https://cwiki.apache.org/confluence/display/KAFKA/KIP-42%3A+Add+Producer+and+Consumer+Interceptors#KIP42:AddProducerandConsumerInterceptors-Motivation 17 | type ConsumerInterceptor interface { 18 | 19 | // OnConsume is called when the consumed message is intercepted. Please 20 | // avoid modifying the message until it's safe to do so, as this is _not_ a 21 | // copy of the message. 22 | OnConsume(*ConsumerMessage) 23 | } 24 | 25 | func (msg *ProducerMessage) safelyApplyInterceptor(interceptor ProducerInterceptor) { 26 | defer func() { 27 | if r := recover(); r != nil { 28 | Logger.Printf("Error when calling producer interceptor: %v, %v", interceptor, r) 29 | } 30 | }() 31 | 32 | interceptor.OnSend(msg) 33 | } 34 | 35 | func (msg *ConsumerMessage) safelyApplyInterceptor(interceptor ConsumerInterceptor) { 36 | defer func() { 37 | if r := recover(); r != nil { 38 | Logger.Printf("Error when calling consumer interceptor: %v, %v", interceptor, r) 39 | } 40 | }() 41 | 42 | interceptor.OnConsume(msg) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/list_groups_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type ListGroupsRequest struct { 4 | Version int16 5 | StatesFilter []string // version 4 or later 6 | } 7 | 8 | func (r *ListGroupsRequest) encode(pe packetEncoder) error { 9 | if r.Version >= 4 { 10 | pe.putCompactArrayLength(len(r.StatesFilter)) 11 | for _, filter := range r.StatesFilter { 12 | err := pe.putCompactString(filter) 13 | if err != nil { 14 | return err 15 | } 16 | } 17 | } 18 | if r.Version >= 3 { 19 | pe.putEmptyTaggedFieldArray() 20 | } 21 | return nil 22 | } 23 | 24 | func (r *ListGroupsRequest) decode(pd packetDecoder, version int16) (err error) { 25 | r.Version = version 26 | if r.Version >= 4 { 27 | filterLen, err := pd.getCompactArrayLength() 28 | if err != nil { 29 | return err 30 | } 31 | if filterLen > 0 { 32 | r.StatesFilter = make([]string, filterLen) 33 | for i := 0; i < filterLen; i++ { 34 | if r.StatesFilter[i], err = pd.getCompactString(); err != nil { 35 | return err 36 | } 37 | } 38 | } 39 | } 40 | if r.Version >= 3 { 41 | if _, err = pd.getEmptyTaggedFieldArray(); err != nil { 42 | return err 43 | } 44 | } 45 | return nil 46 | } 47 | 48 | func (r *ListGroupsRequest) key() int16 { 49 | return 16 50 | } 51 | 52 | func (r *ListGroupsRequest) version() int16 { 53 | return r.Version 54 | } 55 | 56 | func (r *ListGroupsRequest) headerVersion() int16 { 57 | if r.Version >= 3 { 58 | return 2 59 | } 60 | return 1 61 | } 62 | 63 | func (r *ListGroupsRequest) isValidVersion() bool { 64 | return r.Version >= 0 && r.Version <= 4 65 | } 66 | 67 | func (r *ListGroupsRequest) requiredVersion() KafkaVersion { 68 | switch r.Version { 69 | case 4: 70 | return V2_6_0_0 71 | case 3: 72 | return V2_4_0_0 73 | case 2: 74 | return V2_0_0_0 75 | case 1: 76 | return V0_11_0_0 77 | case 0: 78 | return V0_9_0_0 79 | default: 80 | return V2_6_0_0 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/quota_types.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type ( 4 | QuotaEntityType string 5 | 6 | QuotaMatchType int 7 | ) 8 | 9 | // ref: https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/quota/ClientQuotaEntity.java 10 | const ( 11 | QuotaEntityUser QuotaEntityType = "user" 12 | QuotaEntityClientID QuotaEntityType = "client-id" 13 | QuotaEntityIP QuotaEntityType = "ip" 14 | ) 15 | 16 | // ref: https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/requests/DescribeClientQuotasRequest.java 17 | const ( 18 | QuotaMatchExact QuotaMatchType = iota 19 | QuotaMatchDefault 20 | QuotaMatchAny 21 | ) 22 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/response_header.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import "fmt" 4 | 5 | type responseHeader struct { 6 | length int32 7 | correlationID int32 8 | } 9 | 10 | func (r *responseHeader) decode(pd packetDecoder, version int16) (err error) { 11 | r.length, err = pd.getInt32() 12 | if err != nil { 13 | return err 14 | } 15 | if r.length <= 4 || r.length > MaxResponseSize { 16 | return PacketDecodingError{fmt.Sprintf("message of length %d too large or too small", r.length)} 17 | } 18 | 19 | r.correlationID, err = pd.getInt32() 20 | 21 | if version >= 1 { 22 | if _, err := pd.getEmptyTaggedFieldArray(); err != nil { 23 | return err 24 | } 25 | } 26 | 27 | return err 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/sasl_authenticate_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type SaslAuthenticateRequest struct { 4 | // Version defines the protocol version to use for encode and decode 5 | Version int16 6 | SaslAuthBytes []byte 7 | } 8 | 9 | // APIKeySASLAuth is the API key for the SaslAuthenticate Kafka API 10 | const APIKeySASLAuth = 36 11 | 12 | func (r *SaslAuthenticateRequest) encode(pe packetEncoder) error { 13 | return pe.putBytes(r.SaslAuthBytes) 14 | } 15 | 16 | func (r *SaslAuthenticateRequest) decode(pd packetDecoder, version int16) (err error) { 17 | r.Version = version 18 | r.SaslAuthBytes, err = pd.getBytes() 19 | return err 20 | } 21 | 22 | func (r *SaslAuthenticateRequest) key() int16 { 23 | return APIKeySASLAuth 24 | } 25 | 26 | func (r *SaslAuthenticateRequest) version() int16 { 27 | return r.Version 28 | } 29 | 30 | func (r *SaslAuthenticateRequest) headerVersion() int16 { 31 | return 1 32 | } 33 | 34 | func (r *SaslAuthenticateRequest) isValidVersion() bool { 35 | return r.Version >= 0 && r.Version <= 1 36 | } 37 | 38 | func (r *SaslAuthenticateRequest) requiredVersion() KafkaVersion { 39 | switch r.Version { 40 | case 1: 41 | return V2_2_0_0 42 | default: 43 | return V1_0_0_0 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/sasl_authenticate_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type SaslAuthenticateResponse struct { 4 | // Version defines the protocol version to use for encode and decode 5 | Version int16 6 | Err KError 7 | ErrorMessage *string 8 | SaslAuthBytes []byte 9 | SessionLifetimeMs int64 10 | } 11 | 12 | func (r *SaslAuthenticateResponse) encode(pe packetEncoder) error { 13 | pe.putInt16(int16(r.Err)) 14 | if err := pe.putNullableString(r.ErrorMessage); err != nil { 15 | return err 16 | } 17 | if err := pe.putBytes(r.SaslAuthBytes); err != nil { 18 | return err 19 | } 20 | if r.Version > 0 { 21 | pe.putInt64(r.SessionLifetimeMs) 22 | } 23 | return nil 24 | } 25 | 26 | func (r *SaslAuthenticateResponse) decode(pd packetDecoder, version int16) error { 27 | r.Version = version 28 | kerr, err := pd.getInt16() 29 | if err != nil { 30 | return err 31 | } 32 | 33 | r.Err = KError(kerr) 34 | 35 | if r.ErrorMessage, err = pd.getNullableString(); err != nil { 36 | return err 37 | } 38 | 39 | if r.SaslAuthBytes, err = pd.getBytes(); err != nil { 40 | return err 41 | } 42 | 43 | if version > 0 { 44 | r.SessionLifetimeMs, err = pd.getInt64() 45 | } 46 | 47 | return err 48 | } 49 | 50 | func (r *SaslAuthenticateResponse) key() int16 { 51 | return APIKeySASLAuth 52 | } 53 | 54 | func (r *SaslAuthenticateResponse) version() int16 { 55 | return r.Version 56 | } 57 | 58 | func (r *SaslAuthenticateResponse) headerVersion() int16 { 59 | return 0 60 | } 61 | 62 | func (r *SaslAuthenticateResponse) isValidVersion() bool { 63 | return r.Version >= 0 && r.Version <= 1 64 | } 65 | 66 | func (r *SaslAuthenticateResponse) requiredVersion() KafkaVersion { 67 | switch r.Version { 68 | case 1: 69 | return V2_2_0_0 70 | default: 71 | return V1_0_0_0 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/sasl_handshake_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type SaslHandshakeRequest struct { 4 | Mechanism string 5 | Version int16 6 | } 7 | 8 | func (r *SaslHandshakeRequest) encode(pe packetEncoder) error { 9 | if err := pe.putString(r.Mechanism); err != nil { 10 | return err 11 | } 12 | 13 | return nil 14 | } 15 | 16 | func (r *SaslHandshakeRequest) decode(pd packetDecoder, version int16) (err error) { 17 | if r.Mechanism, err = pd.getString(); err != nil { 18 | return err 19 | } 20 | 21 | return nil 22 | } 23 | 24 | func (r *SaslHandshakeRequest) key() int16 { 25 | return 17 26 | } 27 | 28 | func (r *SaslHandshakeRequest) version() int16 { 29 | return r.Version 30 | } 31 | 32 | func (r *SaslHandshakeRequest) headerVersion() int16 { 33 | return 1 34 | } 35 | 36 | func (r *SaslHandshakeRequest) isValidVersion() bool { 37 | return r.Version >= 0 && r.Version <= 1 38 | } 39 | 40 | func (r *SaslHandshakeRequest) requiredVersion() KafkaVersion { 41 | switch r.Version { 42 | case 1: 43 | return V1_0_0_0 44 | default: 45 | return V0_10_0_0 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/sasl_handshake_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type SaslHandshakeResponse struct { 4 | Version int16 5 | Err KError 6 | EnabledMechanisms []string 7 | } 8 | 9 | func (r *SaslHandshakeResponse) encode(pe packetEncoder) error { 10 | pe.putInt16(int16(r.Err)) 11 | return pe.putStringArray(r.EnabledMechanisms) 12 | } 13 | 14 | func (r *SaslHandshakeResponse) decode(pd packetDecoder, version int16) error { 15 | kerr, err := pd.getInt16() 16 | if err != nil { 17 | return err 18 | } 19 | 20 | r.Err = KError(kerr) 21 | 22 | if r.EnabledMechanisms, err = pd.getStringArray(); err != nil { 23 | return err 24 | } 25 | 26 | return nil 27 | } 28 | 29 | func (r *SaslHandshakeResponse) key() int16 { 30 | return 17 31 | } 32 | 33 | func (r *SaslHandshakeResponse) version() int16 { 34 | return r.Version 35 | } 36 | 37 | func (r *SaslHandshakeResponse) headerVersion() int16 { 38 | return 0 39 | } 40 | 41 | func (r *SaslHandshakeResponse) isValidVersion() bool { 42 | return r.Version >= 0 && r.Version <= 1 43 | } 44 | 45 | func (r *SaslHandshakeResponse) requiredVersion() KafkaVersion { 46 | switch r.Version { 47 | case 1: 48 | return V1_0_0_0 49 | default: 50 | return V0_10_0_0 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/scram_formatter.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import ( 4 | "crypto/hmac" 5 | "crypto/sha256" 6 | "crypto/sha512" 7 | "hash" 8 | ) 9 | 10 | // ScramFormatter implementation 11 | // @see: https://github.com/apache/kafka/blob/99b9b3e84f4e98c3f07714e1de6a139a004cbc5b/clients/src/main/java/org/apache/kafka/common/security/scram/internals/ScramFormatter.java#L93 12 | type scramFormatter struct { 13 | mechanism ScramMechanismType 14 | } 15 | 16 | func (s scramFormatter) mac(key []byte) (hash.Hash, error) { 17 | var m hash.Hash 18 | 19 | switch s.mechanism { 20 | case SCRAM_MECHANISM_SHA_256: 21 | m = hmac.New(sha256.New, key) 22 | 23 | case SCRAM_MECHANISM_SHA_512: 24 | m = hmac.New(sha512.New, key) 25 | default: 26 | return nil, ErrUnknownScramMechanism 27 | } 28 | 29 | return m, nil 30 | } 31 | 32 | func (s scramFormatter) hmac(key []byte, extra []byte) ([]byte, error) { 33 | mac, err := s.mac(key) 34 | if err != nil { 35 | return nil, err 36 | } 37 | 38 | if _, err := mac.Write(extra); err != nil { 39 | return nil, err 40 | } 41 | return mac.Sum(nil), nil 42 | } 43 | 44 | func (s scramFormatter) xor(result []byte, second []byte) { 45 | for i := 0; i < len(result); i++ { 46 | result[i] = result[i] ^ second[i] 47 | } 48 | } 49 | 50 | func (s scramFormatter) saltedPassword(password []byte, salt []byte, iterations int) ([]byte, error) { 51 | mac, err := s.mac(password) 52 | if err != nil { 53 | return nil, err 54 | } 55 | 56 | if _, err := mac.Write(salt); err != nil { 57 | return nil, err 58 | } 59 | if _, err := mac.Write([]byte{0, 0, 0, 1}); err != nil { 60 | return nil, err 61 | } 62 | 63 | u1 := mac.Sum(nil) 64 | prev := u1 65 | result := u1 66 | 67 | for i := 2; i <= iterations; i++ { 68 | ui, err := s.hmac(password, prev) 69 | if err != nil { 70 | return nil, err 71 | } 72 | 73 | s.xor(result, ui) 74 | prev = ui 75 | } 76 | 77 | return result, nil 78 | } 79 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/timestamp.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | type Timestamp struct { 9 | *time.Time 10 | } 11 | 12 | func (t Timestamp) encode(pe packetEncoder) error { 13 | timestamp := int64(-1) 14 | 15 | if !t.Before(time.Unix(0, 0)) { 16 | timestamp = t.UnixNano() / int64(time.Millisecond) 17 | } else if !t.IsZero() { 18 | return PacketEncodingError{fmt.Sprintf("invalid timestamp (%v)", t)} 19 | } 20 | 21 | pe.putInt64(timestamp) 22 | return nil 23 | } 24 | 25 | func (t Timestamp) decode(pd packetDecoder) error { 26 | millis, err := pd.getInt64() 27 | if err != nil { 28 | return err 29 | } 30 | 31 | // negative timestamps are invalid, in these cases we should return 32 | // a zero time 33 | timestamp := time.Time{} 34 | if millis >= 0 { 35 | timestamp = time.Unix(millis/1000, (millis%1000)*int64(time.Millisecond)) 36 | } 37 | 38 | *t.Time = timestamp 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/IBM/sarama/version.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import ( 4 | "runtime/debug" 5 | "sync" 6 | ) 7 | 8 | var ( 9 | v string 10 | vOnce sync.Once 11 | ) 12 | 13 | func version() string { 14 | vOnce.Do(func() { 15 | bi, ok := debug.ReadBuildInfo() 16 | if ok { 17 | v = bi.Main.Version 18 | } 19 | if v == "" || v == "(devel)" { 20 | // if we can't read a go module version then they're using a git 21 | // clone or vendored module so all we can do is report "dev" for 22 | // the version to make a valid ApiVersions request 23 | v = "dev" 24 | } 25 | }) 26 | return v 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/spew/bypasssafe.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015-2016 Dave Collins 2 | // 3 | // Permission to use, copy, modify, and distribute this software for any 4 | // purpose with or without fee is hereby granted, provided that the above 5 | // copyright notice and this permission notice appear in all copies. 6 | // 7 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | 15 | // NOTE: Due to the following build constraints, this file will only be compiled 16 | // when the code is running on Google App Engine, compiled by GopherJS, or 17 | // "-tags safe" is added to the go build command line. The "disableunsafe" 18 | // tag is deprecated and thus should not be used. 19 | // +build js appengine safe disableunsafe !go1.4 20 | 21 | package spew 22 | 23 | import "reflect" 24 | 25 | const ( 26 | // UnsafeDisabled is a build-time constant which specifies whether or 27 | // not access to the unsafe package is available. 28 | UnsafeDisabled = true 29 | ) 30 | 31 | // unsafeReflectValue typically converts the passed reflect.Value into a one 32 | // that bypasses the typical safety restrictions preventing access to 33 | // unaddressable and unexported data. However, doing this relies on access to 34 | // the unsafe package. This is a stub version which simply returns the passed 35 | // reflect.Value when the unsafe package is not available. 36 | func unsafeReflectValue(v reflect.Value) reflect.Value { 37 | return v 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-resiliency/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Evan Huus 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 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-resiliency/breaker/README.md: -------------------------------------------------------------------------------- 1 | circuit-breaker 2 | =============== 3 | 4 | [![Golang CI](https://github.com/eapache/go-resiliency/actions/workflows/golang-ci.yml/badge.svg)](https://github.com/eapache/go-resiliency/actions/workflows/golang-ci.yml) 5 | [![GoDoc](https://godoc.org/github.com/eapache/go-resiliency/breaker?status.svg)](https://godoc.org/github.com/eapache/go-resiliency/breaker) 6 | [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-active-blue.svg)](https://eapache.github.io/conduct.html) 7 | 8 | The circuit-breaker resiliency pattern for golang. 9 | 10 | Creating a breaker takes three parameters: 11 | - error threshold (for opening the breaker) 12 | - success threshold (for closing the breaker) 13 | - timeout (how long to keep the breaker open) 14 | 15 | ```go 16 | b := breaker.New(3, 1, 5*time.Second) 17 | 18 | for { 19 | result := b.Run(func() error { 20 | // communicate with some external service and 21 | // return an error if the communication failed 22 | return nil 23 | }) 24 | 25 | switch result { 26 | case nil: 27 | // success! 28 | case breaker.ErrBreakerOpen: 29 | // our function wasn't run because the breaker was open 30 | default: 31 | // some other error 32 | } 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-xerial-snappy/.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 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-xerial-snappy/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.5.4 5 | - 1.6.1 6 | 7 | sudo: false 8 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-xerial-snappy/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Evan Huus 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 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-xerial-snappy/README.md: -------------------------------------------------------------------------------- 1 | # go-xerial-snappy 2 | 3 | [![Build Status](https://travis-ci.org/eapache/go-xerial-snappy.svg?branch=master)](https://travis-ci.org/eapache/go-xerial-snappy) 4 | 5 | Xerial-compatible Snappy framing support for golang. 6 | 7 | Packages using Xerial for snappy encoding use a framing format incompatible with 8 | basically everything else in existence. This package wraps Go's built-in snappy 9 | package to support it. 10 | 11 | Apps that use this format include Apache Kafka (see 12 | https://github.com/dpkp/kafka-python/issues/126#issuecomment-35478921 for 13 | details). 14 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/queue/.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 | *.test 24 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/queue/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | go: 5 | - 1.2 6 | - 1.3 7 | - 1.4 8 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/queue/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Evan Huus 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. -------------------------------------------------------------------------------- /vendor/github.com/eapache/queue/README.md: -------------------------------------------------------------------------------- 1 | Queue 2 | ===== 3 | 4 | [![Build Status](https://travis-ci.org/eapache/queue.svg)](https://travis-ci.org/eapache/queue) 5 | [![GoDoc](https://godoc.org/github.com/eapache/queue?status.png)](https://godoc.org/github.com/eapache/queue) 6 | [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-active-blue.svg)](https://eapache.github.io/conduct.html) 7 | 8 | A fast Golang queue using a ring-buffer, based on the version suggested by Dariusz Górecki. 9 | Using this instead of other, simpler, queue implementations (slice+append or linked list) provides 10 | substantial memory and time benefits, and fewer GC pauses. 11 | 12 | The queue implemented here is as fast as it is in part because it is *not* thread-safe. 13 | 14 | Follows semantic versioning using https://gopkg.in/ - import from 15 | [`gopkg.in/eapache/queue.v1`](https://gopkg.in/eapache/queue.v1) 16 | for guaranteed API stability. 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/atomic_bool.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package. 2 | // 3 | // Copyright 2022 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 | //go:build go1.19 9 | // +build go1.19 10 | 11 | package mysql 12 | 13 | import "sync/atomic" 14 | 15 | /****************************************************************************** 16 | * Sync utils * 17 | ******************************************************************************/ 18 | 19 | type atomicBool = atomic.Bool 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/atomic_bool_go118.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package. 2 | // 3 | // Copyright 2022 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 | //go:build !go1.19 9 | // +build !go1.19 10 | 11 | package mysql 12 | 13 | import "sync/atomic" 14 | 15 | /****************************************************************************** 16 | * Sync utils * 17 | ******************************************************************************/ 18 | 19 | // atomicBool is an implementation of atomic.Bool for older version of Go. 20 | // it is a wrapper around uint32 for usage as a boolean value with 21 | // atomic access. 22 | type atomicBool struct { 23 | _ noCopy 24 | value uint32 25 | } 26 | 27 | // Load returns whether the current boolean value is true 28 | func (ab *atomicBool) Load() bool { 29 | return atomic.LoadUint32(&ab.value) > 0 30 | } 31 | 32 | // Store sets the value of the bool regardless of the previous value 33 | func (ab *atomicBool) Store(value bool) { 34 | if value { 35 | atomic.StoreUint32(&ab.value, 1) 36 | } else { 37 | atomic.StoreUint32(&ab.value, 0) 38 | } 39 | } 40 | 41 | // Swap sets the value of the bool and returns the old value. 42 | func (ab *atomicBool) Swap(value bool) bool { 43 | if value { 44 | return atomic.SwapUint32(&ab.value, 1) > 0 45 | } 46 | return atomic.SwapUint32(&ab.value, 0) > 0 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/conncheck.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2019 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 | //go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd || solaris || illumos 10 | // +build linux darwin dragonfly freebsd netbsd openbsd solaris illumos 11 | 12 | package mysql 13 | 14 | import ( 15 | "errors" 16 | "io" 17 | "net" 18 | "syscall" 19 | ) 20 | 21 | var errUnexpectedRead = errors.New("unexpected read from socket") 22 | 23 | func connCheck(conn net.Conn) error { 24 | var sysErr error 25 | 26 | sysConn, ok := conn.(syscall.Conn) 27 | if !ok { 28 | return nil 29 | } 30 | rawConn, err := sysConn.SyscallConn() 31 | if err != nil { 32 | return err 33 | } 34 | 35 | err = rawConn.Read(func(fd uintptr) bool { 36 | var buf [1]byte 37 | n, err := syscall.Read(int(fd), buf[:]) 38 | switch { 39 | case n == 0 && err == nil: 40 | sysErr = io.EOF 41 | case n > 0: 42 | sysErr = errUnexpectedRead 43 | case err == syscall.EAGAIN || err == syscall.EWOULDBLOCK: 44 | sysErr = nil 45 | default: 46 | sysErr = err 47 | } 48 | return true 49 | }) 50 | if err != nil { 51 | return err 52 | } 53 | 54 | return sysErr 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/conncheck_dummy.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2019 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 | //go:build !linux && !darwin && !dragonfly && !freebsd && !netbsd && !openbsd && !solaris && !illumos 10 | // +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!illumos 11 | 12 | package mysql 13 | 14 | import "net" 15 | 16 | func connCheck(conn net.Conn) error { 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /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 | import "database/sql/driver" 12 | 13 | // Result exposes data not available through *connection.Result. 14 | // 15 | // This is accessible by executing statements using sql.Conn.Raw() and 16 | // downcasting the returned result: 17 | // 18 | // res, err := rawConn.Exec(...) 19 | // res.(mysql.Result).AllRowsAffected() 20 | type Result interface { 21 | driver.Result 22 | // AllRowsAffected returns a slice containing the affected rows for each 23 | // executed statement. 24 | AllRowsAffected() []int64 25 | // AllLastInsertIds returns a slice containing the last inserted ID for each 26 | // executed statement. 27 | AllLastInsertIds() []int64 28 | } 29 | 30 | type mysqlResult struct { 31 | // One entry in both slices is created for every executed statement result. 32 | affectedRows []int64 33 | insertIds []int64 34 | } 35 | 36 | func (res *mysqlResult) LastInsertId() (int64, error) { 37 | return res.insertIds[len(res.insertIds)-1], nil 38 | } 39 | 40 | func (res *mysqlResult) RowsAffected() (int64, error) { 41 | return res.affectedRows[len(res.affectedRows)-1], nil 42 | } 43 | 44 | func (res *mysqlResult) AllLastInsertIds() []int64 { 45 | return append([]int64{}, res.insertIds...) // defensive copy 46 | } 47 | 48 | func (res *mysqlResult) AllRowsAffected() []int64 { 49 | return append([]int64{}, res.affectedRows...) // defensive copy 50 | } 51 | -------------------------------------------------------------------------------- /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.Load() { 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.Load() { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/.gitignore: -------------------------------------------------------------------------------- 1 | cmd/snappytool/snappytool 2 | testdata/bench 3 | 4 | # These explicitly listed benchmark data files are for an obsolete version of 5 | # snappy_test.go. 6 | testdata/alice29.txt 7 | testdata/asyoulik.txt 8 | testdata/fireworks.jpeg 9 | testdata/geo.protodata 10 | testdata/html 11 | testdata/html_x_4 12 | testdata/kppkn.gtb 13 | testdata/lcet10.txt 14 | testdata/paper-100k.pdf 15 | testdata/plrabn12.txt 16 | testdata/urls.10K 17 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Amazon.com, Inc 12 | Damian Gryski 13 | Eric Buth 14 | Google Inc. 15 | Jan Mercl <0xjnml@gmail.com> 16 | Klaus Post 17 | Rodolfo Carvalho 18 | Sebastien Binet 19 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people who can contribute 2 | # (and typically have contributed) code to the Snappy-Go repository. 3 | # The AUTHORS file lists the copyright holders; this file 4 | # lists people. For example, Google employees are listed here 5 | # but not in AUTHORS, because Google holds the copyright. 6 | # 7 | # The submission process automatically checks to make sure 8 | # that people submitting code are listed in this file (by email address). 9 | # 10 | # Names should be added to this file only after verifying that 11 | # the individual or the individual's organization has agreed to 12 | # the appropriate Contributor License Agreement, found here: 13 | # 14 | # http://code.google.com/legal/individual-cla-v1.0.html 15 | # http://code.google.com/legal/corporate-cla-v1.0.html 16 | # 17 | # The agreement for individuals can be filled out on the web. 18 | # 19 | # When adding J Random Contributor's name to this file, 20 | # either J's name or J's organization's name should be 21 | # added to the AUTHORS file, depending on whether the 22 | # individual or corporate CLA was used. 23 | 24 | # Names should be added to this file like so: 25 | # Name 26 | 27 | # Please keep the list sorted. 28 | 29 | Alex Legg 30 | Damian Gryski 31 | Eric Buth 32 | Jan Mercl <0xjnml@gmail.com> 33 | Jonathan Swinney 34 | Kai Backman 35 | Klaus Post 36 | Marc-Antoine Ruel 37 | Nigel Tao 38 | Rob Pike 39 | Rodolfo Carvalho 40 | Russ Cox 41 | Sebastien Binet 42 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 The Snappy-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 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_asm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-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 | // +build gc 7 | // +build !noasm 8 | // +build amd64 arm64 9 | 10 | package snappy 11 | 12 | // decode has the same semantics as in decode_other.go. 13 | // 14 | //go:noescape 15 | func decode(dst, src []byte) int 16 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_asm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-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 | // +build gc 7 | // +build !noasm 8 | // +build amd64 arm64 9 | 10 | package snappy 11 | 12 | // emitLiteral has the same semantics as in encode_other.go. 13 | // 14 | //go:noescape 15 | func emitLiteral(dst, lit []byte) int 16 | 17 | // emitCopy has the same semantics as in encode_other.go. 18 | // 19 | //go:noescape 20 | func emitCopy(dst []byte, offset, length int) int 21 | 22 | // extendMatch has the same semantics as in encode_other.go. 23 | // 24 | //go:noescape 25 | func extendMatch(src []byte, i, j int) int 26 | 27 | // encodeBlock has the same semantics as in encode_other.go. 28 | // 29 | //go:noescape 30 | func encodeBlock(dst, src []byte) (d int) 31 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [1.6.0](https://github.com/google/uuid/compare/v1.5.0...v1.6.0) (2024-01-16) 4 | 5 | 6 | ### Features 7 | 8 | * add Max UUID constant ([#149](https://github.com/google/uuid/issues/149)) ([c58770e](https://github.com/google/uuid/commit/c58770eb495f55fe2ced6284f93c5158a62e53e3)) 9 | 10 | 11 | ### Bug Fixes 12 | 13 | * fix typo in version 7 uuid documentation ([#153](https://github.com/google/uuid/issues/153)) ([016b199](https://github.com/google/uuid/commit/016b199544692f745ffc8867b914129ecb47ef06)) 14 | * Monotonicity in UUIDv7 ([#150](https://github.com/google/uuid/issues/150)) ([a2b2b32](https://github.com/google/uuid/commit/a2b2b32373ff0b1a312b7fdf6d38a977099698a6)) 15 | 16 | ## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12) 17 | 18 | 19 | ### Features 20 | 21 | * Validate UUID without creating new UUID ([#141](https://github.com/google/uuid/issues/141)) ([9ee7366](https://github.com/google/uuid/commit/9ee7366e66c9ad96bab89139418a713dc584ae29)) 22 | 23 | ## [1.4.0](https://github.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26) 24 | 25 | 26 | ### Features 27 | 28 | * UUIDs slice type with Strings() convenience method ([#133](https://github.com/google/uuid/issues/133)) ([cd5fbbd](https://github.com/google/uuid/commit/cd5fbbdd02f3e3467ac18940e07e062be1f864b4)) 29 | 30 | ### Fixes 31 | 32 | * Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior) 33 | 34 | ## [1.3.1](https://github.com/google/uuid/compare/v1.3.0...v1.3.1) (2023-08-18) 35 | 36 | 37 | ### Bug Fixes 38 | 39 | * Use .EqualFold() to parse urn prefixed UUIDs ([#118](https://github.com/google/uuid/issues/118)) ([574e687](https://github.com/google/uuid/commit/574e6874943741fb99d41764c705173ada5293f0)) 40 | 41 | ## Changelog 42 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to this project! 4 | 5 | ### Tips 6 | 7 | Commits must be formatted according to the [Conventional Commits Specification](https://www.conventionalcommits.org). 8 | 9 | Always try to include a test case! If it is not possible or not necessary, 10 | please explain why in the pull request description. 11 | 12 | ### Releasing 13 | 14 | Commits that would precipitate a SemVer change, as described in the Conventional 15 | Commits Specification, will trigger [`release-please`](https://github.com/google-github-actions/release-please-action) 16 | to create a release candidate pull request. Once submitted, `release-please` 17 | will create a release. 18 | 19 | For tips on how to work with `release-please`, see its documentation. 20 | 21 | ### Legal requirements 22 | 23 | In order to protect both you and ourselves, you will need to sign the 24 | [Contributor License Agreement](https://cla.developers.google.com/clas). 25 | 26 | You may have already signed it for other Google projects. 27 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Paul Borman 2 | bmatsuo 3 | shawnps 4 | theory 5 | jboverfelt 6 | dsymonds 7 | cd1 8 | wallclockbuilder 9 | dansouza 10 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009,2014 Google Inc. 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 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/README.md: -------------------------------------------------------------------------------- 1 | # uuid 2 | The uuid package generates and inspects UUIDs based on 3 | [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122) 4 | and DCE 1.1: Authentication and Security Services. 5 | 6 | This package is based on the github.com/pborman/uuid package (previously named 7 | code.google.com/p/go-uuid). It differs from these earlier packages in that 8 | a UUID is a 16 byte array rather than a byte slice. One loss due to this 9 | change is the ability to represent an invalid UUID (vs a NIL UUID). 10 | 11 | ###### Install 12 | ```sh 13 | go get github.com/google/uuid 14 | ``` 15 | 16 | ###### Documentation 17 | [![Go Reference](https://pkg.go.dev/badge/github.com/google/uuid.svg)](https://pkg.go.dev/github.com/google/uuid) 18 | 19 | Full `go doc` style documentation for the package can be viewed online without 20 | installing this package by using the GoDoc site here: 21 | http://pkg.go.dev/github.com/google/uuid 22 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. 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 uuid generates and inspects UUIDs. 6 | // 7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security 8 | // Services. 9 | // 10 | // A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to 11 | // maps or compared directly. 12 | package uuid 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/marshal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. 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 uuid 6 | 7 | import "fmt" 8 | 9 | // MarshalText implements encoding.TextMarshaler. 10 | func (uuid UUID) MarshalText() ([]byte, error) { 11 | var js [36]byte 12 | encodeHex(js[:], uuid) 13 | return js[:], nil 14 | } 15 | 16 | // UnmarshalText implements encoding.TextUnmarshaler. 17 | func (uuid *UUID) UnmarshalText(data []byte) error { 18 | id, err := ParseBytes(data) 19 | if err != nil { 20 | return err 21 | } 22 | *uuid = id 23 | return nil 24 | } 25 | 26 | // MarshalBinary implements encoding.BinaryMarshaler. 27 | func (uuid UUID) MarshalBinary() ([]byte, error) { 28 | return uuid[:], nil 29 | } 30 | 31 | // UnmarshalBinary implements encoding.BinaryUnmarshaler. 32 | func (uuid *UUID) UnmarshalBinary(data []byte) error { 33 | if len(data) != 16 { 34 | return fmt.Errorf("invalid UUID (got %d bytes)", len(data)) 35 | } 36 | copy(uuid[:], data) 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. 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 js 6 | 7 | package uuid 8 | 9 | // getHardwareInterface returns nil values for the JS version of the code. 10 | // This removes the "net" dependency, because it is not used in the browser. 11 | // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. 12 | func getHardwareInterface(name string) (string, []byte) { return "", nil } 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_net.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. 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 !js 6 | 7 | package uuid 8 | 9 | import "net" 10 | 11 | var interfaces []net.Interface // cached list of interfaces 12 | 13 | // getHardwareInterface returns the name and hardware address of interface name. 14 | // If name is "" then the name and hardware address of one of the system's 15 | // interfaces is returned. If no interfaces are found (name does not exist or 16 | // there are no interfaces) then "", nil is returned. 17 | // 18 | // Only addresses of at least 6 bytes are returned. 19 | func getHardwareInterface(name string) (string, []byte) { 20 | if interfaces == nil { 21 | var err error 22 | interfaces, err = net.Interfaces() 23 | if err != nil { 24 | return "", nil 25 | } 26 | } 27 | for _, ifs := range interfaces { 28 | if len(ifs.HardwareAddr) >= 6 && (name == "" || name == ifs.Name) { 29 | return ifs.Name, ifs.HardwareAddr 30 | } 31 | } 32 | return "", nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/sql.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. 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 uuid 6 | 7 | import ( 8 | "database/sql/driver" 9 | "fmt" 10 | ) 11 | 12 | // Scan implements sql.Scanner so UUIDs can be read from databases transparently. 13 | // Currently, database types that map to string and []byte are supported. Please 14 | // consult database-specific driver documentation for matching types. 15 | func (uuid *UUID) Scan(src interface{}) error { 16 | switch src := src.(type) { 17 | case nil: 18 | return nil 19 | 20 | case string: 21 | // if an empty UUID comes from a table, we return a null UUID 22 | if src == "" { 23 | return nil 24 | } 25 | 26 | // see Parse for required string format 27 | u, err := Parse(src) 28 | if err != nil { 29 | return fmt.Errorf("Scan: %v", err) 30 | } 31 | 32 | *uuid = u 33 | 34 | case []byte: 35 | // if an empty UUID comes from a table, we return a null UUID 36 | if len(src) == 0 { 37 | return nil 38 | } 39 | 40 | // assumes a simple slice of bytes if 16 bytes 41 | // otherwise attempts to parse 42 | if len(src) != 16 { 43 | return uuid.Scan(string(src)) 44 | } 45 | copy((*uuid)[:], src) 46 | 47 | default: 48 | return fmt.Errorf("Scan: unable to scan type %T into UUID", src) 49 | } 50 | 51 | return nil 52 | } 53 | 54 | // Value implements sql.Valuer so that UUIDs can be written to databases 55 | // transparently. Currently, UUIDs map to strings. Please consult 56 | // database-specific driver documentation for matching types. 57 | func (uuid UUID) Value() (driver.Value, error) { 58 | return uuid.String(), nil 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/version1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Google Inc. 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 uuid 6 | 7 | import ( 8 | "encoding/binary" 9 | ) 10 | 11 | // NewUUID returns a Version 1 UUID based on the current NodeID and clock 12 | // sequence, and the current time. If the NodeID has not been set by SetNodeID 13 | // or SetNodeInterface then it will be set automatically. If the NodeID cannot 14 | // be set NewUUID returns nil. If clock sequence has not been set by 15 | // SetClockSequence then it will be set automatically. If GetTime fails to 16 | // return the current NewUUID returns nil and an error. 17 | // 18 | // In most cases, New should be used. 19 | func NewUUID() (UUID, error) { 20 | var uuid UUID 21 | now, seq, err := GetTime() 22 | if err != nil { 23 | return uuid, err 24 | } 25 | 26 | timeLow := uint32(now & 0xffffffff) 27 | timeMid := uint16((now >> 32) & 0xffff) 28 | timeHi := uint16((now >> 48) & 0x0fff) 29 | timeHi |= 0x1000 // Version 1 30 | 31 | binary.BigEndian.PutUint32(uuid[0:], timeLow) 32 | binary.BigEndian.PutUint16(uuid[4:], timeMid) 33 | binary.BigEndian.PutUint16(uuid[6:], timeHi) 34 | binary.BigEndian.PutUint16(uuid[8:], seq) 35 | 36 | nodeMu.Lock() 37 | if nodeID == zeroID { 38 | setNodeInterface("") 39 | } 40 | copy(uuid[10:], nodeID[:]) 41 | nodeMu.Unlock() 42 | 43 | return uuid, nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/Makefile: -------------------------------------------------------------------------------- 1 | TEST?=./... 2 | 3 | default: test 4 | 5 | # test runs the test suite and vets the code. 6 | test: generate 7 | @echo "==> Running tests..." 8 | @go list $(TEST) \ 9 | | grep -v "/vendor/" \ 10 | | xargs -n1 go test -timeout=60s -parallel=10 ${TESTARGS} 11 | 12 | # testrace runs the race checker 13 | testrace: generate 14 | @echo "==> Running tests (race)..." 15 | @go list $(TEST) \ 16 | | grep -v "/vendor/" \ 17 | | xargs -n1 go test -timeout=60s -race ${TESTARGS} 18 | 19 | # updatedeps installs all the dependencies needed to run and build. 20 | updatedeps: 21 | @sh -c "'${CURDIR}/scripts/deps.sh' '${NAME}'" 22 | 23 | # generate runs `go generate` to build the dynamically generated source files. 24 | generate: 25 | @echo "==> Generating..." 26 | @find . -type f -name '.DS_Store' -delete 27 | @go list ./... \ 28 | | grep -v "/vendor/" \ 29 | | xargs -n1 go generate 30 | 31 | .PHONY: default test testrace updatedeps generate 32 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/append.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | // Append is a helper function that will append more errors 4 | // onto an Error in order to create a larger multi-error. 5 | // 6 | // If err is not a multierror.Error, then it will be turned into 7 | // one. If any of the errs are multierr.Error, they will be flattened 8 | // one level into err. 9 | // Any nil errors within errs will be ignored. If err is nil, a new 10 | // *Error will be returned. 11 | func Append(err error, errs ...error) *Error { 12 | switch err := err.(type) { 13 | case *Error: 14 | // Typed nils can reach here, so initialize if we are nil 15 | if err == nil { 16 | err = new(Error) 17 | } 18 | 19 | // Go through each error and flatten 20 | for _, e := range errs { 21 | switch e := e.(type) { 22 | case *Error: 23 | if e != nil { 24 | err.Errors = append(err.Errors, e.Errors...) 25 | } 26 | default: 27 | if e != nil { 28 | err.Errors = append(err.Errors, e) 29 | } 30 | } 31 | } 32 | 33 | return err 34 | default: 35 | newErrs := make([]error, 0, len(errs)+1) 36 | if err != nil { 37 | newErrs = append(newErrs, err) 38 | } 39 | newErrs = append(newErrs, errs...) 40 | 41 | return Append(&Error{}, newErrs...) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/flatten.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | // Flatten flattens the given error, merging any *Errors together into 4 | // a single *Error. 5 | func Flatten(err error) error { 6 | // If it isn't an *Error, just return the error as-is 7 | if _, ok := err.(*Error); !ok { 8 | return err 9 | } 10 | 11 | // Otherwise, make the result and flatten away! 12 | flatErr := new(Error) 13 | flatten(err, flatErr) 14 | return flatErr 15 | } 16 | 17 | func flatten(err error, flatErr *Error) { 18 | switch err := err.(type) { 19 | case *Error: 20 | for _, e := range err.Errors { 21 | flatten(e, flatErr) 22 | } 23 | default: 24 | flatErr.Errors = append(flatErr.Errors, err) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/format.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // ErrorFormatFunc is a function callback that is called by Error to 9 | // turn the list of errors into a string. 10 | type ErrorFormatFunc func([]error) string 11 | 12 | // ListFormatFunc is a basic formatter that outputs the number of errors 13 | // that occurred along with a bullet point list of the errors. 14 | func ListFormatFunc(es []error) string { 15 | if len(es) == 1 { 16 | return fmt.Sprintf("1 error occurred:\n\t* %s\n\n", es[0]) 17 | } 18 | 19 | points := make([]string, len(es)) 20 | for i, err := range es { 21 | points[i] = fmt.Sprintf("* %s", err) 22 | } 23 | 24 | return fmt.Sprintf( 25 | "%d errors occurred:\n\t%s\n\n", 26 | len(es), strings.Join(points, "\n\t")) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/group.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | import "sync" 4 | 5 | // Group is a collection of goroutines which return errors that need to be 6 | // coalesced. 7 | type Group struct { 8 | mutex sync.Mutex 9 | err *Error 10 | wg sync.WaitGroup 11 | } 12 | 13 | // Go calls the given function in a new goroutine. 14 | // 15 | // If the function returns an error it is added to the group multierror which 16 | // is returned by Wait. 17 | func (g *Group) Go(f func() error) { 18 | g.wg.Add(1) 19 | 20 | go func() { 21 | defer g.wg.Done() 22 | 23 | if err := f(); err != nil { 24 | g.mutex.Lock() 25 | g.err = Append(g.err, err) 26 | g.mutex.Unlock() 27 | } 28 | }() 29 | } 30 | 31 | // Wait blocks until all function calls from the Go method have returned, then 32 | // returns the multierror. 33 | func (g *Group) Wait() *Error { 34 | g.wg.Wait() 35 | g.mutex.Lock() 36 | defer g.mutex.Unlock() 37 | return g.err 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/prefix.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/hashicorp/errwrap" 7 | ) 8 | 9 | // Prefix is a helper function that will prefix some text 10 | // to the given error. If the error is a multierror.Error, then 11 | // it will be prefixed to each wrapped error. 12 | // 13 | // This is useful to use when appending multiple multierrors 14 | // together in order to give better scoping. 15 | func Prefix(err error, prefix string) error { 16 | if err == nil { 17 | return nil 18 | } 19 | 20 | format := fmt.Sprintf("%s {{err}}", prefix) 21 | switch err := err.(type) { 22 | case *Error: 23 | // Typed nils can reach here, so initialize if we are nil 24 | if err == nil { 25 | err = new(Error) 26 | } 27 | 28 | // Wrap each of the errors 29 | for i, e := range err.Errors { 30 | err.Errors[i] = errwrap.Wrapf(format, e) 31 | } 32 | 33 | return err 34 | default: 35 | return errwrap.Wrapf(format, err) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-multierror/sort.go: -------------------------------------------------------------------------------- 1 | package multierror 2 | 3 | // Len implements sort.Interface function for length 4 | func (err Error) Len() int { 5 | return len(err.Errors) 6 | } 7 | 8 | // Swap implements sort.Interface function for swapping elements 9 | func (err Error) Swap(i, j int) { 10 | err.Errors[i], err.Errors[j] = err.Errors[j], err.Errors[i] 11 | } 12 | 13 | // Less implements sort.Interface function for determining order 14 | func (err Error) Less(i, j int) bool { 15 | return err.Errors[i].Error() < err.Errors[j].Error() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-uuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.4 7 | - 1.5 8 | - 1.6 9 | - tip 10 | 11 | script: 12 | - go test -bench . -benchmem -v ./... 13 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-uuid/README.md: -------------------------------------------------------------------------------- 1 | # uuid [![Build Status](https://travis-ci.org/hashicorp/go-uuid.svg?branch=master)](https://travis-ci.org/hashicorp/go-uuid) 2 | 3 | Generates UUID-format strings using high quality, _purely random_ bytes. It is **not** intended to be RFC compliant, merely to use a well-understood string representation of a 128-bit value. It can also parse UUID-format strings into their component bytes. 4 | 5 | Documentation 6 | ============= 7 | 8 | The full documentation is available on [Godoc](http://godoc.org/github.com/hashicorp/go-uuid). 9 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gofork/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 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gofork/encoding/asn1/README.md: -------------------------------------------------------------------------------- 1 | This is a temporary repository that will be removed when the issues below are fixed in the core golang code. 2 | 3 | ## Issues 4 | * [encoding/asn1: cannot marshal into a GeneralString](https://github.com/golang/go/issues/18832) 5 | * [encoding/asn1: cannot marshal into slice of strings and pass stringtype parameter tags to members](https://github.com/golang/go/issues/18834) -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/config/error.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "fmt" 4 | 5 | // UnsupportedDirective error. 6 | type UnsupportedDirective struct { 7 | text string 8 | } 9 | 10 | // Error implements the error interface for unsupported directives. 11 | func (e UnsupportedDirective) Error() string { 12 | return e.text 13 | } 14 | 15 | // Invalid config error. 16 | type Invalid struct { 17 | text string 18 | } 19 | 20 | // Error implements the error interface for invalid config error. 21 | func (e Invalid) Error() string { 22 | return e.text 23 | } 24 | 25 | // InvalidErrorf creates a new Invalid error. 26 | func InvalidErrorf(format string, a ...interface{}) Invalid { 27 | return Invalid{ 28 | text: fmt.Sprintf("invalid krb5 config "+format, a...), 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/crypto/etype/etype.go: -------------------------------------------------------------------------------- 1 | // Package etype provides the Kerberos Encryption Type interface 2 | package etype 3 | 4 | import "hash" 5 | 6 | // EType is the interface defining the Encryption Type. 7 | type EType interface { 8 | GetETypeID() int32 9 | GetHashID() int32 10 | GetKeyByteSize() int 11 | GetKeySeedBitLength() int 12 | GetDefaultStringToKeyParams() string 13 | StringToKey(string, salt, s2kparams string) ([]byte, error) 14 | RandomToKey(b []byte) []byte 15 | GetHMACBitLength() int 16 | GetMessageBlockByteSize() int 17 | EncryptData(key, data []byte) ([]byte, []byte, error) 18 | EncryptMessage(key, message []byte, usage uint32) ([]byte, []byte, error) 19 | DecryptData(key, data []byte) ([]byte, error) 20 | DecryptMessage(key, ciphertext []byte, usage uint32) ([]byte, error) 21 | GetCypherBlockBitLength() int 22 | GetConfounderByteSize() int 23 | DeriveKey(protocolKey, usage []byte) ([]byte, error) 24 | DeriveRandom(protocolKey, usage []byte) ([]byte, error) 25 | VerifyIntegrity(protocolKey, ct, pt []byte, usage uint32) bool 26 | GetChecksumHash(protocolKey, data []byte, usage uint32) ([]byte, error) 27 | VerifyChecksum(protocolKey, data, chksum []byte, usage uint32) bool 28 | GetHashFunc() func() hash.Hash 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/checksum.go: -------------------------------------------------------------------------------- 1 | package rfc4757 2 | 3 | import ( 4 | "bytes" 5 | "crypto/hmac" 6 | "crypto/md5" 7 | "io" 8 | ) 9 | 10 | // Checksum returns a hash of the data in accordance with RFC 4757 11 | func Checksum(key []byte, usage uint32, data []byte) ([]byte, error) { 12 | // Create hashing key 13 | s := append([]byte(`signaturekey`), byte(0x00)) //includes zero octet at end 14 | mac := hmac.New(md5.New, key) 15 | mac.Write(s) 16 | Ksign := mac.Sum(nil) 17 | 18 | // Format data 19 | tb := UsageToMSMsgType(usage) 20 | p := append(tb, data...) 21 | h := md5.New() 22 | rb := bytes.NewReader(p) 23 | _, err := io.Copy(h, rb) 24 | if err != nil { 25 | return []byte{}, err 26 | } 27 | tmp := h.Sum(nil) 28 | 29 | // Generate HMAC 30 | mac = hmac.New(md5.New, Ksign) 31 | mac.Write(tmp) 32 | return mac.Sum(nil), nil 33 | } 34 | 35 | // HMAC returns a keyed MD5 checksum of the data 36 | func HMAC(key []byte, data []byte) []byte { 37 | mac := hmac.New(md5.New, key) 38 | mac.Write(data) 39 | return mac.Sum(nil) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/keyDerivation.go: -------------------------------------------------------------------------------- 1 | package rfc4757 2 | 3 | import ( 4 | "bytes" 5 | "encoding/hex" 6 | "errors" 7 | "fmt" 8 | "io" 9 | 10 | "golang.org/x/crypto/md4" 11 | ) 12 | 13 | // StringToKey returns a key derived from the string provided according to the definition in RFC 4757. 14 | func StringToKey(secret string) ([]byte, error) { 15 | b := make([]byte, len(secret)*2, len(secret)*2) 16 | for i, r := range secret { 17 | u := fmt.Sprintf("%04x", r) 18 | c, err := hex.DecodeString(u) 19 | if err != nil { 20 | return []byte{}, errors.New("character could not be encoded") 21 | } 22 | // Swap round the two bytes to make little endian as we put into byte slice 23 | b[2*i] = c[1] 24 | b[2*i+1] = c[0] 25 | } 26 | r := bytes.NewReader(b) 27 | h := md4.New() 28 | _, err := io.Copy(h, r) 29 | if err != nil { 30 | return []byte{}, err 31 | } 32 | return h.Sum(nil), nil 33 | } 34 | 35 | func deriveKeys(key, checksum []byte, usage uint32, export bool) (k1, k2, k3 []byte) { 36 | k1 = key 37 | k2 = HMAC(k1, UsageToMSMsgType(usage)) 38 | k3 = HMAC(k2, checksum) 39 | return 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/crypto/rfc4757/msgtype.go: -------------------------------------------------------------------------------- 1 | package rfc4757 2 | 3 | import "encoding/binary" 4 | 5 | // UsageToMSMsgType converts Kerberos key usage numbers to Microsoft message type encoded as a little-endian four byte slice. 6 | func UsageToMSMsgType(usage uint32) []byte { 7 | // Translate usage numbers to the Microsoft T numbers 8 | switch usage { 9 | case 3: 10 | usage = 8 11 | case 9: 12 | usage = 8 13 | case 23: 14 | usage = 13 15 | } 16 | // Now convert to bytes 17 | tb := make([]byte, 4) // We force an int32 input so we can't go over 4 bytes 18 | binary.PutUvarint(tb, uint64(usage)) 19 | return tb 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/gssapi/README.md: -------------------------------------------------------------------------------- 1 | # Notes on GSS-API Negotiation Mechanism 2 | https://tools.ietf.org/html/rfc4178 3 | 4 | Client sends an initial negotiation message to the server which specifies the list of mechanisms 5 | the client can support in order of decreasing preference. 6 | This message is generated with the ``NewNegTokenInitKrb5`` method. 7 | The message generated by this function specifies only a kerberos v5 mechanism is supported. 8 | 9 | The RFC states that this message can optionally contain the initial mechanism token 10 | for the preferred mechanism (KRB5 in this case) of the client. The ``NewNegTokenInitKrb5`` 11 | includes this in the message. 12 | 13 | The server side responds to this message with a one of four messages: 14 | 15 | | Message Type/State | Description | 16 | |--------------------|-------------| 17 | | accept-completed | indicates that the initiator-selected mechanism was acceptable to the target, and that the security mechanism token embedded in the first negotiation message was sufficient to complete the authentication | 18 | | accept-incomplete | At least one more message is needed from the client to establish security context. | 19 | | reject | Negotiation is being terminated. | 20 | | request-mic | (this state can only be present in the first reply message from the target) indicates that the MIC token exchange is REQUIRED if per-message integrity services are available | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/gssapi/contextFlags.go: -------------------------------------------------------------------------------- 1 | package gssapi 2 | 3 | import "github.com/jcmturner/gofork/encoding/asn1" 4 | 5 | // GSS-API context flags assigned numbers. 6 | const ( 7 | ContextFlagDeleg = 1 8 | ContextFlagMutual = 2 9 | ContextFlagReplay = 4 10 | ContextFlagSequence = 8 11 | ContextFlagConf = 16 12 | ContextFlagInteg = 32 13 | ContextFlagAnon = 64 14 | ) 15 | 16 | // ContextFlags flags for GSSAPI 17 | // DEPRECATED - do not use 18 | type ContextFlags asn1.BitString 19 | 20 | // NewContextFlags creates a new ContextFlags instance 21 | // DEPRECATED - do not use 22 | func NewContextFlags() ContextFlags { 23 | var c ContextFlags 24 | c.BitLength = 32 25 | c.Bytes = make([]byte, 4) 26 | return c 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/iana/addrtype/constants.go: -------------------------------------------------------------------------------- 1 | // Package addrtype provides Address type assigned numbers. 2 | package addrtype 3 | 4 | // Address type IDs. 5 | const ( 6 | IPv4 int32 = 2 7 | Directional int32 = 3 8 | ChaosNet int32 = 5 9 | XNS int32 = 6 10 | ISO int32 = 7 11 | DECNETPhaseIV int32 = 12 12 | AppleTalkDDP int32 = 16 13 | NetBios int32 = 20 14 | IPv6 int32 = 24 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/iana/adtype/constants.go: -------------------------------------------------------------------------------- 1 | // Package adtype provides Authenticator type assigned numbers. 2 | package adtype 3 | 4 | // Authenticator type IDs. 5 | const ( 6 | ADIfRelevant int32 = 1 7 | ADIntendedForServer int32 = 2 8 | ADIntendedForApplicationClass int32 = 3 9 | ADKDCIssued int32 = 4 10 | ADAndOr int32 = 5 11 | ADMandatoryTicketExtensions int32 = 6 12 | ADInTicketExtensions int32 = 7 13 | ADMandatoryForKDC int32 = 8 14 | OSFDCE int32 = 64 15 | SESAME int32 = 65 16 | ADOSFDCEPKICertID int32 = 66 17 | ADAuthenticationStrength int32 = 70 18 | ADFXFastArmor int32 = 71 19 | ADFXFastUsed int32 = 72 20 | ADWin2KPAC int32 = 128 21 | ADEtypeNegotiation int32 = 129 22 | //Reserved values 9-63 23 | ) 24 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/iana/asnAppTag/constants.go: -------------------------------------------------------------------------------- 1 | // Package asnAppTag provides ASN1 application tag numbers. 2 | package asnAppTag 3 | 4 | // ASN1 application tag numbers. 5 | const ( 6 | Ticket = 1 7 | Authenticator = 2 8 | EncTicketPart = 3 9 | ASREQ = 10 10 | TGSREQ = 12 11 | ASREP = 11 12 | TGSREP = 13 13 | APREQ = 14 14 | APREP = 15 15 | KRBSafe = 20 16 | KRBPriv = 21 17 | KRBCred = 22 18 | EncASRepPart = 25 19 | EncTGSRepPart = 26 20 | EncAPRepPart = 27 21 | EncKrbPrivPart = 28 22 | EncKrbCredPart = 29 23 | KRBError = 30 24 | ) 25 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/iana/chksumtype/constants.go: -------------------------------------------------------------------------------- 1 | // Package chksumtype provides Kerberos 5 checksum type assigned numbers. 2 | package chksumtype 3 | 4 | // Checksum type IDs. 5 | const ( 6 | //RESERVED : 0 7 | CRC32 int32 = 1 8 | RSA_MD4 int32 = 2 9 | RSA_MD4_DES int32 = 3 10 | DES_MAC int32 = 4 11 | DES_MAC_K int32 = 5 12 | RSA_MD4_DES_K int32 = 6 13 | RSA_MD5 int32 = 7 14 | RSA_MD5_DES int32 = 8 15 | RSA_MD5_DES3 int32 = 9 16 | SHA1_ID10 int32 = 10 17 | //UNASSIGNED : 11 18 | HMAC_SHA1_DES3_KD int32 = 12 19 | HMAC_SHA1_DES3 int32 = 13 20 | SHA1_ID14 int32 = 14 21 | HMAC_SHA1_96_AES128 int32 = 15 22 | HMAC_SHA1_96_AES256 int32 = 16 23 | CMAC_CAMELLIA128 int32 = 17 24 | CMAC_CAMELLIA256 int32 = 18 25 | HMAC_SHA256_128_AES128 int32 = 19 26 | HMAC_SHA384_192_AES256 int32 = 20 27 | //UNASSIGNED : 21-32770 28 | GSSAPI int32 = 32771 29 | //UNASSIGNED : 32772-2147483647 30 | KERB_CHECKSUM_HMAC_MD5_UNSIGNED uint32 = 4294967158 // 0xFFFFFF76 documentation says this is -138 but in an unsigned int this is 4294967158 31 | KERB_CHECKSUM_HMAC_MD5 int32 = -138 32 | ) 33 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/iana/constants.go: -------------------------------------------------------------------------------- 1 | // Package iana provides Kerberos 5 assigned numbers. 2 | package iana 3 | 4 | // PVNO is the Protocol Version Number. 5 | const PVNO = 5 6 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/iana/flags/constants.go: -------------------------------------------------------------------------------- 1 | // Package flags provides Kerberos 5 flag assigned numbers. 2 | package flags 3 | 4 | // Flag values for KRB5 messages and tickets. 5 | const ( 6 | Reserved = 0 7 | Forwardable = 1 8 | Forwarded = 2 9 | Proxiable = 3 10 | Proxy = 4 11 | AllowPostDate = 5 12 | MayPostDate = 5 13 | PostDated = 6 14 | Invalid = 7 15 | Renewable = 8 16 | Initial = 9 17 | PreAuthent = 10 18 | HWAuthent = 11 19 | OptHardwareAuth = 11 20 | RequestAnonymous = 12 21 | TransitedPolicyChecked = 12 22 | OKAsDelegate = 13 23 | EncPARep = 15 24 | Canonicalize = 15 25 | DisableTransitedCheck = 26 26 | RenewableOK = 27 27 | EncTktInSkey = 28 28 | Renew = 30 29 | Validate = 31 30 | 31 | // AP Option Flags 32 | // 0 Reserved for future use. 33 | APOptionUseSessionKey = 1 34 | APOptionMutualRequired = 2 35 | // 3-31 Reserved for future use. 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/iana/msgtype/constants.go: -------------------------------------------------------------------------------- 1 | // Package msgtype provides Kerberos 5 message type assigned numbers. 2 | package msgtype 3 | 4 | // KRB message type IDs. 5 | const ( 6 | KRB_AS_REQ = 10 //Request for initial authentication 7 | KRB_AS_REP = 11 //Response to KRB_AS_REQ request 8 | KRB_TGS_REQ = 12 //Request for authentication based on TGT 9 | KRB_TGS_REP = 13 //Response to KRB_TGS_REQ request 10 | KRB_AP_REQ = 14 //Application request to server 11 | KRB_AP_REP = 15 //Response to KRB_AP_REQ_MUTUAL 12 | KRB_RESERVED16 = 16 //Reserved for user-to-user krb_tgt_request 13 | KRB_RESERVED17 = 17 //Reserved for user-to-user krb_tgt_reply 14 | KRB_SAFE = 20 // Safe (checksummed) application message 15 | KRB_PRIV = 21 // Private (encrypted) application message 16 | KRB_CRED = 22 //Private (encrypted) message to forward credentials 17 | KRB_ERROR = 30 //Error response 18 | ) 19 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/iana/nametype/constants.go: -------------------------------------------------------------------------------- 1 | // Package nametype provides Kerberos 5 principal name type numbers. 2 | package nametype 3 | 4 | // Kerberos name type IDs. 5 | const ( 6 | KRB_NT_UNKNOWN int32 = 0 //Name type not known 7 | KRB_NT_PRINCIPAL int32 = 1 //Just the name of the principal as in DCE, or for users 8 | KRB_NT_SRV_INST int32 = 2 //Service and other unique instance (krbtgt) 9 | KRB_NT_SRV_HST int32 = 3 //Service with host name as instance (telnet, rcommands) 10 | KRB_NT_SRV_XHST int32 = 4 //Service with host as remaining components 11 | KRB_NT_UID int32 = 5 //Unique ID 12 | KRB_NT_X500_PRINCIPAL int32 = 6 //Encoded X.509 Distinguished name [RFC2253] 13 | KRB_NT_SMTP_NAME int32 = 7 //Name in form of SMTP email name (e.g., user@example.com) 14 | KRB_NT_ENTERPRISE int32 = 10 //Enterprise name; may be mapped to principal name 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/kadmin/changepasswddata.go: -------------------------------------------------------------------------------- 1 | package kadmin 2 | 3 | import ( 4 | "github.com/jcmturner/gofork/encoding/asn1" 5 | "github.com/jcmturner/gokrb5/v8/types" 6 | ) 7 | 8 | // ChangePasswdData is the payload to a password change message. 9 | type ChangePasswdData struct { 10 | NewPasswd []byte `asn1:"explicit,tag:0"` 11 | TargName types.PrincipalName `asn1:"explicit,optional,tag:1"` 12 | TargRealm string `asn1:"generalstring,optional,explicit,tag:2"` 13 | } 14 | 15 | // Marshal ChangePasswdData into a byte slice. 16 | func (c *ChangePasswdData) Marshal() ([]byte, error) { 17 | b, err := asn1.Marshal(*c) 18 | if err != nil { 19 | return []byte{}, err 20 | } 21 | //b = asn1tools.AddASNAppTag(b, asnAppTag.) 22 | return b, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/messages/KRBSafe.go: -------------------------------------------------------------------------------- 1 | package messages 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | "github.com/jcmturner/gofork/encoding/asn1" 8 | "github.com/jcmturner/gokrb5/v8/iana/asnAppTag" 9 | "github.com/jcmturner/gokrb5/v8/iana/msgtype" 10 | "github.com/jcmturner/gokrb5/v8/krberror" 11 | "github.com/jcmturner/gokrb5/v8/types" 12 | ) 13 | 14 | // KRBSafe implements RFC 4120 KRB_SAFE: https://tools.ietf.org/html/rfc4120#section-5.6.1. 15 | type KRBSafe struct { 16 | PVNO int `asn1:"explicit,tag:0"` 17 | MsgType int `asn1:"explicit,tag:1"` 18 | SafeBody KRBSafeBody `asn1:"explicit,tag:2"` 19 | Cksum types.Checksum `asn1:"explicit,tag:3"` 20 | } 21 | 22 | // KRBSafeBody implements the KRB_SAFE_BODY of KRB_SAFE. 23 | type KRBSafeBody struct { 24 | UserData []byte `asn1:"explicit,tag:0"` 25 | Timestamp time.Time `asn1:"generalized,optional,explicit,tag:1"` 26 | Usec int `asn1:"optional,explicit,tag:2"` 27 | SequenceNumber int64 `asn1:"optional,explicit,tag:3"` 28 | SAddress types.HostAddress `asn1:"explicit,tag:4"` 29 | RAddress types.HostAddress `asn1:"optional,explicit,tag:5"` 30 | } 31 | 32 | // Unmarshal bytes b into the KRBSafe struct. 33 | func (s *KRBSafe) Unmarshal(b []byte) error { 34 | _, err := asn1.UnmarshalWithParams(b, s, fmt.Sprintf("application,explicit,tag:%v", asnAppTag.KRBSafe)) 35 | if err != nil { 36 | return processUnmarshalReplyError(b, err) 37 | } 38 | expectedMsgType := msgtype.KRB_SAFE 39 | if s.MsgType != expectedMsgType { 40 | return krberror.NewErrorf(krberror.KRBMsgError, "message ID does not indicate a KRB_SAFE. Expected: %v; Actual: %v", expectedMsgType, s.MsgType) 41 | } 42 | return nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/pac/client_claims.go: -------------------------------------------------------------------------------- 1 | package pac 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | 7 | "github.com/jcmturner/rpc/v2/mstypes" 8 | "github.com/jcmturner/rpc/v2/ndr" 9 | ) 10 | 11 | // Claims reference: https://msdn.microsoft.com/en-us/library/hh553895.aspx 12 | 13 | // ClientClaimsInfo implements https://msdn.microsoft.com/en-us/library/hh536365.aspx 14 | type ClientClaimsInfo struct { 15 | ClaimsSetMetadata mstypes.ClaimsSetMetadata 16 | ClaimsSet mstypes.ClaimsSet 17 | } 18 | 19 | // Unmarshal bytes into the ClientClaimsInfo struct 20 | func (k *ClientClaimsInfo) Unmarshal(b []byte) (err error) { 21 | dec := ndr.NewDecoder(bytes.NewReader(b)) 22 | m := new(mstypes.ClaimsSetMetadata) 23 | err = dec.Decode(m) 24 | if err != nil { 25 | err = fmt.Errorf("error unmarshaling ClientClaimsInfo ClaimsSetMetadata: %v", err) 26 | return 27 | } 28 | k.ClaimsSetMetadata = *m 29 | k.ClaimsSet, err = k.ClaimsSetMetadata.ClaimsSet() 30 | if err != nil { 31 | err = fmt.Errorf("error unmarshaling ClientClaimsInfo ClaimsSet: %v", err) 32 | } 33 | return 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/pac/client_info.go: -------------------------------------------------------------------------------- 1 | package pac 2 | 3 | import ( 4 | "bytes" 5 | 6 | "github.com/jcmturner/rpc/v2/mstypes" 7 | ) 8 | 9 | // ClientInfo implements https://msdn.microsoft.com/en-us/library/cc237951.aspx 10 | type ClientInfo struct { 11 | ClientID mstypes.FileTime // A FILETIME structure in little-endian format that contains the Kerberos initial ticket-granting ticket TGT authentication time 12 | NameLength uint16 // An unsigned 16-bit integer in little-endian format that specifies the length, in bytes, of the Name field. 13 | Name string // An array of 16-bit Unicode characters in little-endian format that contains the client's account name. 14 | } 15 | 16 | // Unmarshal bytes into the ClientInfo struct 17 | func (k *ClientInfo) Unmarshal(b []byte) (err error) { 18 | //The PAC_CLIENT_INFO structure is a simple structure that is not NDR-encoded. 19 | r := mstypes.NewReader(bytes.NewReader(b)) 20 | 21 | k.ClientID, err = r.FileTime() 22 | if err != nil { 23 | return 24 | } 25 | k.NameLength, err = r.Uint16() 26 | if err != nil { 27 | return 28 | } 29 | k.Name, err = r.UTF16String(int(k.NameLength)) 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/pac/device_claims.go: -------------------------------------------------------------------------------- 1 | package pac 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | 7 | "github.com/jcmturner/rpc/v2/mstypes" 8 | "github.com/jcmturner/rpc/v2/ndr" 9 | ) 10 | 11 | // Claims reference: https://msdn.microsoft.com/en-us/library/hh553895.aspx 12 | 13 | // DeviceClaimsInfo implements https://msdn.microsoft.com/en-us/library/hh554226.aspx 14 | type DeviceClaimsInfo struct { 15 | ClaimsSetMetadata mstypes.ClaimsSetMetadata 16 | ClaimsSet mstypes.ClaimsSet 17 | } 18 | 19 | // Unmarshal bytes into the ClientClaimsInfo struct 20 | func (k *DeviceClaimsInfo) Unmarshal(b []byte) (err error) { 21 | dec := ndr.NewDecoder(bytes.NewReader(b)) 22 | m := new(mstypes.ClaimsSetMetadata) 23 | err = dec.Decode(m) 24 | if err != nil { 25 | err = fmt.Errorf("error unmarshaling ClientClaimsInfo ClaimsSetMetadata: %v", err) 26 | return 27 | } 28 | k.ClaimsSetMetadata = *m 29 | k.ClaimsSet, err = k.ClaimsSetMetadata.ClaimsSet() 30 | if err != nil { 31 | err = fmt.Errorf("error unmarshaling ClientClaimsInfo ClaimsSet: %v", err) 32 | } 33 | return 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/pac/s4u_delegation_info.go: -------------------------------------------------------------------------------- 1 | package pac 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | 7 | "github.com/jcmturner/rpc/v2/mstypes" 8 | "github.com/jcmturner/rpc/v2/ndr" 9 | ) 10 | 11 | // S4UDelegationInfo implements https://msdn.microsoft.com/en-us/library/cc237944.aspx 12 | type S4UDelegationInfo struct { 13 | S4U2proxyTarget mstypes.RPCUnicodeString // The name of the principal to whom the application can forward the ticket. 14 | TransitedListSize uint32 15 | S4UTransitedServices []mstypes.RPCUnicodeString `ndr:"pointer,conformant"` // List of all services that have been delegated through by this client and subsequent services or servers.. Size is value of TransitedListSize 16 | } 17 | 18 | // Unmarshal bytes into the S4UDelegationInfo struct 19 | func (k *S4UDelegationInfo) Unmarshal(b []byte) (err error) { 20 | dec := ndr.NewDecoder(bytes.NewReader(b)) 21 | err = dec.Decode(k) 22 | if err != nil { 23 | err = fmt.Errorf("error unmarshaling S4UDelegationInfo: %v", err) 24 | } 25 | return 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/gokrb5/v8/types/KerberosFlags.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // Reference: https://www.ietf.org/rfc/rfc4120.txt 4 | // Section: 5.2.8 5 | 6 | import ( 7 | "github.com/jcmturner/gofork/encoding/asn1" 8 | ) 9 | 10 | // NewKrbFlags returns an ASN1 BitString struct of the right size for KrbFlags. 11 | func NewKrbFlags() asn1.BitString { 12 | f := asn1.BitString{} 13 | f.Bytes = make([]byte, 4) 14 | f.BitLength = len(f.Bytes) * 8 15 | return f 16 | } 17 | 18 | // SetFlags sets the flags of an ASN1 BitString. 19 | func SetFlags(f *asn1.BitString, j []int) { 20 | for _, i := range j { 21 | SetFlag(f, i) 22 | } 23 | } 24 | 25 | // SetFlag sets a flag in an ASN1 BitString. 26 | func SetFlag(f *asn1.BitString, i int) { 27 | for l := len(f.Bytes); l < 4; l++ { 28 | (*f).Bytes = append((*f).Bytes, byte(0)) 29 | (*f).BitLength = len((*f).Bytes) * 8 30 | } 31 | //Which byte? 32 | b := i / 8 33 | //Which bit in byte 34 | p := uint(7 - (i - 8*b)) 35 | (*f).Bytes[b] = (*f).Bytes[b] | (1 << p) 36 | } 37 | 38 | // UnsetFlags unsets flags in an ASN1 BitString. 39 | func UnsetFlags(f *asn1.BitString, j []int) { 40 | for _, i := range j { 41 | UnsetFlag(f, i) 42 | } 43 | } 44 | 45 | // UnsetFlag unsets a flag in an ASN1 BitString. 46 | func UnsetFlag(f *asn1.BitString, i int) { 47 | for l := len(f.Bytes); l < 4; l++ { 48 | (*f).Bytes = append((*f).Bytes, byte(0)) 49 | (*f).BitLength = len((*f).Bytes) * 8 50 | } 51 | //Which byte? 52 | b := i / 8 53 | //Which bit in byte 54 | p := uint(7 - (i - 8*b)) 55 | (*f).Bytes[b] = (*f).Bytes[b] &^ (1 << p) 56 | } 57 | 58 | // IsFlagSet tests if a flag is set in the ASN1 BitString. 59 | func IsFlagSet(f *asn1.BitString, i int) bool { 60 | //Which byte? 61 | b := i / 8 62 | //Which bit in byte 63 | p := uint(7 - (i - 8*b)) 64 | if (*f).Bytes[b]&(1<> 32 47 | ld := fp - (hd << 32) 48 | return FileTime{ 49 | LowDateTime: uint32(ld), 50 | HighDateTime: uint32(hd), 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/mstypes/group_membership.go: -------------------------------------------------------------------------------- 1 | package mstypes 2 | 3 | // GroupMembership implements https://msdn.microsoft.com/en-us/library/cc237945.aspx 4 | // RelativeID : A 32-bit unsigned integer that contains the RID of a particular group. 5 | // The possible values for the Attributes flags are identical to those specified in KERB_SID_AND_ATTRIBUTES 6 | type GroupMembership struct { 7 | RelativeID uint32 8 | Attributes uint32 9 | } 10 | 11 | // DomainGroupMembership implements https://msdn.microsoft.com/en-us/library/hh536344.aspx 12 | // DomainId: A SID structure that contains the SID for the domain.This member is used in conjunction with the GroupIds members to create group SIDs for the device. 13 | // GroupCount: A 32-bit unsigned integer that contains the number of groups within the domain to which the account belongs. 14 | // GroupIds: A pointer to a list of GROUP_MEMBERSHIP structures that contain the groups to which the account belongs in the domain. The number of groups in this list MUST be equal to GroupCount. 15 | type DomainGroupMembership struct { 16 | DomainID RPCSID `ndr:"pointer"` 17 | GroupCount uint32 18 | GroupIDs []GroupMembership `ndr:"pointer,conformant"` // Size is value of GroupCount 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/mstypes/kerb_sid_and_attributes.go: -------------------------------------------------------------------------------- 1 | package mstypes 2 | 3 | // Attributes of a security group membership and can be combined by using the bitwise OR operation. 4 | // They are used by an access check mechanism to specify whether the membership is to be used in an access check decision. 5 | const ( 6 | SEGroupMandatory = 31 7 | SEGroupEnabledByDefault = 30 8 | SEGroupEnabled = 29 9 | SEGroupOwner = 28 10 | SEGroupResource = 2 11 | //All other bits MUST be set to zero and MUST be ignored on receipt. 12 | ) 13 | 14 | // KerbSidAndAttributes implements https://msdn.microsoft.com/en-us/library/cc237947.aspx 15 | type KerbSidAndAttributes struct { 16 | SID RPCSID `ndr:"pointer"` // A pointer to an RPC_SID structure. 17 | Attributes uint32 18 | } 19 | 20 | // SetFlag sets a flag in a uint32 attribute value. 21 | func SetFlag(a *uint32, i uint) { 22 | *a = *a | (1 << (31 - i)) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/mstypes/rpc_unicode_string.go: -------------------------------------------------------------------------------- 1 | package mstypes 2 | 3 | // RPCUnicodeString implements https://msdn.microsoft.com/en-us/library/cc230365.aspx 4 | type RPCUnicodeString struct { 5 | Length uint16 // The length, in bytes, of the string pointed to by the Buffer member, not including the terminating null character if any. The length MUST be a multiple of 2. The length SHOULD equal the entire size of the Buffer, in which case there is no terminating null character. Any method that accesses this structure MUST use the Length specified instead of relying on the presence or absence of a null character. 6 | MaximumLength uint16 // The maximum size, in bytes, of the string pointed to by Buffer. The size MUST be a multiple of 2. If not, the size MUST be decremented by 1 prior to use. This value MUST not be less than Length. 7 | Value string `ndr:"pointer,conformant,varying"` 8 | } 9 | 10 | // String returns the RPCUnicodeString string value 11 | func (r *RPCUnicodeString) String() string { 12 | return r.Value 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/mstypes/sid.go: -------------------------------------------------------------------------------- 1 | package mstypes 2 | 3 | import ( 4 | "encoding/binary" 5 | "encoding/hex" 6 | "fmt" 7 | "math" 8 | "strings" 9 | ) 10 | 11 | // RPCSID implements https://msdn.microsoft.com/en-us/library/cc230364.aspx 12 | type RPCSID struct { 13 | Revision uint8 // An 8-bit unsigned integer that specifies the revision level of the SID. This value MUST be set to 0x01. 14 | SubAuthorityCount uint8 // An 8-bit unsigned integer that specifies the number of elements in the SubAuthority array. The maximum number of elements allowed is 15. 15 | IdentifierAuthority [6]byte // An RPC_SID_IDENTIFIER_AUTHORITY structure that indicates the authority under which the SID was created. It describes the entity that created the SID. The Identifier Authority value {0,0,0,0,0,5} denotes SIDs created by the NT SID authority. 16 | SubAuthority []uint32 `ndr:"conformant"` // A variable length array of unsigned 32-bit integers that uniquely identifies a principal relative to the IdentifierAuthority. Its length is determined by SubAuthorityCount. 17 | } 18 | 19 | // String returns the string representation of the RPC_SID. 20 | func (s *RPCSID) String() string { 21 | var strb strings.Builder 22 | strb.WriteString("S-1-") 23 | 24 | b := append(make([]byte, 2, 2), s.IdentifierAuthority[:]...) 25 | // For a strange reason this is read big endian: https://msdn.microsoft.com/en-us/library/dd302645.aspx 26 | i := binary.BigEndian.Uint64(b) 27 | if i > math.MaxUint32 { 28 | fmt.Fprintf(&strb, "0x%s", hex.EncodeToString(s.IdentifierAuthority[:])) 29 | } else { 30 | fmt.Fprintf(&strb, "%d", i) 31 | } 32 | for _, sub := range s.SubAuthority { 33 | fmt.Fprintf(&strb, "-%d", sub) 34 | } 35 | return strb.String() 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/mstypes/user_session_key.go: -------------------------------------------------------------------------------- 1 | package mstypes 2 | 3 | // CypherBlock implements https://msdn.microsoft.com/en-us/library/cc237040.aspx 4 | type CypherBlock struct { 5 | Data [8]byte // size = 8 6 | } 7 | 8 | // UserSessionKey implements https://msdn.microsoft.com/en-us/library/cc237080.aspx 9 | type UserSessionKey struct { 10 | CypherBlock [2]CypherBlock // size = 2 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/ndr/error.go: -------------------------------------------------------------------------------- 1 | package ndr 2 | 3 | import "fmt" 4 | 5 | // Malformed implements the error interface for malformed NDR encoding errors. 6 | type Malformed struct { 7 | EText string 8 | } 9 | 10 | // Error implements the error interface on the Malformed struct. 11 | func (e Malformed) Error() string { 12 | return fmt.Sprintf("malformed NDR stream: %s", e.EText) 13 | } 14 | 15 | // Errorf formats an error message into a malformed NDR error. 16 | func Errorf(format string, a ...interface{}) Malformed { 17 | return Malformed{EText: fmt.Sprintf(format, a...)} 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/ndr/pipe.go: -------------------------------------------------------------------------------- 1 | package ndr 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | ) 7 | 8 | func (dec *Decoder) fillPipe(v reflect.Value, tag reflect.StructTag) error { 9 | s, err := dec.readUint32() // read element count of first chunk 10 | if err != nil { 11 | return err 12 | } 13 | a := reflect.MakeSlice(v.Type(), 0, 0) 14 | c := reflect.MakeSlice(v.Type(), int(s), int(s)) 15 | for s != 0 { 16 | for i := 0; i < int(s); i++ { 17 | err := dec.fill(c.Index(i), tag, &[]deferedPtr{}) 18 | if err != nil { 19 | return fmt.Errorf("could not fill element %d of pipe: %v", i, err) 20 | } 21 | } 22 | s, err = dec.readUint32() // read element count of first chunk 23 | if err != nil { 24 | return err 25 | } 26 | a = reflect.AppendSlice(a, c) 27 | c = reflect.MakeSlice(v.Type(), int(s), int(s)) 28 | } 29 | v.Set(a) 30 | return nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/ndr/rawbytes.go: -------------------------------------------------------------------------------- 1 | package ndr 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "reflect" 7 | "strconv" 8 | ) 9 | 10 | // type MyBytes []byte 11 | // implement RawBytes interface 12 | 13 | const ( 14 | sizeMethod = "Size" 15 | ) 16 | 17 | // RawBytes interface should be implemented if reading just a number of bytes from the NDR stream 18 | type RawBytes interface { 19 | Size(interface{}) int 20 | } 21 | 22 | func rawBytesSize(parent reflect.Value, v reflect.Value) (int, error) { 23 | sf := v.MethodByName(sizeMethod) 24 | if !sf.IsValid() { 25 | return 0, fmt.Errorf("could not find a method called %s on the implementation of RawBytes", sizeMethod) 26 | } 27 | in := []reflect.Value{parent} 28 | f := sf.Call(in) 29 | if f[0].Kind() != reflect.Int { 30 | return 0, errors.New("the RawBytes size function did not return an integer") 31 | } 32 | return int(f[0].Int()), nil 33 | } 34 | 35 | func addSizeToTag(parent reflect.Value, v reflect.Value, tag reflect.StructTag) (reflect.StructTag, error) { 36 | size, err := rawBytesSize(parent, v) 37 | if err != nil { 38 | return tag, err 39 | } 40 | ndrTag := parseTags(tag) 41 | ndrTag.Map["size"] = strconv.Itoa(size) 42 | return ndrTag.StructTag(), nil 43 | } 44 | 45 | func (dec *Decoder) readRawBytes(v reflect.Value, tag reflect.StructTag) error { 46 | ndrTag := parseTags(tag) 47 | sizeStr, ok := ndrTag.Map["size"] 48 | if !ok { 49 | return errors.New("size tag not available") 50 | } 51 | size, err := strconv.Atoi(sizeStr) 52 | if err != nil { 53 | return fmt.Errorf("size not valid: %v", err) 54 | } 55 | b, err := dec.readBytes(size) 56 | if err != nil { 57 | return err 58 | } 59 | v.Set(reflect.ValueOf(b).Convert(v.Type())) 60 | return nil 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/ndr/strings.go: -------------------------------------------------------------------------------- 1 | package ndr 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | ) 7 | 8 | const ( 9 | subStringArrayTag = `ndr:"varying,X-subStringArray"` 10 | subStringArrayValue = "X-subStringArray" 11 | ) 12 | 13 | func uint16SliceToString(a []uint16) string { 14 | s := make([]rune, len(a), len(a)) 15 | for i := range s { 16 | s[i] = rune(a[i]) 17 | } 18 | if len(s) > 0 { 19 | // Remove any null terminator 20 | if s[len(s)-1] == rune(0) { 21 | s = s[:len(s)-1] 22 | } 23 | } 24 | return string(s) 25 | } 26 | 27 | func (dec *Decoder) readVaryingString(def *[]deferedPtr) (string, error) { 28 | a := new([]uint16) 29 | v := reflect.ValueOf(a) 30 | var t reflect.StructTag 31 | err := dec.fillUniDimensionalVaryingArray(v.Elem(), t, def) 32 | if err != nil { 33 | return "", err 34 | } 35 | s := uint16SliceToString(*a) 36 | return s, nil 37 | } 38 | 39 | func (dec *Decoder) readConformantVaryingString(def *[]deferedPtr) (string, error) { 40 | a := new([]uint16) 41 | v := reflect.ValueOf(a) 42 | var t reflect.StructTag 43 | err := dec.fillUniDimensionalConformantVaryingArray(v.Elem(), t, def) 44 | if err != nil { 45 | return "", err 46 | } 47 | s := uint16SliceToString(*a) 48 | return s, nil 49 | } 50 | 51 | func (dec *Decoder) readStringsArray(v reflect.Value, tag reflect.StructTag, def *[]deferedPtr) error { 52 | d, _ := sliceDimensions(v.Type()) 53 | ndrTag := parseTags(tag) 54 | var m []int 55 | //var ms int 56 | if ndrTag.HasValue(TagConformant) { 57 | for i := 0; i < d; i++ { 58 | m = append(m, int(dec.precedingMax())) 59 | } 60 | //common max size 61 | _ = dec.precedingMax() 62 | //ms = int(n) 63 | } 64 | tag = reflect.StructTag(subStringArrayTag) 65 | err := dec.fillVaryingArray(v, tag, def) 66 | if err != nil { 67 | return fmt.Errorf("could not read string array: %v", err) 68 | } 69 | return nil 70 | } 71 | -------------------------------------------------------------------------------- /vendor/github.com/jcmturner/rpc/v2/ndr/tags.go: -------------------------------------------------------------------------------- 1 | package ndr 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | "strings" 7 | ) 8 | 9 | const ndrNameSpace = "ndr" 10 | 11 | type tags struct { 12 | Values []string 13 | Map map[string]string 14 | } 15 | 16 | // parse the struct field tags and extract the ndr related ones. 17 | // format of tag ndr:"value,key:value1,value2" 18 | func parseTags(st reflect.StructTag) tags { 19 | s := st.Get(ndrNameSpace) 20 | t := tags{ 21 | Values: []string{}, 22 | Map: make(map[string]string), 23 | } 24 | if s != "" { 25 | ndrTags := strings.Trim(s, `"`) 26 | for _, tag := range strings.Split(ndrTags, ",") { 27 | if strings.Contains(tag, ":") { 28 | m := strings.SplitN(tag, ":", 2) 29 | t.Map[m[0]] = m[1] 30 | } else { 31 | t.Values = append(t.Values, tag) 32 | } 33 | } 34 | } 35 | return t 36 | } 37 | 38 | func appendTag(t reflect.StructTag, s string) reflect.StructTag { 39 | ts := t.Get(ndrNameSpace) 40 | ts = fmt.Sprintf(`%s"%s,%s"`, ndrNameSpace, ts, s) 41 | return reflect.StructTag(ts) 42 | } 43 | 44 | func (t *tags) StructTag() reflect.StructTag { 45 | mv := t.Values 46 | for key, val := range t.Map { 47 | mv = append(mv, key+":"+val) 48 | } 49 | s := ndrNameSpace + ":" + `"` + strings.Join(mv, ",") + `"` 50 | return reflect.StructTag(s) 51 | } 52 | 53 | func (t *tags) delete(s string) { 54 | for i, x := range t.Values { 55 | if x == s { 56 | t.Values = append(t.Values[:i], t.Values[i+1:]...) 57 | } 58 | } 59 | delete(t.Map, s) 60 | } 61 | 62 | func (t *tags) HasValue(s string) bool { 63 | for _, v := range t.Values { 64 | if v == s { 65 | return true 66 | } 67 | } 68 | return false 69 | } 70 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/.gitattributes: -------------------------------------------------------------------------------- 1 | * -text 2 | *.bin -text -diff 3 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/.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 | *.test 24 | *.prof 25 | /s2/cmd/_s2sx/sfx-exe 26 | 27 | # Linux perf files 28 | perf.data 29 | perf.data.old 30 | 31 | # gdb history 32 | .gdb_history 33 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/flate/matchlen_amd64.go: -------------------------------------------------------------------------------- 1 | //go:build amd64 && !appengine && !noasm && gc 2 | // +build amd64,!appengine,!noasm,gc 3 | 4 | // Copyright 2019+ Klaus Post. All rights reserved. 5 | // License information can be found in the LICENSE file. 6 | 7 | package flate 8 | 9 | // matchLen returns how many bytes match in a and b 10 | // 11 | // It assumes that: 12 | // 13 | // len(a) <= len(b) and len(a) > 0 14 | // 15 | //go:noescape 16 | func matchLen(a []byte, b []byte) int 17 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/flate/matchlen_amd64.s: -------------------------------------------------------------------------------- 1 | // Copied from S2 implementation. 2 | 3 | //go:build !appengine && !noasm && gc && !noasm 4 | 5 | #include "textflag.h" 6 | 7 | // func matchLen(a []byte, b []byte) int 8 | TEXT ·matchLen(SB), NOSPLIT, $0-56 9 | MOVQ a_base+0(FP), AX 10 | MOVQ b_base+24(FP), CX 11 | MOVQ a_len+8(FP), DX 12 | 13 | // matchLen 14 | XORL SI, SI 15 | CMPL DX, $0x08 16 | JB matchlen_match4_standalone 17 | 18 | matchlen_loopback_standalone: 19 | MOVQ (AX)(SI*1), BX 20 | XORQ (CX)(SI*1), BX 21 | JZ matchlen_loop_standalone 22 | 23 | #ifdef GOAMD64_v3 24 | TZCNTQ BX, BX 25 | #else 26 | BSFQ BX, BX 27 | #endif 28 | SHRL $0x03, BX 29 | LEAL (SI)(BX*1), SI 30 | JMP gen_match_len_end 31 | 32 | matchlen_loop_standalone: 33 | LEAL -8(DX), DX 34 | LEAL 8(SI), SI 35 | CMPL DX, $0x08 36 | JAE matchlen_loopback_standalone 37 | 38 | matchlen_match4_standalone: 39 | CMPL DX, $0x04 40 | JB matchlen_match2_standalone 41 | MOVL (AX)(SI*1), BX 42 | CMPL (CX)(SI*1), BX 43 | JNE matchlen_match2_standalone 44 | LEAL -4(DX), DX 45 | LEAL 4(SI), SI 46 | 47 | matchlen_match2_standalone: 48 | CMPL DX, $0x02 49 | JB matchlen_match1_standalone 50 | MOVW (AX)(SI*1), BX 51 | CMPW (CX)(SI*1), BX 52 | JNE matchlen_match1_standalone 53 | LEAL -2(DX), DX 54 | LEAL 2(SI), SI 55 | 56 | matchlen_match1_standalone: 57 | CMPL DX, $0x01 58 | JB gen_match_len_end 59 | MOVB (AX)(SI*1), BL 60 | CMPB (CX)(SI*1), BL 61 | JNE gen_match_len_end 62 | INCL SI 63 | 64 | gen_match_len_end: 65 | MOVQ SI, ret+48(FP) 66 | RET 67 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/flate/matchlen_generic.go: -------------------------------------------------------------------------------- 1 | //go:build !amd64 || appengine || !gc || noasm 2 | // +build !amd64 appengine !gc noasm 3 | 4 | // Copyright 2019+ Klaus Post. All rights reserved. 5 | // License information can be found in the LICENSE file. 6 | 7 | package flate 8 | 9 | import ( 10 | "encoding/binary" 11 | "math/bits" 12 | ) 13 | 14 | // matchLen returns the maximum common prefix length of a and b. 15 | // a must be the shortest of the two. 16 | func matchLen(a, b []byte) (n int) { 17 | for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] { 18 | diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b) 19 | if diff != 0 { 20 | return n + bits.TrailingZeros64(diff)>>3 21 | } 22 | n += 8 23 | } 24 | 25 | for i := range a { 26 | if a[i] != b[i] { 27 | break 28 | } 29 | n++ 30 | } 31 | return n 32 | 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/flate/regmask_amd64.go: -------------------------------------------------------------------------------- 1 | package flate 2 | 3 | const ( 4 | // Masks for shifts with register sizes of the shift value. 5 | // This can be used to work around the x86 design of shifting by mod register size. 6 | // It can be used when a variable shift is always smaller than the register size. 7 | 8 | // reg8SizeMaskX - shift value is 8 bits, shifted is X 9 | reg8SizeMask8 = 7 10 | reg8SizeMask16 = 15 11 | reg8SizeMask32 = 31 12 | reg8SizeMask64 = 63 13 | 14 | // reg16SizeMaskX - shift value is 16 bits, shifted is X 15 | reg16SizeMask8 = reg8SizeMask8 16 | reg16SizeMask16 = reg8SizeMask16 17 | reg16SizeMask32 = reg8SizeMask32 18 | reg16SizeMask64 = reg8SizeMask64 19 | 20 | // reg32SizeMaskX - shift value is 32 bits, shifted is X 21 | reg32SizeMask8 = reg8SizeMask8 22 | reg32SizeMask16 = reg8SizeMask16 23 | reg32SizeMask32 = reg8SizeMask32 24 | reg32SizeMask64 = reg8SizeMask64 25 | 26 | // reg64SizeMaskX - shift value is 64 bits, shifted is X 27 | reg64SizeMask8 = reg8SizeMask8 28 | reg64SizeMask16 = reg8SizeMask16 29 | reg64SizeMask32 = reg8SizeMask32 30 | reg64SizeMask64 = reg8SizeMask64 31 | 32 | // regSizeMaskUintX - shift value is uint, shifted is X 33 | regSizeMaskUint8 = reg8SizeMask8 34 | regSizeMaskUint16 = reg8SizeMask16 35 | regSizeMaskUint32 = reg8SizeMask32 36 | regSizeMaskUint64 = reg8SizeMask64 37 | ) 38 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/flate/regmask_other.go: -------------------------------------------------------------------------------- 1 | //go:build !amd64 2 | // +build !amd64 3 | 4 | package flate 5 | 6 | const ( 7 | // Masks for shifts with register sizes of the shift value. 8 | // This can be used to work around the x86 design of shifting by mod register size. 9 | // It can be used when a variable shift is always smaller than the register size. 10 | 11 | // reg8SizeMaskX - shift value is 8 bits, shifted is X 12 | reg8SizeMask8 = 0xff 13 | reg8SizeMask16 = 0xff 14 | reg8SizeMask32 = 0xff 15 | reg8SizeMask64 = 0xff 16 | 17 | // reg16SizeMaskX - shift value is 16 bits, shifted is X 18 | reg16SizeMask8 = 0xffff 19 | reg16SizeMask16 = 0xffff 20 | reg16SizeMask32 = 0xffff 21 | reg16SizeMask64 = 0xffff 22 | 23 | // reg32SizeMaskX - shift value is 32 bits, shifted is X 24 | reg32SizeMask8 = 0xffffffff 25 | reg32SizeMask16 = 0xffffffff 26 | reg32SizeMask32 = 0xffffffff 27 | reg32SizeMask64 = 0xffffffff 28 | 29 | // reg64SizeMaskX - shift value is 64 bits, shifted is X 30 | reg64SizeMask8 = 0xffffffffffffffff 31 | reg64SizeMask16 = 0xffffffffffffffff 32 | reg64SizeMask32 = 0xffffffffffffffff 33 | reg64SizeMask64 = 0xffffffffffffffff 34 | 35 | // regSizeMaskUintX - shift value is uint, shifted is X 36 | regSizeMaskUint8 = ^uint(0) 37 | regSizeMaskUint16 = ^uint(0) 38 | regSizeMaskUint32 = ^uint(0) 39 | regSizeMaskUint64 = ^uint(0) 40 | ) 41 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/fse/bytereader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Klaus Post. 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 | // Based on work Copyright (c) 2013, Yann Collet, released under BSD License. 5 | 6 | package fse 7 | 8 | // byteReader provides a byte reader that reads 9 | // little endian values from a byte stream. 10 | // The input stream is manually advanced. 11 | // The reader performs no bounds checks. 12 | type byteReader struct { 13 | b []byte 14 | off int 15 | } 16 | 17 | // init will initialize the reader and set the input. 18 | func (b *byteReader) init(in []byte) { 19 | b.b = in 20 | b.off = 0 21 | } 22 | 23 | // advance the stream b n bytes. 24 | func (b *byteReader) advance(n uint) { 25 | b.off += int(n) 26 | } 27 | 28 | // Uint32 returns a little endian uint32 starting at current offset. 29 | func (b byteReader) Uint32() uint32 { 30 | b2 := b.b[b.off:] 31 | b2 = b2[:4] 32 | v3 := uint32(b2[3]) 33 | v2 := uint32(b2[2]) 34 | v1 := uint32(b2[1]) 35 | v0 := uint32(b2[0]) 36 | return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) 37 | } 38 | 39 | // unread returns the unread portion of the input. 40 | func (b byteReader) unread() []byte { 41 | return b.b[b.off:] 42 | } 43 | 44 | // remain will return the number of bytes remaining. 45 | func (b byteReader) remain() int { 46 | return len(b.b) - b.off 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cd s2/cmd/_s2sx/ || exit 1 4 | go generate . 5 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/huff0/.gitignore: -------------------------------------------------------------------------------- 1 | /huff0-fuzz.zip 2 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go: -------------------------------------------------------------------------------- 1 | // Package cpuinfo gives runtime info about the current CPU. 2 | // 3 | // This is a very limited module meant for use internally 4 | // in this project. For more versatile solution check 5 | // https://github.com/klauspost/cpuid. 6 | package cpuinfo 7 | 8 | // HasBMI1 checks whether an x86 CPU supports the BMI1 extension. 9 | func HasBMI1() bool { 10 | return hasBMI1 11 | } 12 | 13 | // HasBMI2 checks whether an x86 CPU supports the BMI2 extension. 14 | func HasBMI2() bool { 15 | return hasBMI2 16 | } 17 | 18 | // DisableBMI2 will disable BMI2, for testing purposes. 19 | // Call returned function to restore previous state. 20 | func DisableBMI2() func() { 21 | old := hasBMI2 22 | hasBMI2 = false 23 | return func() { 24 | hasBMI2 = old 25 | } 26 | } 27 | 28 | // HasBMI checks whether an x86 CPU supports both BMI1 and BMI2 extensions. 29 | func HasBMI() bool { 30 | return HasBMI1() && HasBMI2() 31 | } 32 | 33 | var hasBMI1 bool 34 | var hasBMI2 bool 35 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go: -------------------------------------------------------------------------------- 1 | //go:build amd64 && !appengine && !noasm && gc 2 | // +build amd64,!appengine,!noasm,gc 3 | 4 | package cpuinfo 5 | 6 | // go:noescape 7 | func x86extensions() (bmi1, bmi2 bool) 8 | 9 | func init() { 10 | hasBMI1, hasBMI2 = x86extensions() 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | // +build gc 3 | // +build !noasm 4 | 5 | #include "textflag.h" 6 | #include "funcdata.h" 7 | #include "go_asm.h" 8 | 9 | TEXT ·x86extensions(SB), NOSPLIT, $0 10 | // 1. determine max EAX value 11 | XORQ AX, AX 12 | CPUID 13 | 14 | CMPQ AX, $7 15 | JB unsupported 16 | 17 | // 2. EAX = 7, ECX = 0 --- see Table 3-8 "Information Returned by CPUID Instruction" 18 | MOVQ $7, AX 19 | MOVQ $0, CX 20 | CPUID 21 | 22 | BTQ $3, BX // bit 3 = BMI1 23 | SETCS AL 24 | 25 | BTQ $8, BX // bit 8 = BMI2 26 | SETCS AH 27 | 28 | MOVB AL, bmi1+0(FP) 29 | MOVB AH, bmi2+1(FP) 30 | RET 31 | 32 | unsupported: 33 | XORQ AX, AX 34 | MOVB AL, bmi1+0(FP) 35 | MOVB AL, bmi2+1(FP) 36 | RET 37 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/internal/snapref/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 The Snappy-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 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/s2sx.mod: -------------------------------------------------------------------------------- 1 | module github.com/klauspost/compress 2 | 3 | go 1.19 4 | 5 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/s2sx.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkritiotis/go-outbox/81327d9a0b37c8572ed9ba4e4c168c7adb97a90f/vendor/github.com/klauspost/compress/s2sx.sum -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/hash.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019+ Klaus Post. All rights reserved. 2 | // License information can be found in the LICENSE file. 3 | // Based on work by Yann Collet, released under BSD License. 4 | 5 | package zstd 6 | 7 | const ( 8 | prime3bytes = 506832829 9 | prime4bytes = 2654435761 10 | prime5bytes = 889523592379 11 | prime6bytes = 227718039650203 12 | prime7bytes = 58295818150454627 13 | prime8bytes = 0xcf1bbcdcb7a56463 14 | ) 15 | 16 | // hashLen returns a hash of the lowest mls bytes of with length output bits. 17 | // mls must be >=3 and <=8. Any other value will return hash for 4 bytes. 18 | // length should always be < 32. 19 | // Preferably length and mls should be a constant for inlining. 20 | func hashLen(u uint64, length, mls uint8) uint32 { 21 | switch mls { 22 | case 3: 23 | return (uint32(u<<8) * prime3bytes) >> (32 - length) 24 | case 5: 25 | return uint32(((u << (64 - 40)) * prime5bytes) >> (64 - length)) 26 | case 6: 27 | return uint32(((u << (64 - 48)) * prime6bytes) >> (64 - length)) 28 | case 7: 29 | return uint32(((u << (64 - 56)) * prime7bytes) >> (64 - length)) 30 | case 8: 31 | return uint32((u * prime8bytes) >> (64 - length)) 32 | default: 33 | return (uint32(u) * prime4bytes) >> (32 - length) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Caleb Spare 2 | 3 | MIT License 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 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go: -------------------------------------------------------------------------------- 1 | //go:build (amd64 || arm64) && !appengine && gc && !purego && !noasm 2 | // +build amd64 arm64 3 | // +build !appengine 4 | // +build gc 5 | // +build !purego 6 | // +build !noasm 7 | 8 | package xxhash 9 | 10 | // Sum64 computes the 64-bit xxHash digest of b. 11 | // 12 | //go:noescape 13 | func Sum64(b []byte) uint64 14 | 15 | //go:noescape 16 | func writeBlocks(s *Digest, b []byte) int 17 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go: -------------------------------------------------------------------------------- 1 | package xxhash 2 | 3 | // Sum64String computes the 64-bit xxHash digest of s. 4 | func Sum64String(s string) uint64 { 5 | return Sum64([]byte(s)) 6 | } 7 | 8 | // WriteString adds more data to d. It always returns len(s), nil. 9 | func (d *Digest) WriteString(s string) (n int, err error) { 10 | return d.Write([]byte(s)) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go: -------------------------------------------------------------------------------- 1 | //go:build amd64 && !appengine && !noasm && gc 2 | // +build amd64,!appengine,!noasm,gc 3 | 4 | // Copyright 2019+ Klaus Post. All rights reserved. 5 | // License information can be found in the LICENSE file. 6 | 7 | package zstd 8 | 9 | // matchLen returns how many bytes match in a and b 10 | // 11 | // It assumes that: 12 | // 13 | // len(a) <= len(b) and len(a) > 0 14 | // 15 | //go:noescape 16 | func matchLen(a []byte, b []byte) int 17 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s: -------------------------------------------------------------------------------- 1 | // Copied from S2 implementation. 2 | 3 | //go:build !appengine && !noasm && gc && !noasm 4 | 5 | #include "textflag.h" 6 | 7 | // func matchLen(a []byte, b []byte) int 8 | TEXT ·matchLen(SB), NOSPLIT, $0-56 9 | MOVQ a_base+0(FP), AX 10 | MOVQ b_base+24(FP), CX 11 | MOVQ a_len+8(FP), DX 12 | 13 | // matchLen 14 | XORL SI, SI 15 | CMPL DX, $0x08 16 | JB matchlen_match4_standalone 17 | 18 | matchlen_loopback_standalone: 19 | MOVQ (AX)(SI*1), BX 20 | XORQ (CX)(SI*1), BX 21 | JZ matchlen_loop_standalone 22 | 23 | #ifdef GOAMD64_v3 24 | TZCNTQ BX, BX 25 | #else 26 | BSFQ BX, BX 27 | #endif 28 | SHRL $0x03, BX 29 | LEAL (SI)(BX*1), SI 30 | JMP gen_match_len_end 31 | 32 | matchlen_loop_standalone: 33 | LEAL -8(DX), DX 34 | LEAL 8(SI), SI 35 | CMPL DX, $0x08 36 | JAE matchlen_loopback_standalone 37 | 38 | matchlen_match4_standalone: 39 | CMPL DX, $0x04 40 | JB matchlen_match2_standalone 41 | MOVL (AX)(SI*1), BX 42 | CMPL (CX)(SI*1), BX 43 | JNE matchlen_match2_standalone 44 | LEAL -4(DX), DX 45 | LEAL 4(SI), SI 46 | 47 | matchlen_match2_standalone: 48 | CMPL DX, $0x02 49 | JB matchlen_match1_standalone 50 | MOVW (AX)(SI*1), BX 51 | CMPW (CX)(SI*1), BX 52 | JNE matchlen_match1_standalone 53 | LEAL -2(DX), DX 54 | LEAL 2(SI), SI 55 | 56 | matchlen_match1_standalone: 57 | CMPL DX, $0x01 58 | JB gen_match_len_end 59 | MOVB (AX)(SI*1), BL 60 | CMPB (CX)(SI*1), BL 61 | JNE gen_match_len_end 62 | INCL SI 63 | 64 | gen_match_len_end: 65 | MOVQ SI, ret+48(FP) 66 | RET 67 | -------------------------------------------------------------------------------- /vendor/github.com/klauspost/compress/zstd/matchlen_generic.go: -------------------------------------------------------------------------------- 1 | //go:build !amd64 || appengine || !gc || noasm 2 | // +build !amd64 appengine !gc noasm 3 | 4 | // Copyright 2019+ Klaus Post. All rights reserved. 5 | // License information can be found in the LICENSE file. 6 | 7 | package zstd 8 | 9 | import ( 10 | "encoding/binary" 11 | "math/bits" 12 | ) 13 | 14 | // matchLen returns the maximum common prefix length of a and b. 15 | // a must be the shortest of the two. 16 | func matchLen(a, b []byte) (n int) { 17 | for ; len(a) >= 8 && len(b) >= 8; a, b = a[8:], b[8:] { 18 | diff := binary.LittleEndian.Uint64(a) ^ binary.LittleEndian.Uint64(b) 19 | if diff != 0 { 20 | return n + bits.TrailingZeros64(diff)>>3 21 | } 22 | n += 8 23 | } 24 | 25 | for i := range a { 26 | if a[i] != b[i] { 27 | break 28 | } 29 | n++ 30 | } 31 | return n 32 | 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/macos 2 | 3 | ### macOS ### 4 | *.DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | 8 | # Icon must end with two \r 9 | Icon 10 | 11 | 12 | # Thumbnails 13 | ._* 14 | 15 | # Files that might appear in the root of a volume 16 | .DocumentRevisions-V100 17 | .fseventsd 18 | .Spotlight-V100 19 | .TemporaryItems 20 | .Trashes 21 | .VolumeIcon.icns 22 | .com.apple.timemachine.donotpresent 23 | 24 | # Directories potentially created on remote AFP share 25 | .AppleDB 26 | .AppleDesktop 27 | Network Trash Folder 28 | Temporary Items 29 | .apdisk 30 | 31 | # End of https://www.gitignore.io/api/macos 32 | 33 | cmd/*/*exe 34 | .idea 35 | 36 | fuzz/*.zip 37 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Pierre Curto 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of xxHash nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (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 | 29 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/internal/lz4block/decode_asm.go: -------------------------------------------------------------------------------- 1 | //go:build (amd64 || arm || arm64) && !appengine && gc && !noasm 2 | // +build amd64 arm arm64 3 | // +build !appengine 4 | // +build gc 5 | // +build !noasm 6 | 7 | package lz4block 8 | 9 | //go:noescape 10 | func decodeBlock(dst, src, dict []byte) int 11 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/internal/lz4errors/errors.go: -------------------------------------------------------------------------------- 1 | package lz4errors 2 | 3 | type Error string 4 | 5 | func (e Error) Error() string { return string(e) } 6 | 7 | const ( 8 | ErrInvalidSourceShortBuffer Error = "lz4: invalid source or destination buffer too short" 9 | ErrInvalidFrame Error = "lz4: bad magic number" 10 | ErrInternalUnhandledState Error = "lz4: unhandled state" 11 | ErrInvalidHeaderChecksum Error = "lz4: invalid header checksum" 12 | ErrInvalidBlockChecksum Error = "lz4: invalid block checksum" 13 | ErrInvalidFrameChecksum Error = "lz4: invalid frame checksum" 14 | ErrOptionInvalidCompressionLevel Error = "lz4: invalid compression level" 15 | ErrOptionClosedOrError Error = "lz4: cannot apply options on closed or in error object" 16 | ErrOptionInvalidBlockSize Error = "lz4: invalid block size" 17 | ErrOptionNotApplicable Error = "lz4: option not applicable" 18 | ErrWriterNotClosed Error = "lz4: writer not closed" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_arm.go: -------------------------------------------------------------------------------- 1 | // +build !noasm 2 | 3 | package xxh32 4 | 5 | // ChecksumZero returns the 32-bit hash of input. 6 | // 7 | //go:noescape 8 | func ChecksumZero(input []byte) uint32 9 | 10 | //go:noescape 11 | func update(v *[4]uint32, buf *[16]byte, input []byte) 12 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/internal/xxh32/xxh32zero_other.go: -------------------------------------------------------------------------------- 1 | // +build !arm noasm 2 | 3 | package xxh32 4 | 5 | // ChecksumZero returns the 32-bit hash of input. 6 | func ChecksumZero(input []byte) uint32 { return checksumZeroGo(input) } 7 | 8 | func update(v *[4]uint32, buf *[16]byte, input []byte) { 9 | updateGo(v, buf, input) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/v4/state_gen.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=aState -output state_gen.go"; DO NOT EDIT. 2 | 3 | package lz4 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[noState-0] 12 | _ = x[errorState-1] 13 | _ = x[newState-2] 14 | _ = x[readState-3] 15 | _ = x[writeState-4] 16 | _ = x[closedState-5] 17 | } 18 | 19 | const _aState_name = "noStateerrorStatenewStatereadStatewriteStateclosedState" 20 | 21 | var _aState_index = [...]uint8{0, 7, 17, 25, 34, 44, 55} 22 | 23 | func (i aState) String() string { 24 | if i >= aState(len(_aState_index)-1) { 25 | return "aState(" + strconv.FormatInt(int64(i), 10) + ")" 26 | } 27 | return _aState_name[_aState_index[i]:_aState_index[i+1]] 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Patrick Mezard 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | The names of its contributors may not be used to endorse or promote 14 | products derived from this software without specific prior written 15 | permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 18 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/.gitignore: -------------------------------------------------------------------------------- 1 | *.[68] 2 | *.a 3 | *.out 4 | *.swp 5 | _obj 6 | _testmain.go 7 | cmd/metrics-bench/metrics-bench 8 | cmd/metrics-example/metrics-example 9 | cmd/never-read/never-read 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.3" 5 | - "1.4" 6 | - "1.5" 7 | - "1.6" 8 | - "1.7" 9 | - "1.8" 10 | - "1.9" 11 | - "1.10" 12 | - "1.11" 13 | - "1.12" 14 | - "1.13" 15 | - "1.14" 16 | - "1.15" 17 | 18 | script: 19 | - ./validate.sh 20 | 21 | # this should give us faster builds according to 22 | # http://docs.travis-ci.com/user/migrating-from-legacy/ 23 | sudo: false 24 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Richard Crowley. 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 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following 12 | disclaimer in the documentation and/or other materials provided 13 | with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY RICHARD CROWLEY ``AS IS'' AND ANY EXPRESS 16 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL RICHARD CROWLEY OR CONTRIBUTORS BE LIABLE 19 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 25 | THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | The views and conclusions contained in the software and documentation 28 | are those of the authors and should not be interpreted as representing 29 | official policies, either expressed or implied, of Richard Crowley. 30 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/healthcheck.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | // Healthchecks hold an error value describing an arbitrary up/down status. 4 | type Healthcheck interface { 5 | Check() 6 | Error() error 7 | Healthy() 8 | Unhealthy(error) 9 | } 10 | 11 | // NewHealthcheck constructs a new Healthcheck which will use the given 12 | // function to update its status. 13 | func NewHealthcheck(f func(Healthcheck)) Healthcheck { 14 | if UseNilMetrics { 15 | return NilHealthcheck{} 16 | } 17 | return &StandardHealthcheck{nil, f} 18 | } 19 | 20 | // NilHealthcheck is a no-op. 21 | type NilHealthcheck struct{} 22 | 23 | // Check is a no-op. 24 | func (NilHealthcheck) Check() {} 25 | 26 | // Error is a no-op. 27 | func (NilHealthcheck) Error() error { return nil } 28 | 29 | // Healthy is a no-op. 30 | func (NilHealthcheck) Healthy() {} 31 | 32 | // Unhealthy is a no-op. 33 | func (NilHealthcheck) Unhealthy(error) {} 34 | 35 | // StandardHealthcheck is the standard implementation of a Healthcheck and 36 | // stores the status and a function to call to update the status. 37 | type StandardHealthcheck struct { 38 | err error 39 | f func(Healthcheck) 40 | } 41 | 42 | // Check runs the healthcheck function to update the healthcheck's status. 43 | func (h *StandardHealthcheck) Check() { 44 | h.f(h) 45 | } 46 | 47 | // Error returns the healthcheck's status, which will be nil if it is healthy. 48 | func (h *StandardHealthcheck) Error() error { 49 | return h.err 50 | } 51 | 52 | // Healthy marks the healthcheck as healthy. 53 | func (h *StandardHealthcheck) Healthy() { 54 | h.err = nil 55 | } 56 | 57 | // Unhealthy marks the healthcheck as unhealthy. The error is stored and 58 | // may be retrieved by the Error method. 59 | func (h *StandardHealthcheck) Unhealthy(err error) { 60 | h.err = err 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/json.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "encoding/json" 5 | "io" 6 | "time" 7 | ) 8 | 9 | // MarshalJSON returns a byte slice containing a JSON representation of all 10 | // the metrics in the Registry. 11 | func (r *StandardRegistry) MarshalJSON() ([]byte, error) { 12 | return json.Marshal(r.GetAll()) 13 | } 14 | 15 | // WriteJSON writes metrics from the given registry periodically to the 16 | // specified io.Writer as JSON. 17 | func WriteJSON(r Registry, d time.Duration, w io.Writer) { 18 | for _ = range time.Tick(d) { 19 | WriteJSONOnce(r, w) 20 | } 21 | } 22 | 23 | // WriteJSONOnce writes metrics from the given registry to the specified 24 | // io.Writer as JSON. 25 | func WriteJSONOnce(r Registry, w io.Writer) { 26 | json.NewEncoder(w).Encode(r) 27 | } 28 | 29 | func (p *PrefixedRegistry) MarshalJSON() ([]byte, error) { 30 | return json.Marshal(p.GetAll()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/metrics.go: -------------------------------------------------------------------------------- 1 | // Go port of Coda Hale's Metrics library 2 | // 3 | // 4 | // 5 | // Coda Hale's original work: 6 | package metrics 7 | 8 | // UseNilMetrics is checked by the constructor functions for all of the 9 | // standard metrics. If it is true, the metric returned is a stub. 10 | // 11 | // This global kill-switch helps quantify the observer effect and makes 12 | // for less cluttered pprof profiles. 13 | var UseNilMetrics bool = false 14 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_cgo.go: -------------------------------------------------------------------------------- 1 | // +build cgo 2 | // +build !appengine 3 | 4 | package metrics 5 | 6 | import "runtime" 7 | 8 | func numCgoCall() int64 { 9 | return runtime.NumCgoCall() 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return memStats.GCCPUFraction 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_no_cgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo appengine 2 | 3 | package metrics 4 | 5 | func numCgoCall() int64 { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_no_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return 0 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/validate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # check there are no formatting issues 6 | GOFMT_LINES=`gofmt -l . | wc -l | xargs` 7 | test $GOFMT_LINES -eq 0 || echo "gofmt needs to be run, ${GOFMT_LINES} files have issues" 8 | 9 | # run the tests for the root package 10 | go test -race . 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/.codeclimate.yml: -------------------------------------------------------------------------------- 1 | engines: 2 | gofmt: 3 | enabled: true 4 | golint: 5 | enabled: true 6 | govet: 7 | enabled: true 8 | 9 | exclude_patterns: 10 | - ".github/" 11 | - "vendor/" 12 | - "codegen/" 13 | - "*.yml" 14 | - ".*.yml" 15 | - "*.md" 16 | - "Gopkg.*" 17 | - "doc.go" 18 | - "type_specific_codegen_test.go" 19 | - "type_specific_codegen.go" 20 | - ".gitignore" 21 | - "LICENSE" 22 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | 7 | # Test binary, build with `go test -c` 8 | *.test 9 | 10 | # Output of the go coverage tool, specifically when used with LiteIDE 11 | *.out 12 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2014 Stretchr, Inc. 4 | Copyright (c) 2017-2018 objx contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/Taskfile.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | tasks: 4 | default: 5 | deps: [test] 6 | 7 | lint: 8 | desc: Checks code style 9 | cmds: 10 | - gofmt -d -s *.go 11 | - go vet ./... 12 | silent: true 13 | 14 | lint-fix: 15 | desc: Fixes code style 16 | cmds: 17 | - gofmt -w -s *.go 18 | 19 | test: 20 | desc: Runs go tests 21 | cmds: 22 | - go test -race ./... 23 | 24 | test-coverage: 25 | desc: Runs go tests and calculates test coverage 26 | cmds: 27 | - go test -race -coverprofile=c.out ./... 28 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/security.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | import ( 4 | "crypto/sha1" 5 | "encoding/hex" 6 | ) 7 | 8 | // HashWithKey hashes the specified string using the security key 9 | func HashWithKey(data, key string) string { 10 | d := sha1.Sum([]byte(data + ":" + key)) 11 | return hex.EncodeToString(d[:]) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/tests.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Has gets whether there is something at the specified selector 4 | // or not. 5 | // 6 | // If m is nil, Has will always return false. 7 | func (m Map) Has(selector string) bool { 8 | if m == nil { 9 | return false 10 | } 11 | return !m.Get(selector).IsNil() 12 | } 13 | 14 | // IsNil gets whether the data is nil or not. 15 | func (v *Value) IsNil() bool { 16 | return v == nil || v.data == nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. 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 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/doc.go: -------------------------------------------------------------------------------- 1 | // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. 2 | // 3 | // # Example Usage 4 | // 5 | // The following is a complete example using assert in a standard test function: 6 | // 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/assert" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // assert.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // if you assert many times, use the format below: 22 | // 23 | // import ( 24 | // "testing" 25 | // "github.com/stretchr/testify/assert" 26 | // ) 27 | // 28 | // func TestSomething(t *testing.T) { 29 | // assert := assert.New(t) 30 | // 31 | // var a string = "Hello" 32 | // var b string = "Hello" 33 | // 34 | // assert.Equal(a, b, "The two words should be the same.") 35 | // } 36 | // 37 | // # Assertions 38 | // 39 | // Assertions allow you to easily write test code, and are global funcs in the `assert` package. 40 | // All assertion functions take, as the first argument, the `*testing.T` object provided by the 41 | // testing framework. This allows the assertion funcs to write the failings and other details to 42 | // the correct place. 43 | // 44 | // Every assertion function also takes an optional string message as the final argument, 45 | // allowing custom error messages to be appended to the message the assertion method outputs. 46 | package assert 47 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs" 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go: -------------------------------------------------------------------------------- 1 | //go:build testify_yaml_custom && !testify_yaml_fail && !testify_yaml_default 2 | // +build testify_yaml_custom,!testify_yaml_fail,!testify_yaml_default 3 | 4 | // Package yaml is an implementation of YAML functions that calls a pluggable implementation. 5 | // 6 | // This implementation is selected with the testify_yaml_custom build tag. 7 | // 8 | // go test -tags testify_yaml_custom 9 | // 10 | // This implementation can be used at build time to replace the default implementation 11 | // to avoid linking with [gopkg.in/yaml.v3]. 12 | // 13 | // In your test package: 14 | // 15 | // import assertYaml "github.com/stretchr/testify/assert/yaml" 16 | // 17 | // func init() { 18 | // assertYaml.Unmarshal = func (in []byte, out interface{}) error { 19 | // // ... 20 | // return nil 21 | // } 22 | // } 23 | package yaml 24 | 25 | var Unmarshal func(in []byte, out interface{}) error 26 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go: -------------------------------------------------------------------------------- 1 | //go:build !testify_yaml_fail && !testify_yaml_custom 2 | // +build !testify_yaml_fail,!testify_yaml_custom 3 | 4 | // Package yaml is just an indirection to handle YAML deserialization. 5 | // 6 | // This package is just an indirection that allows the builder to override the 7 | // indirection with an alternative implementation of this package that uses 8 | // another implementation of YAML deserialization. This allows to not either not 9 | // use YAML deserialization at all, or to use another implementation than 10 | // [gopkg.in/yaml.v3] (for example for license compatibility reasons, see [PR #1120]). 11 | // 12 | // Alternative implementations are selected using build tags: 13 | // 14 | // - testify_yaml_fail: [Unmarshal] always fails with an error 15 | // - testify_yaml_custom: [Unmarshal] is a variable. Caller must initialize it 16 | // before calling any of [github.com/stretchr/testify/assert.YAMLEq] or 17 | // [github.com/stretchr/testify/assert.YAMLEqf]. 18 | // 19 | // Usage: 20 | // 21 | // go test -tags testify_yaml_fail 22 | // 23 | // You can check with "go list" which implementation is linked: 24 | // 25 | // go list -f '{{.Imports}}' github.com/stretchr/testify/assert/yaml 26 | // go list -tags testify_yaml_fail -f '{{.Imports}}' github.com/stretchr/testify/assert/yaml 27 | // go list -tags testify_yaml_custom -f '{{.Imports}}' github.com/stretchr/testify/assert/yaml 28 | // 29 | // [PR #1120]: https://github.com/stretchr/testify/pull/1120 30 | package yaml 31 | 32 | import goyaml "gopkg.in/yaml.v3" 33 | 34 | // Unmarshal is just a wrapper of [gopkg.in/yaml.v3.Unmarshal]. 35 | func Unmarshal(in []byte, out interface{}) error { 36 | return goyaml.Unmarshal(in, out) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go: -------------------------------------------------------------------------------- 1 | //go:build testify_yaml_fail && !testify_yaml_custom && !testify_yaml_default 2 | // +build testify_yaml_fail,!testify_yaml_custom,!testify_yaml_default 3 | 4 | // Package yaml is an implementation of YAML functions that always fail. 5 | // 6 | // This implementation can be used at build time to replace the default implementation 7 | // to avoid linking with [gopkg.in/yaml.v3]: 8 | // 9 | // go test -tags testify_yaml_fail 10 | package yaml 11 | 12 | import "errors" 13 | 14 | var errNotImplemented = errors.New("YAML functions are not available (see https://pkg.go.dev/github.com/stretchr/testify/assert/yaml)") 15 | 16 | func Unmarshal([]byte, interface{}) error { 17 | return errNotImplemented 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/mock/doc.go: -------------------------------------------------------------------------------- 1 | // Package mock provides a system by which it is possible to mock your objects 2 | // and verify calls are happening as expected. 3 | // 4 | // # Example Usage 5 | // 6 | // The mock package provides an object, Mock, that tracks activity on another object. It is usually 7 | // embedded into a test object as shown below: 8 | // 9 | // type MyTestObject struct { 10 | // // add a Mock object instance 11 | // mock.Mock 12 | // 13 | // // other fields go here as normal 14 | // } 15 | // 16 | // When implementing the methods of an interface, you wire your functions up 17 | // to call the Mock.Called(args...) method, and return the appropriate values. 18 | // 19 | // For example, to mock a method that saves the name and age of a person and returns 20 | // the year of their birth or an error, you might write this: 21 | // 22 | // func (o *MyTestObject) SavePersonDetails(firstname, lastname string, age int) (int, error) { 23 | // args := o.Called(firstname, lastname, age) 24 | // return args.Int(0), args.Error(1) 25 | // } 26 | // 27 | // The Int, Error and Bool methods are examples of strongly typed getters that take the argument 28 | // index position. Given this argument list: 29 | // 30 | // (12, true, "Something") 31 | // 32 | // You could read them out strongly typed like this: 33 | // 34 | // args.Int(0) 35 | // args.Bool(1) 36 | // args.String(2) 37 | // 38 | // For objects of your own type, use the generic Arguments.Get(index) method and make a type assertion: 39 | // 40 | // return args.Get(0).(*MyObject), args.Get(1).(*AnotherObjectOfMine) 41 | // 42 | // This may cause a panic if the object you are getting is nil (the type assertion will fail), in those 43 | // cases you should check for nil first. 44 | package mock 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 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 LLC 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 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 LLC 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/dial.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 | package proxy 6 | 7 | import ( 8 | "context" 9 | "net" 10 | ) 11 | 12 | // A ContextDialer dials using a context. 13 | type ContextDialer interface { 14 | DialContext(ctx context.Context, network, address string) (net.Conn, error) 15 | } 16 | 17 | // Dial works like DialContext on net.Dialer but using a dialer returned by FromEnvironment. 18 | // 19 | // The passed ctx is only used for returning the Conn, not the lifetime of the Conn. 20 | // 21 | // Custom dialers (registered via RegisterDialerType) that do not implement ContextDialer 22 | // can leak a goroutine for as long as it takes the underlying Dialer implementation to timeout. 23 | // 24 | // A Conn returned from a successful Dial after the context has been cancelled will be immediately closed. 25 | func Dial(ctx context.Context, network, address string) (net.Conn, error) { 26 | d := FromEnvironment() 27 | if xd, ok := d.(ContextDialer); ok { 28 | return xd.DialContext(ctx, network, address) 29 | } 30 | return dialContext(ctx, d, network, address) 31 | } 32 | 33 | // WARNING: this can leak a goroutine for as long as the underlying Dialer implementation takes to timeout 34 | // A Conn returned from a successful Dial after the context has been cancelled will be immediately closed. 35 | func dialContext(ctx context.Context, d Dialer, network, address string) (net.Conn, error) { 36 | var ( 37 | conn net.Conn 38 | done = make(chan struct{}, 1) 39 | err error 40 | ) 41 | go func() { 42 | conn, err = d.Dial(network, address) 43 | close(done) 44 | if conn != nil && ctx.Err() != nil { 45 | conn.Close() 46 | } 47 | }() 48 | select { 49 | case <-ctx.Done(): 50 | err = ctx.Err() 51 | case <-done: 52 | } 53 | return conn, err 54 | } 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/direct.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 proxy 6 | 7 | import ( 8 | "context" 9 | "net" 10 | ) 11 | 12 | type direct struct{} 13 | 14 | // Direct implements Dialer by making network connections directly using net.Dial or net.DialContext. 15 | var Direct = direct{} 16 | 17 | var ( 18 | _ Dialer = Direct 19 | _ ContextDialer = Direct 20 | ) 21 | 22 | // Dial directly invokes net.Dial with the supplied parameters. 23 | func (direct) Dial(network, addr string) (net.Conn, error) { 24 | return net.Dial(network, addr) 25 | } 26 | 27 | // DialContext instantiates a net.Dialer and invokes its DialContext receiver with the supplied parameters. 28 | func (direct) DialContext(ctx context.Context, network, addr string) (net.Conn, error) { 29 | var d net.Dialer 30 | return d.DialContext(ctx, network, addr) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/socks5.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 proxy 6 | 7 | import ( 8 | "context" 9 | "net" 10 | 11 | "golang.org/x/net/internal/socks" 12 | ) 13 | 14 | // SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given 15 | // address with an optional username and password. 16 | // See RFC 1928 and RFC 1929. 17 | func SOCKS5(network, address string, auth *Auth, forward Dialer) (Dialer, error) { 18 | d := socks.NewDialer(network, address) 19 | if forward != nil { 20 | if f, ok := forward.(ContextDialer); ok { 21 | d.ProxyDial = func(ctx context.Context, network string, address string) (net.Conn, error) { 22 | return f.DialContext(ctx, network, address) 23 | } 24 | } else { 25 | d.ProxyDial = func(ctx context.Context, network string, address string) (net.Conn, error) { 26 | return dialContext(ctx, forward, network, address) 27 | } 28 | } 29 | } 30 | if auth != nil { 31 | up := socks.UsernamePassword{ 32 | Username: auth.User, 33 | Password: auth.Password, 34 | } 35 | d.AuthMethods = []socks.AuthMethod{ 36 | socks.AuthMethodNotRequired, 37 | socks.AuthMethodUsernamePassword, 38 | } 39 | d.Authenticate = up.Authenticate 40 | } 41 | return d, nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 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 implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | --------------------------------------------------------------------------------