├── .gitignore ├── .travis.yml ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE ├── Makefile ├── README.md ├── adapter.go ├── aggregate_base.go ├── aggregate_base_test.go ├── codecov.yml ├── command_registry.go ├── distribution ├── inproc │ ├── distributor.go │ └── distributor_test.go └── kafka │ ├── consumer.go │ ├── publisher.go │ └── pubsub_test.go ├── eventhandler_base.go ├── examples ├── counter │ ├── main.go │ ├── model.go │ └── model_test.go ├── kafka │ ├── main.go │ └── model.go └── mongo-log-publish │ └── main.go ├── fault.go ├── fault_test.go ├── helpers.go ├── helpers_test.go ├── interfaces.go ├── middleware.go ├── package.go ├── registry_standard.go ├── registry_standard_test.go ├── stores ├── dynamo │ ├── store.go │ └── store_test.go ├── key-value │ ├── package.go │ └── store.go ├── memory │ ├── store.go │ └── store_test.go ├── middleware │ ├── dynamosnap │ │ ├── middleware.go │ │ └── snap_test.go │ ├── logging │ │ ├── logger_test.go │ │ └── middleware.go │ ├── memorysnap │ │ ├── middleware.go │ │ └── snap_test.go │ ├── mongosnap │ │ ├── middleware.go │ │ └── snap_test.go │ ├── publish │ │ └── middleware.go │ ├── redissnap │ │ ├── middleware.go │ │ └── snap_test.go │ └── snapbase │ │ └── middleware.go └── mongo │ ├── oplog.go │ ├── oplog_test.go │ ├── store.go │ └── store_test.go ├── teststore.go ├── teststore_test.go ├── testsupport_test.go ├── utilities ├── mapping │ └── maphooks.go └── test │ ├── accept_store.go │ ├── aggregate_tester.go │ ├── common.go │ ├── errorstore.go │ ├── handlers.go │ └── nullstore.go └── vendor ├── github.com ├── Shopify │ └── sarama │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── Makefile │ │ ├── README.md │ │ ├── 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 │ │ ├── alter_configs_request.go │ │ ├── alter_configs_response.go │ │ ├── api_versions_request.go │ │ ├── api_versions_response.go │ │ ├── async_producer.go │ │ ├── broker.go │ │ ├── client.go │ │ ├── config.go │ │ ├── config_resource_type.go │ │ ├── consumer.go │ │ ├── consumer_group_members.go │ │ ├── consumer_metadata_request.go │ │ ├── consumer_metadata_response.go │ │ ├── crc32_field.go │ │ ├── create_partitions_request.go │ │ ├── create_partitions_response.go │ │ ├── create_topics_request.go │ │ ├── create_topics_response.go │ │ ├── delete_topics_request.go │ │ ├── delete_topics_response.go │ │ ├── describe_configs_request.go │ │ ├── describe_configs_response.go │ │ ├── describe_groups_request.go │ │ ├── describe_groups_response.go │ │ ├── dev.yml │ │ ├── encoder_decoder.go │ │ ├── end_txn_request.go │ │ ├── end_txn_response.go │ │ ├── errors.go │ │ ├── fetch_request.go │ │ ├── fetch_response.go │ │ ├── heartbeat_request.go │ │ ├── heartbeat_response.go │ │ ├── init_producer_id_request.go │ │ ├── init_producer_id_response.go │ │ ├── join_group_request.go │ │ ├── join_group_response.go │ │ ├── leave_group_request.go │ │ ├── leave_group_response.go │ │ ├── length_field.go │ │ ├── list_groups_request.go │ │ ├── list_groups_response.go │ │ ├── message.go │ │ ├── message_set.go │ │ ├── metadata_request.go │ │ ├── metadata_response.go │ │ ├── metrics.go │ │ ├── mockbroker.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 │ │ ├── real_decoder.go │ │ ├── real_encoder.go │ │ ├── record.go │ │ ├── record_batch.go │ │ ├── records.go │ │ ├── request.go │ │ ├── response_header.go │ │ ├── sarama.go │ │ ├── sasl_handshake_request.go │ │ ├── sasl_handshake_response.go │ │ ├── sync_group_request.go │ │ ├── sync_group_response.go │ │ ├── sync_producer.go │ │ ├── timestamp.go │ │ ├── txn_offset_commit_request.go │ │ ├── txn_offset_commit_response.go │ │ └── utils.go ├── aws │ └── aws-sdk-go │ │ ├── LICENSE.txt │ │ ├── NOTICE.txt │ │ ├── aws │ │ ├── awserr │ │ │ ├── error.go │ │ │ └── types.go │ │ ├── awsutil │ │ │ ├── copy.go │ │ │ ├── equal.go │ │ │ ├── path_value.go │ │ │ ├── prettify.go │ │ │ └── string_value.go │ │ ├── client │ │ │ ├── client.go │ │ │ ├── default_retryer.go │ │ │ ├── logger.go │ │ │ └── metadata │ │ │ │ └── client_info.go │ │ ├── config.go │ │ ├── context.go │ │ ├── context_1_6.go │ │ ├── context_1_7.go │ │ ├── convert_types.go │ │ ├── corehandlers │ │ │ ├── handlers.go │ │ │ └── param_validator.go │ │ ├── credentials │ │ │ ├── chain_provider.go │ │ │ ├── credentials.go │ │ │ ├── ec2rolecreds │ │ │ │ └── ec2_role_provider.go │ │ │ ├── endpointcreds │ │ │ │ └── provider.go │ │ │ ├── env_provider.go │ │ │ ├── example.ini │ │ │ ├── shared_credentials_provider.go │ │ │ ├── static_provider.go │ │ │ └── stscreds │ │ │ │ └── assume_role_provider.go │ │ ├── defaults │ │ │ ├── defaults.go │ │ │ └── shared_config.go │ │ ├── doc.go │ │ ├── ec2metadata │ │ │ ├── api.go │ │ │ └── service.go │ │ ├── endpoints │ │ │ ├── decode.go │ │ │ ├── defaults.go │ │ │ ├── doc.go │ │ │ ├── endpoints.go │ │ │ ├── v3model.go │ │ │ └── v3model_codegen.go │ │ ├── errors.go │ │ ├── jsonvalue.go │ │ ├── logger.go │ │ ├── request │ │ │ ├── connection_reset_error.go │ │ │ ├── connection_reset_error_other.go │ │ │ ├── handlers.go │ │ │ ├── http_request.go │ │ │ ├── offset_reader.go │ │ │ ├── request.go │ │ │ ├── request_1_7.go │ │ │ ├── request_1_8.go │ │ │ ├── request_context.go │ │ │ ├── request_context_1_6.go │ │ │ ├── request_pagination.go │ │ │ ├── retryer.go │ │ │ ├── timeout_read_closer.go │ │ │ ├── validation.go │ │ │ └── waiter.go │ │ ├── session │ │ │ ├── doc.go │ │ │ ├── env_config.go │ │ │ ├── session.go │ │ │ └── shared_config.go │ │ ├── signer │ │ │ └── v4 │ │ │ │ ├── header_rules.go │ │ │ │ ├── options.go │ │ │ │ ├── uri_path.go │ │ │ │ └── v4.go │ │ ├── types.go │ │ ├── url.go │ │ ├── url_1_7.go │ │ └── version.go │ │ ├── internal │ │ ├── sdkrand │ │ │ └── locked_source.go │ │ └── shareddefaults │ │ │ └── shared_config.go │ │ ├── private │ │ └── protocol │ │ │ ├── idempotency.go │ │ │ ├── json │ │ │ └── jsonutil │ │ │ │ ├── build.go │ │ │ │ └── unmarshal.go │ │ │ ├── jsonrpc │ │ │ └── jsonrpc.go │ │ │ ├── jsonvalue.go │ │ │ ├── query │ │ │ ├── build.go │ │ │ ├── queryutil │ │ │ │ └── queryutil.go │ │ │ ├── unmarshal.go │ │ │ └── unmarshal_error.go │ │ │ ├── rest │ │ │ ├── build.go │ │ │ ├── payload.go │ │ │ └── unmarshal.go │ │ │ ├── unmarshal.go │ │ │ └── xml │ │ │ └── xmlutil │ │ │ ├── build.go │ │ │ ├── unmarshal.go │ │ │ └── xml_to_struct.go │ │ └── service │ │ ├── dynamodb │ │ ├── api.go │ │ ├── customizations.go │ │ ├── doc.go │ │ ├── doc_custom.go │ │ ├── dynamodbattribute │ │ │ ├── converter.go │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ ├── encode.go │ │ │ ├── field.go │ │ │ └── tag.go │ │ ├── errors.go │ │ ├── service.go │ │ └── waiters.go │ │ └── sts │ │ ├── api.go │ │ ├── customizations.go │ │ ├── doc.go │ │ ├── errors.go │ │ └── service.go ├── bsm │ └── sarama-cluster │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── Gopkg.lock │ │ ├── Gopkg.toml │ │ ├── Makefile │ │ ├── README.md │ │ ├── README.md.tpl │ │ ├── balancer.go │ │ ├── client.go │ │ ├── cluster.go │ │ ├── config.go │ │ ├── consumer.go │ │ ├── doc.go │ │ ├── offsets.go │ │ ├── partitions.go │ │ └── util.go ├── davecgh │ └── go-spew │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── eapache │ ├── go-resiliency │ │ └── breaker │ │ │ ├── README.md │ │ │ └── breaker.go │ ├── go-xerial-snappy │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── README.md │ │ └── snappy.go │ └── queue │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── README.md │ │ └── queue.go ├── gin-contrib │ └── sse │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── sse-decoder.go │ │ ├── sse-encoder.go │ │ └── writer.go ├── gin-gonic │ └── gin │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── AUTHORS.md │ │ ├── BENCHMARKS.md │ │ ├── CHANGELOG.md │ │ ├── Makefile │ │ ├── README.md │ │ ├── auth.go │ │ ├── binding │ │ ├── binding.go │ │ ├── default_validator.go │ │ ├── form.go │ │ ├── form_mapping.go │ │ ├── json.go │ │ ├── msgpack.go │ │ ├── protobuf.go │ │ └── xml.go │ │ ├── codecov.yml │ │ ├── context.go │ │ ├── context_appengine.go │ │ ├── debug.go │ │ ├── deprecated.go │ │ ├── errors.go │ │ ├── fs.go │ │ ├── gin.go │ │ ├── logger.go │ │ ├── logo.jpg │ │ ├── mode.go │ │ ├── path.go │ │ ├── recovery.go │ │ ├── render │ │ ├── data.go │ │ ├── html.go │ │ ├── json.go │ │ ├── msgpack.go │ │ ├── redirect.go │ │ ├── render.go │ │ ├── text.go │ │ ├── xml.go │ │ └── yaml.go │ │ ├── response_writer.go │ │ ├── routergroup.go │ │ ├── test_helpers.go │ │ ├── tree.go │ │ ├── utils.go │ │ └── wercker.yml ├── globalsign │ └── mgo │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── Makefile │ │ ├── README.md │ │ ├── auth.go │ │ ├── bson │ │ ├── bson.go │ │ ├── bson_corpus_spec_test_generator.go │ │ ├── compatibility.go │ │ ├── decimal.go │ │ ├── decode.go │ │ ├── encode.go │ │ └── json.go │ │ ├── bulk.go │ │ ├── changestreams.go │ │ ├── cluster.go │ │ ├── doc.go │ │ ├── gridfs.go │ │ ├── internal │ │ ├── json │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── extension.go │ │ │ ├── fold.go │ │ │ ├── indent.go │ │ │ ├── scanner.go │ │ │ ├── stream.go │ │ │ └── tags.go │ │ ├── sasl │ │ │ ├── sasl.c │ │ │ ├── sasl.go │ │ │ ├── sasl_windows.c │ │ │ ├── sasl_windows.go │ │ │ ├── sasl_windows.h │ │ │ ├── sspi_windows.c │ │ │ └── sspi_windows.h │ │ └── scram │ │ │ └── scram.go │ │ ├── log.go │ │ ├── queue.go │ │ ├── raceoff.go │ │ ├── raceon.go │ │ ├── saslimpl.go │ │ ├── saslstub.go │ │ ├── server.go │ │ ├── session.go │ │ ├── socket.go │ │ └── stats.go ├── go-ini │ └── ini │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── Makefile │ │ ├── README.md │ │ ├── README_ZH.md │ │ ├── error.go │ │ ├── file.go │ │ ├── ini.go │ │ ├── key.go │ │ ├── parser.go │ │ ├── section.go │ │ └── struct.go ├── go-redis │ └── redis │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── Makefile │ │ ├── README.md │ │ ├── cluster.go │ │ ├── cluster_commands.go │ │ ├── command.go │ │ ├── commands.go │ │ ├── doc.go │ │ ├── internal │ │ ├── consistenthash │ │ │ └── consistenthash.go │ │ ├── error.go │ │ ├── hashtag │ │ │ └── hashtag.go │ │ ├── internal.go │ │ ├── log.go │ │ ├── once.go │ │ ├── pool │ │ │ ├── conn.go │ │ │ ├── pool.go │ │ │ ├── pool_single.go │ │ │ └── pool_sticky.go │ │ ├── proto │ │ │ ├── reader.go │ │ │ ├── scan.go │ │ │ └── write_buffer.go │ │ ├── singleflight │ │ │ └── singleflight.go │ │ ├── util.go │ │ └── util │ │ │ ├── safe.go │ │ │ ├── strconv.go │ │ │ └── unsafe.go │ │ ├── iterator.go │ │ ├── options.go │ │ ├── parser.go │ │ ├── pipeline.go │ │ ├── pubsub.go │ │ ├── redis.go │ │ ├── result.go │ │ ├── ring.go │ │ ├── script.go │ │ ├── sentinel.go │ │ ├── tx.go │ │ └── universal.go ├── golang │ ├── protobuf │ │ └── proto │ │ │ ├── Makefile │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── discard.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ └── snappy │ │ ├── .gitignore │ │ ├── decode.go │ │ ├── decode_amd64.go │ │ ├── decode_amd64.s │ │ ├── decode_other.go │ │ ├── encode.go │ │ ├── encode_amd64.go │ │ ├── encode_amd64.s │ │ ├── encode_other.go │ │ └── snappy.go ├── google │ └── go-cmp │ │ └── cmp │ │ ├── cmpopts │ │ ├── equate.go │ │ ├── ignore.go │ │ ├── sort.go │ │ ├── sort_go17.go │ │ ├── sort_go18.go │ │ └── struct_filter.go │ │ ├── compare.go │ │ ├── internal │ │ ├── diff │ │ │ ├── debug_disable.go │ │ │ ├── debug_enable.go │ │ │ └── diff.go │ │ ├── function │ │ │ └── func.go │ │ └── value │ │ │ ├── format.go │ │ │ └── sort.go │ │ ├── options.go │ │ ├── path.go │ │ ├── reporter.go │ │ ├── unsafe_panic.go │ │ └── unsafe_reflect.go ├── jmespath │ └── go-jmespath │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── Makefile │ │ ├── README.md │ │ ├── api.go │ │ ├── astnodetype_string.go │ │ ├── functions.go │ │ ├── interpreter.go │ │ ├── lexer.go │ │ ├── parser.go │ │ ├── toktype_string.go │ │ └── util.go ├── mattn │ └── go-isatty │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── doc.go │ │ ├── isatty_appengine.go │ │ ├── isatty_bsd.go │ │ ├── isatty_linux.go │ │ ├── isatty_linux_ppc64x.go │ │ ├── isatty_others.go │ │ ├── isatty_solaris.go │ │ └── isatty_windows.go ├── mitchellh │ └── mapstructure │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── decode_hooks.go │ │ ├── error.go │ │ └── mapstructure.go ├── pierrec │ ├── lz4 │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── block.go │ │ ├── lz4.go │ │ ├── reader.go │ │ └── writer.go │ └── xxHash │ │ └── xxHash32 │ │ └── xxHash32.go ├── pkg │ └── errors │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── errors.go │ │ └── stack.go ├── pmezard │ └── go-difflib │ │ └── difflib │ │ └── difflib.go ├── rcrowley │ └── go-metrics │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── 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 ├── rwynn │ └── gtm │ │ ├── .gitignore │ │ ├── README.md │ │ └── gtm.go ├── satori │ └── go.uuid │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── codec.go │ │ ├── generator.go │ │ ├── sql.go │ │ └── uuid.go ├── serialx │ └── hashring │ │ ├── README.md │ │ └── hashring.go ├── sirupsen │ └── logrus │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── README.md │ │ ├── alt_exit.go │ │ ├── appveyor.yml │ │ ├── doc.go │ │ ├── entry.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── hooks.go │ │ ├── json_formatter.go │ │ ├── logger.go │ │ ├── logrus.go │ │ ├── terminal_bsd.go │ │ ├── terminal_check_appengine.go │ │ ├── terminal_check_notappengine.go │ │ ├── terminal_linux.go │ │ ├── text_formatter.go │ │ └── writer.go ├── stretchr │ └── testify │ │ └── assert │ │ ├── assertion_format.go │ │ ├── assertion_format.go.tmpl │ │ ├── assertion_forward.go │ │ ├── assertion_forward.go.tmpl │ │ ├── assertions.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ └── http_assertions.go └── ugorji │ └── go │ └── codec │ ├── 0doc.go │ ├── README.md │ ├── binc.go │ ├── cbor.go │ ├── decode.go │ ├── encode.go │ ├── fast-path.generated.go │ ├── fast-path.go.tmpl │ ├── fast-path.not.go │ ├── gen-dec-array.go.tmpl │ ├── gen-dec-map.go.tmpl │ ├── gen-helper.generated.go │ ├── gen-helper.go.tmpl │ ├── gen.generated.go │ ├── gen.go │ ├── goversion_arrayof_gte_go15.go │ ├── goversion_arrayof_lt_go15.go │ ├── goversion_makemap_gte_go19.go │ ├── goversion_makemap_lt_go19.go │ ├── goversion_unexportedembeddedptr_gte_go110.go │ ├── goversion_unexportedembeddedptr_lt_go110.go │ ├── goversion_unsupported_lt_go14.go │ ├── goversion_vendor_eq_go15.go │ ├── goversion_vendor_eq_go16.go │ ├── goversion_vendor_gte_go17.go │ ├── goversion_vendor_lt_go15.go │ ├── helper.go │ ├── helper_internal.go │ ├── helper_not_unsafe.go │ ├── helper_unsafe.go │ ├── json.go │ ├── mammoth-test.go.tmpl │ ├── mammoth2-test.go.tmpl │ ├── msgpack.go │ ├── noop.go │ ├── rpc.go │ ├── simple.go │ ├── test-cbor-goldens.json │ ├── test.py │ └── xml.go ├── golang.org └── x │ ├── crypto │ └── ssh │ │ └── terminal │ │ ├── terminal.go │ │ ├── util.go │ │ ├── util_bsd.go │ │ ├── util_linux.go │ │ ├── util_plan9.go │ │ ├── util_solaris.go │ │ └── util_windows.go │ └── sys │ ├── unix │ ├── .gitignore │ ├── README.md │ ├── affinity_linux.go │ ├── asm_darwin_386.s │ ├── asm_darwin_amd64.s │ ├── asm_darwin_arm.s │ ├── asm_darwin_arm64.s │ ├── asm_dragonfly_amd64.s │ ├── asm_freebsd_386.s │ ├── asm_freebsd_amd64.s │ ├── asm_freebsd_arm.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_mips64x.s │ ├── asm_linux_mipsx.s │ ├── asm_linux_ppc64x.s │ ├── asm_linux_s390x.s │ ├── asm_netbsd_386.s │ ├── asm_netbsd_amd64.s │ ├── asm_netbsd_arm.s │ ├── asm_openbsd_386.s │ ├── asm_openbsd_amd64.s │ ├── asm_openbsd_arm.s │ ├── asm_solaris_amd64.s │ ├── bluetooth_linux.go │ ├── cap_freebsd.go │ ├── constants.go │ ├── dev_darwin.go │ ├── dev_dragonfly.go │ ├── dev_freebsd.go │ ├── dev_linux.go │ ├── dev_netbsd.go │ ├── dev_openbsd.go │ ├── dirent.go │ ├── endian_big.go │ ├── endian_little.go │ ├── env_unix.go │ ├── errors_freebsd_386.go │ ├── errors_freebsd_amd64.go │ ├── errors_freebsd_arm.go │ ├── flock.go │ ├── flock_linux_32bit.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── mkpost.go │ ├── mksyscall.pl │ ├── mksyscall_solaris.pl │ ├── mksysctl_openbsd.pl │ ├── mksysnum_darwin.pl │ ├── mksysnum_dragonfly.pl │ ├── mksysnum_freebsd.pl │ ├── mksysnum_netbsd.pl │ ├── mksysnum_openbsd.pl │ ├── openbsd_pledge.go │ ├── pagesize_unix.go │ ├── race.go │ ├── race0.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── str.go │ ├── syscall.go │ ├── syscall_bsd.go │ ├── syscall_darwin.go │ ├── syscall_darwin_386.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm.go │ ├── syscall_darwin_arm64.go │ ├── syscall_dragonfly.go │ ├── syscall_dragonfly_amd64.go │ ├── syscall_freebsd.go │ ├── syscall_freebsd_386.go │ ├── syscall_freebsd_amd64.go │ ├── syscall_freebsd_arm.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_amd64.go │ ├── syscall_linux_amd64_gc.go │ ├── syscall_linux_arm.go │ ├── syscall_linux_arm64.go │ ├── syscall_linux_gc.go │ ├── syscall_linux_gccgo.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_mipsx.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_linux_s390x.go │ ├── syscall_linux_sparc64.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_openbsd_arm.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── timestruct.go │ ├── types_darwin.go │ ├── types_dragonfly.go │ ├── types_freebsd.go │ ├── types_netbsd.go │ ├── types_openbsd.go │ ├── types_solaris.go │ ├── zerrors_darwin_386.go │ ├── zerrors_darwin_amd64.go │ ├── zerrors_darwin_arm.go │ ├── zerrors_darwin_arm64.go │ ├── zerrors_dragonfly_amd64.go │ ├── zerrors_freebsd_386.go │ ├── zerrors_freebsd_amd64.go │ ├── zerrors_freebsd_arm.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_mips.go │ ├── zerrors_linux_mips64.go │ ├── zerrors_linux_mips64le.go │ ├── zerrors_linux_mipsle.go │ ├── zerrors_linux_ppc64.go │ ├── zerrors_linux_ppc64le.go │ ├── zerrors_linux_s390x.go │ ├── zerrors_linux_sparc64.go │ ├── zerrors_netbsd_386.go │ ├── zerrors_netbsd_amd64.go │ ├── zerrors_netbsd_arm.go │ ├── zerrors_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_openbsd_arm.go │ ├── zerrors_solaris_amd64.go │ ├── zptrace386_linux.go │ ├── zptracearm_linux.go │ ├── zptracemips_linux.go │ ├── zptracemipsle_linux.go │ ├── zsyscall_darwin_386.go │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_arm.go │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_linux_386.go │ ├── zsyscall_linux_amd64.go │ ├── zsyscall_linux_arm.go │ ├── zsyscall_linux_arm64.go │ ├── zsyscall_linux_mips.go │ ├── zsyscall_linux_mips64.go │ ├── zsyscall_linux_mips64le.go │ ├── zsyscall_linux_mipsle.go │ ├── zsyscall_linux_ppc64.go │ ├── zsyscall_linux_ppc64le.go │ ├── zsyscall_linux_s390x.go │ ├── zsyscall_linux_sparc64.go │ ├── zsyscall_netbsd_386.go │ ├── zsyscall_netbsd_amd64.go │ ├── zsyscall_netbsd_arm.go │ ├── zsyscall_openbsd_386.go │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_solaris_amd64.go │ ├── zsysctl_openbsd_386.go │ ├── zsysctl_openbsd_amd64.go │ ├── zsysctl_openbsd_arm.go │ ├── zsysnum_darwin_386.go │ ├── zsysnum_darwin_amd64.go │ ├── zsysnum_darwin_arm.go │ ├── zsysnum_darwin_arm64.go │ ├── zsysnum_dragonfly_amd64.go │ ├── zsysnum_freebsd_386.go │ ├── zsysnum_freebsd_amd64.go │ ├── zsysnum_freebsd_arm.go │ ├── zsysnum_linux_386.go │ ├── zsysnum_linux_amd64.go │ ├── zsysnum_linux_arm.go │ ├── zsysnum_linux_arm64.go │ ├── zsysnum_linux_mips.go │ ├── zsysnum_linux_mips64.go │ ├── zsysnum_linux_mips64le.go │ ├── zsysnum_linux_mipsle.go │ ├── zsysnum_linux_ppc64.go │ ├── zsysnum_linux_ppc64le.go │ ├── zsysnum_linux_s390x.go │ ├── zsysnum_linux_sparc64.go │ ├── zsysnum_netbsd_386.go │ ├── zsysnum_netbsd_amd64.go │ ├── zsysnum_netbsd_arm.go │ ├── zsysnum_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_openbsd_arm.go │ ├── ztypes_darwin_386.go │ ├── ztypes_darwin_amd64.go │ ├── ztypes_darwin_arm.go │ ├── ztypes_darwin_arm64.go │ ├── ztypes_dragonfly_amd64.go │ ├── ztypes_freebsd_386.go │ ├── ztypes_freebsd_amd64.go │ ├── ztypes_freebsd_arm.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_mips.go │ ├── ztypes_linux_mips64.go │ ├── ztypes_linux_mips64le.go │ ├── ztypes_linux_mipsle.go │ ├── ztypes_linux_ppc64.go │ ├── ztypes_linux_ppc64le.go │ ├── ztypes_linux_s390x.go │ ├── ztypes_linux_sparc64.go │ ├── ztypes_netbsd_386.go │ ├── ztypes_netbsd_amd64.go │ ├── ztypes_netbsd_arm.go │ ├── ztypes_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ ├── ztypes_openbsd_arm.go │ └── ztypes_solaris_amd64.go │ └── windows │ ├── asm_windows_386.s │ ├── asm_windows_amd64.s │ ├── dll_windows.go │ ├── env_windows.go │ ├── eventlog.go │ ├── exec_windows.go │ ├── memory_windows.go │ ├── mksyscall.go │ ├── race.go │ ├── race0.go │ ├── security_windows.go │ ├── service.go │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ └── zsyscall_windows.go └── gopkg.in ├── go-playground └── validator.v8 │ ├── .gitignore │ ├── README.md │ ├── baked_in.go │ ├── cache.go │ ├── doc.go │ ├── logo.png │ ├── regexes.go │ ├── util.go │ └── validator.go └── yaml.v2 ├── .travis.yml ├── LICENSE.libyaml ├── README.md ├── apic.go ├── decode.go ├── emitterc.go ├── encode.go ├── go.mod ├── parserc.go ├── readerc.go ├── resolve.go ├── scannerc.go ├── sorter.go ├── writerc.go ├── yaml.go ├── yamlh.go └── yamlprivateh.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore files without extensions 2 | * 3 | !*.* 4 | !*/ 5 | !Dockerfile 6 | !Makefile 7 | .vscode 8 | .DS_Store 9 | thumbs.db 10 | *.log 11 | *.out 12 | coverage*.* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2018 Steve Gray (https://blog.eventualconsistency.net) 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .DEFAULT_GOAL = full_build 2 | 3 | PACKAGES = $(shell go list ./... | grep -v /vendor/) 4 | 5 | build: 6 | @echo Building sources 7 | @go build $(PACKAGES) 8 | 9 | test: 10 | @echo Running tests 11 | @echo 'mode: atomic' > coverage.txt && go list ./... | grep -v examples | xargs -n1 -I{} sh -c 'go test -covermode=atomic -coverpkg ./... -coverprofile=coverage.tmp {} && tail -n +2 coverage.tmp >> coverage.txt' && rm coverage.tmp 12 | @go tool cover -html=coverage.txt -o=coverage.html 13 | 14 | benchmark: 15 | @echo Benchmarking 16 | @go test -bench . 17 | @cd ./stores/dynamo; go test -bench .; cd ../.. 18 | @cd ./stores/memory; go test -bench .; cd ../.. 19 | @cd ./stores/mongo; go test -bench .; cd ../.. 20 | 21 | examples: 22 | @echo Building examples 23 | @go build ./examples/.... 24 | 25 | full_build: build test benchmark examples 26 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - examples/**/* 3 | - stores/mongo/gtm/* 4 | -------------------------------------------------------------------------------- /examples/counter/model_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/go-gadgets/eventsourcing" 7 | "github.com/go-gadgets/eventsourcing/utilities/test" 8 | ) 9 | 10 | // TestAggregateIncrement checks that the model handles increment commands up to 11 | // the target. 12 | func TestAggregateIncrement(t *testing.T) { 13 | agg := &CounterAggregate{} 14 | store := test.NewNullStore() 15 | agg.Initialize("dummy-key", store, func() interface{} { return agg }) 16 | 17 | for x := 0; x < 30; x++ { 18 | errIncrement := agg.Handle(IncrementCommand{}) 19 | if errIncrement != nil { 20 | t.Error(errIncrement) 21 | return 22 | } 23 | } 24 | 25 | errLimit := agg.Handle(IncrementCommand{}) 26 | if errLimit == nil { 27 | t.Error("Should have got an error, got none") 28 | return 29 | } 30 | 31 | check, err := eventsourcing.IsDomainFault(errLimit) 32 | if !check { 33 | t.Errorf("Got incorrect error type: %v", err) 34 | } else if err.FaultCode != "limit_reached" { 35 | t.Errorf("Got incorrect fault code: %v", err.FaultCode) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /fault_test.go: -------------------------------------------------------------------------------- 1 | package eventsourcing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | // TestConcurrencyFault checks that a concurrency fault is correct. 10 | func TestConcurrencyFault(t *testing.T) { 11 | fault := NewConcurrencyFault("dummy-key", 1234) 12 | assert.Equal(t, fault.Error(), "ConcurrencyFault: dummy-key at 1234", "The ConcurrencyFault message should be correct.") 13 | isConcurrencyFault, _ := IsConcurrencyFault(fault) 14 | assert.True(t, isConcurrencyFault, "Should be a ConcurrencyFault") 15 | 16 | isDomainFault, _ := IsDomainFault(fault) 17 | assert.False(t, isDomainFault, "Should not be a DomainFault") 18 | } 19 | 20 | // TestDomainFault checks that a domain fault is correct. 21 | func TestDomainFault(t *testing.T) { 22 | fault := NewDomainFault("foo-key", "dummy-code") 23 | assert.Equal(t, fault.Error(), "DomainFault: dummy-code on foo-key", "The DomainFault message should be correct.") 24 | isConcurrencyFault, _ := IsConcurrencyFault(fault) 25 | assert.False(t, isConcurrencyFault, "Should not be a ConcurrencyFault") 26 | isDomainFault, _ := IsDomainFault(fault) 27 | assert.True(t, isDomainFault, "Should be a DomainFault") 28 | } 29 | -------------------------------------------------------------------------------- /helpers.go: -------------------------------------------------------------------------------- 1 | package eventsourcing 2 | 3 | import "strings" 4 | 5 | // Retry retries a block of code, until it hits a limit or the concurrency fault does not occur. 6 | func Retry(limit int, body func() error) error { 7 | count := 1 8 | var lastError error 9 | for { 10 | lastError = body() 11 | 12 | // Succcess? 13 | if lastError == nil { 14 | return nil 15 | } 16 | 17 | // Non-concurrency error? 18 | concErr, _ := IsConcurrencyFault(lastError) 19 | if !concErr { 20 | return lastError 21 | } 22 | 23 | // If we've hit the limit, give up. 24 | if count == limit { 25 | return lastError 26 | } 27 | 28 | count++ 29 | } 30 | } 31 | 32 | // NormalizeTypeName the event name of an event so that we remove the go-supplied package name 33 | func NormalizeTypeName(name string) string { 34 | segments := strings.Split(name, ".") 35 | return segments[len(segments)-1] 36 | } 37 | -------------------------------------------------------------------------------- /package.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package eventsourcing contains the core implementation of an event-sourcing framework 3 | written in Golang. 4 | */ 5 | package eventsourcing 6 | -------------------------------------------------------------------------------- /registry_standard_test.go: -------------------------------------------------------------------------------- 1 | package eventsourcing 2 | 3 | import "testing" 4 | import "github.com/stretchr/testify/assert" 5 | 6 | // Notes: The remainder of the testing of this registry is more than amply covered by other tests, for now. 7 | 8 | // TestRegistryStandardCreateUnmappedEvent checks that when an event is undefined, it gets summoned as 9 | // a map[string]interface{} 10 | func TestRegistryStandardCreateUnmappedEvent(t *testing.T) { 11 | registry := NewStandardEventRegistry("Testing") 12 | instance := registry.CreateEvent(EventType("Does-Not-Exist")) 13 | 14 | _, ok := instance.(map[string]interface{}) 15 | assert.True(t, ok, "The instance should a map[string]interface{}") 16 | } 17 | -------------------------------------------------------------------------------- /stores/dynamo/store_test.go: -------------------------------------------------------------------------------- 1 | package dynamo 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/aws/aws-sdk-go/aws" 7 | "github.com/aws/aws-sdk-go/aws/session" 8 | "github.com/go-gadgets/eventsourcing" 9 | "github.com/go-gadgets/eventsourcing/utilities/test" 10 | ) 11 | 12 | func provider() (eventsourcing.EventStore, func(), error) { 13 | session, errSession := session.NewSession(&aws.Config{ 14 | Endpoint: aws.String("http://localhost:8000"), 15 | Region: aws.String("ap-southeast-2"), 16 | }) 17 | if errSession != nil { 18 | return nil, nil, errSession 19 | } 20 | 21 | store, errStore := NewStoreWithSession(session, "test-store") 22 | return store, func() { 23 | // Intentiomnally blank 24 | }, errStore 25 | } 26 | 27 | // TestStoreCompliance 28 | func TestStoreCompliance(t *testing.T) { 29 | test.CheckStandardSuite(t, "DynamoDB Store", provider) 30 | } 31 | 32 | // BenchmarkIndividualCommmits tests how fast we can apply events to an aggregate 33 | func BenchmarkIndividualCommmits(b *testing.B) { 34 | test.MeasureIndividualCommits(b, provider) 35 | } 36 | 37 | // BenchmarkBulkInsertAndLoad tests how fast we can write 38 | // and then load/refresh 1000 events from an aggregate 39 | func BenchmarkBulkInsertAndLoad(b *testing.B) { 40 | test.MeasureBulkInsertAndReload(b, provider) 41 | } 42 | -------------------------------------------------------------------------------- /stores/key-value/package.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package keyvalue contains a base implementation of much of the common logic required for a 3 | scale-out tablestore implementation of an event store. Each store driver need only support 4 | four methods, which can be passed via the keyvalue.Options structure: 5 | 6 | CheckSequence // Check if a particular key/seq pair exists. 7 | FetchEvents // Fetch events forward from a particular sequence number 8 | PutEvents // Put a set of events into the store 9 | Close // Shut-down the driver 10 | 11 | By abstracting store implementations down to this API, it's assumed it will be easier to 12 | add more providers later. Specific providers that suit this model include DynamoDB, Azure 13 | Tables, MongoDB, Cassandra - but the model will work for essentially any provider that has 14 | support for a dual-part unique key (Agg ID, Sequence) and supports range scans for these. 15 | */ 16 | package keyvalue 17 | -------------------------------------------------------------------------------- /stores/memory/store_test.go: -------------------------------------------------------------------------------- 1 | package memory 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/go-gadgets/eventsourcing" 7 | "github.com/go-gadgets/eventsourcing/utilities/test" 8 | ) 9 | 10 | func provider() (eventsourcing.EventStore, func(), error) { 11 | result := NewStore() 12 | 13 | return result, func() { 14 | }, nil 15 | } 16 | 17 | // TestStoreCompliance 18 | func TestStoreCompliance(t *testing.T) { 19 | test.CheckStandardSuite(t, "In-Memory Store", provider) 20 | } 21 | 22 | // BenchmarkIndividualCommmits tests how fast we can apply events to an aggregate 23 | func BenchmarkIndividualCommmits(b *testing.B) { 24 | test.MeasureIndividualCommits(b, provider) 25 | } 26 | 27 | // BenchmarkBulkInsertAndLoad tests how fast we can write 28 | // and then load/refresh 1000 events from an aggregate 29 | func BenchmarkBulkInsertAndLoad(b *testing.B) { 30 | test.MeasureBulkInsertAndReload(b, provider) 31 | } 32 | -------------------------------------------------------------------------------- /stores/middleware/logging/logger_test.go: -------------------------------------------------------------------------------- 1 | package logging 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/go-gadgets/eventsourcing" 7 | "github.com/go-gadgets/eventsourcing/stores/memory" 8 | "github.com/go-gadgets/eventsourcing/utilities/test" 9 | ) 10 | 11 | func provider() (eventsourcing.EventStore, func(), error) { 12 | base := memory.NewStore() 13 | wrapped := eventsourcing.NewMiddlewareWrapper(base) 14 | wrapped.Use(Create()) 15 | 16 | return wrapped, func() { 17 | wrapped.Close() 18 | }, nil 19 | } 20 | 21 | // TestStoreCompliance 22 | func TestStoreCompliance(t *testing.T) { 23 | test.CheckStandardSuite(t, "Logging Middleware", provider) 24 | } 25 | 26 | // BenchmarkIndividualCommmits tests how fast we can apply events to an aggregate 27 | func BenchmarkIndividualCommmits(b *testing.B) { 28 | test.MeasureIndividualCommits(b, provider) 29 | } 30 | 31 | // BenchmarkBulkInsertAndLoad tests how fast we can write 32 | // and then load/refresh 1000 events from an aggregate 33 | func BenchmarkBulkInsertAndLoad(b *testing.B) { 34 | test.MeasureBulkInsertAndReload(b, provider) 35 | } 36 | -------------------------------------------------------------------------------- /stores/middleware/memorysnap/snap_test.go: -------------------------------------------------------------------------------- 1 | package memorysnap 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/go-gadgets/eventsourcing" 7 | "github.com/go-gadgets/eventsourcing/stores/memory" 8 | "github.com/go-gadgets/eventsourcing/utilities/test" 9 | ) 10 | 11 | func provider() (eventsourcing.EventStore, func(), error) { 12 | base := memory.NewStore() 13 | wrapped := eventsourcing.NewMiddlewareWrapper(base) 14 | wrapped.Use(Create(Parameters{ 15 | SnapInterval: 5, 16 | })) 17 | 18 | return wrapped, func() { 19 | wrapped.Close() 20 | }, nil 21 | } 22 | 23 | // TestStoreCompliance 24 | func TestStoreCompliance(t *testing.T) { 25 | test.CheckStandardSuite(t, "In-Memory Snap Middleware", provider) 26 | } 27 | 28 | // BenchmarkIndividualCommmits tests how fast we can apply events to an aggregate 29 | func BenchmarkIndividualCommmits(b *testing.B) { 30 | test.MeasureIndividualCommits(b, provider) 31 | } 32 | 33 | // BenchmarkBulkInsertAndLoad tests how fast we can write 34 | // and then load/refresh 1000 events from an aggregate 35 | func BenchmarkBulkInsertAndLoad(b *testing.B) { 36 | test.MeasureBulkInsertAndReload(b, provider) 37 | } 38 | -------------------------------------------------------------------------------- /stores/middleware/publish/middleware.go: -------------------------------------------------------------------------------- 1 | package publish 2 | 3 | import ( 4 | "github.com/go-gadgets/eventsourcing" 5 | ) 6 | 7 | // Create a new publishing middleware 8 | func Create(publisher eventsourcing.EventPublisher) (eventsourcing.CommitMiddleware, eventsourcing.RefreshMiddleware, func() error) { 9 | return func(writer eventsourcing.StoreWriterAdapter, next eventsourcing.NextHandler) error { 10 | // Get the events we're about to publish 11 | key := writer.GetKey() 12 | seq, events := writer.GetUncommittedEvents() 13 | 14 | // Run the upstream, and abort if we don't succeed. 15 | errNext := next() 16 | if errNext != nil { 17 | return errNext 18 | } 19 | 20 | // Call the publisher for each event 21 | for index, event := range events { 22 | seq := seq + int64(1+index) 23 | errPublish := publisher.Publish(key, seq, event) 24 | if errPublish != nil { 25 | return errPublish 26 | } 27 | } 28 | 29 | return nil 30 | }, func(reader eventsourcing.StoreLoaderAdapter, next eventsourcing.NextHandler) error { 31 | // Call next directly 32 | return next() 33 | }, func() error { 34 | return nil 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /stores/middleware/redissnap/snap_test.go: -------------------------------------------------------------------------------- 1 | package redissnap 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | 7 | "github.com/go-gadgets/eventsourcing" 8 | "github.com/go-gadgets/eventsourcing/stores/memory" 9 | "github.com/go-gadgets/eventsourcing/utilities/test" 10 | ) 11 | 12 | func provider() (eventsourcing.EventStore, func(), error) { 13 | base := memory.NewStore() 14 | wrapped := eventsourcing.NewMiddlewareWrapper(base) 15 | mw, err := Create(Parameters{ 16 | SnapInterval: 5, 17 | DefaultDuration: time.Hour * 24, 18 | }, "localhost:6379") 19 | if err != nil { 20 | return nil, nil, err 21 | } 22 | wrapped.Use(mw()) 23 | 24 | return wrapped, func() { 25 | wrapped.Close() 26 | }, nil 27 | } 28 | 29 | // TestStoreCompliance 30 | func TestStoreCompliance(t *testing.T) { 31 | test.CheckStandardSuite(t, "Redis Snap Middleware", provider) 32 | } 33 | 34 | // BenchmarkIndividualCommmits tests how fast we can apply events to an aggregate 35 | func BenchmarkIndividualCommmits(b *testing.B) { 36 | test.MeasureIndividualCommits(b, provider) 37 | } 38 | 39 | // BenchmarkBulkInsertAndLoad tests how fast we can write 40 | // and then load/refresh 1000 events from an aggregate 41 | func BenchmarkBulkInsertAndLoad(b *testing.B) { 42 | test.MeasureBulkInsertAndReload(b, provider) 43 | } 44 | -------------------------------------------------------------------------------- /teststore_test.go: -------------------------------------------------------------------------------- 1 | package eventsourcing 2 | -------------------------------------------------------------------------------- /utilities/mapping/maphooks.go: -------------------------------------------------------------------------------- 1 | package mapping 2 | 3 | import ( 4 | "reflect" 5 | "time" 6 | ) 7 | 8 | // MapTimeFromJSON is a decoder hook that maps time data from JSON values, avoiding the issue 9 | // of things appearing as errors/blank when dealing with native Go time types. This is based on 10 | // the code at https://github.com/mitchellh/mapstructure/issues/41 11 | func MapTimeFromJSON(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error) { 12 | if t == reflect.TypeOf(time.Time{}) && f == reflect.TypeOf("") { 13 | return time.Parse(time.RFC3339, data.(string)) 14 | } 15 | 16 | return data, nil 17 | } 18 | -------------------------------------------------------------------------------- /utilities/test/errorstore.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import "github.com/go-gadgets/eventsourcing" 4 | 5 | // The errorStore is an event store that returns a defined error each time. 6 | type errorStore struct { 7 | // errorToReturn is the error that gets returned each call 8 | errorToReturn error 9 | } 10 | 11 | // CreateErrorStore creates a store that fails every operation with an error. 12 | func CreateErrorStore(err error) eventsourcing.EventStore { 13 | return &errorStore{ 14 | errorToReturn: err, 15 | } 16 | } 17 | 18 | // Close the error-store 19 | func (store *errorStore) Close() error { 20 | return nil 21 | } 22 | 23 | // CommitEvents writes events to a backing store. However, for the errorStore we 24 | // simply return an error. 25 | func (store *errorStore) CommitEvents(adapter eventsourcing.StoreWriterAdapter) error { 26 | return store.errorToReturn 27 | } 28 | 29 | // Refresh the state of the aggregate from the store. Returns an error. 30 | func (store *errorStore) Refresh(adapter eventsourcing.StoreLoaderAdapter) error { 31 | return store.errorToReturn 32 | } 33 | -------------------------------------------------------------------------------- /utilities/test/handlers.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import "github.com/go-gadgets/eventsourcing" 4 | 5 | // LoggingHandler is a handler that tracks events into a collection 6 | // so we can see what's been sent to the handler 7 | type LoggingHandler struct { 8 | Events []eventsourcing.PublishedEvent // Published events 9 | } 10 | 11 | // CreateLoggingHandler creates a handler that can process events 12 | func CreateLoggingHandler() LoggingHandler { 13 | return LoggingHandler{ 14 | Events: make([]eventsourcing.PublishedEvent, 0), 15 | } 16 | } 17 | 18 | // Handle an event 19 | func (logger *LoggingHandler) Handle(event eventsourcing.PublishedEvent) error { 20 | logger.Events = append(logger.Events, event) 21 | return nil 22 | } 23 | -------------------------------------------------------------------------------- /utilities/test/nullstore.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import "github.com/go-gadgets/eventsourcing" 4 | 5 | // The NullStore is a simple store implementation that does nothing besides 6 | // clear the pending events on commit. Basically it's an event black-hole, 7 | // and should only be used for stateless tests. 8 | type NullStore struct { 9 | } 10 | 11 | // CommitEvents writes events to a backing store. However, for the NullStore we 12 | // simply do nothing and discard anything sent in. 13 | func (store *NullStore) CommitEvents(adapter eventsourcing.StoreWriterAdapter) error { 14 | return nil 15 | } 16 | 17 | // Close the event store 18 | func (store *NullStore) Close() error { 19 | return nil 20 | } 21 | 22 | // Refresh the state of the aggregate from the store. Does nothing and will 23 | // never change aggregate state. 24 | func (store *NullStore) Refresh(adapter eventsourcing.StoreLoaderAdapter) error { 25 | // Intentionally blank 26 | return nil 27 | } 28 | 29 | // NewNullStore creates a null-store, a store that does nothing but 30 | // accept/discard any data. 31 | func NewNullStore() eventsourcing.EventStore { 32 | return &NullStore{} 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/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 | coverage.txt 27 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.8.x 4 | - 1.9.x 5 | 6 | env: 7 | global: 8 | - KAFKA_PEERS=localhost:9091,localhost:9092,localhost:9093,localhost:9094,localhost:9095 9 | - TOXIPROXY_ADDR=http://localhost:8474 10 | - KAFKA_INSTALL_ROOT=/home/travis/kafka 11 | - KAFKA_HOSTNAME=localhost 12 | - DEBUG=true 13 | matrix: 14 | - KAFKA_VERSION=0.10.2.1 15 | - KAFKA_VERSION=0.11.0.2 16 | - KAFKA_VERSION=1.0.0 17 | 18 | before_install: 19 | - export REPOSITORY_ROOT=${TRAVIS_BUILD_DIR} 20 | - vagrant/install_cluster.sh 21 | - vagrant/boot_cluster.sh 22 | - vagrant/create_topics.sh 23 | 24 | install: make install_dependencies 25 | 26 | script: 27 | - make test 28 | - make vet 29 | - make errcheck 30 | - make fmt 31 | 32 | after_success: 33 | - bash <(curl -s https://codecov.io/bash) 34 | 35 | after_script: vagrant/halt_cluster.sh 36 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/Makefile: -------------------------------------------------------------------------------- 1 | default: fmt vet errcheck test 2 | 3 | # Taken from https://github.com/codecov/example-go#caveat-multiple-files 4 | test: 5 | echo "" > coverage.txt 6 | for d in `go list ./... | grep -v vendor`; do \ 7 | go test -v -timeout 60s -race -coverprofile=profile.out -covermode=atomic $$d; \ 8 | if [ -f profile.out ]; then \ 9 | cat profile.out >> coverage.txt; \ 10 | rm profile.out; \ 11 | fi \ 12 | done 13 | 14 | vet: 15 | go vet ./... 16 | 17 | errcheck: 18 | errcheck github.com/Shopify/sarama/... 19 | 20 | fmt: 21 | @if [ -n "$$(go fmt ./...)" ]; then echo 'Please run go fmt on your code.' && exit 1; fi 22 | 23 | install_dependencies: install_errcheck get 24 | 25 | install_errcheck: 26 | go get github.com/kisielk/errcheck 27 | 28 | get: 29 | go get -t 30 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/acl_delete_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type DeleteAclsRequest struct { 4 | Filters []*AclFilter 5 | } 6 | 7 | func (d *DeleteAclsRequest) encode(pe packetEncoder) error { 8 | if err := pe.putArrayLength(len(d.Filters)); err != nil { 9 | return err 10 | } 11 | 12 | for _, filter := range d.Filters { 13 | if err := filter.encode(pe); err != nil { 14 | return err 15 | } 16 | } 17 | 18 | return nil 19 | } 20 | 21 | func (d *DeleteAclsRequest) decode(pd packetDecoder, version int16) (err error) { 22 | n, err := pd.getArrayLength() 23 | if err != nil { 24 | return err 25 | } 26 | 27 | d.Filters = make([]*AclFilter, n) 28 | for i := 0; i < n; i++ { 29 | d.Filters[i] = new(AclFilter) 30 | if err := d.Filters[i].decode(pd, version); err != nil { 31 | return err 32 | } 33 | } 34 | 35 | return nil 36 | } 37 | 38 | func (d *DeleteAclsRequest) key() int16 { 39 | return 31 40 | } 41 | 42 | func (d *DeleteAclsRequest) version() int16 { 43 | return 0 44 | } 45 | 46 | func (d *DeleteAclsRequest) requiredVersion() KafkaVersion { 47 | return V0_11_0_0 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/acl_describe_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type DescribeAclsRequest struct { 4 | AclFilter 5 | } 6 | 7 | func (d *DescribeAclsRequest) encode(pe packetEncoder) error { 8 | return d.AclFilter.encode(pe) 9 | } 10 | 11 | func (d *DescribeAclsRequest) decode(pd packetDecoder, version int16) (err error) { 12 | return d.AclFilter.decode(pd, version) 13 | } 14 | 15 | func (d *DescribeAclsRequest) key() int16 { 16 | return 29 17 | } 18 | 19 | func (d *DescribeAclsRequest) version() int16 { 20 | return 0 21 | } 22 | 23 | func (d *DescribeAclsRequest) requiredVersion() KafkaVersion { 24 | return V0_11_0_0 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/add_offsets_to_txn_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type AddOffsetsToTxnRequest struct { 4 | TransactionalID string 5 | ProducerID int64 6 | ProducerEpoch int16 7 | GroupID string 8 | } 9 | 10 | func (a *AddOffsetsToTxnRequest) encode(pe packetEncoder) error { 11 | if err := pe.putString(a.TransactionalID); err != nil { 12 | return err 13 | } 14 | 15 | pe.putInt64(a.ProducerID) 16 | 17 | pe.putInt16(a.ProducerEpoch) 18 | 19 | if err := pe.putString(a.GroupID); err != nil { 20 | return err 21 | } 22 | 23 | return nil 24 | } 25 | 26 | func (a *AddOffsetsToTxnRequest) decode(pd packetDecoder, version int16) (err error) { 27 | if a.TransactionalID, err = pd.getString(); err != nil { 28 | return err 29 | } 30 | if a.ProducerID, err = pd.getInt64(); err != nil { 31 | return err 32 | } 33 | if a.ProducerEpoch, err = pd.getInt16(); err != nil { 34 | return err 35 | } 36 | if a.GroupID, err = pd.getString(); err != nil { 37 | return err 38 | } 39 | return nil 40 | } 41 | 42 | func (a *AddOffsetsToTxnRequest) key() int16 { 43 | return 25 44 | } 45 | 46 | func (a *AddOffsetsToTxnRequest) version() int16 { 47 | return 0 48 | } 49 | 50 | func (a *AddOffsetsToTxnRequest) requiredVersion() KafkaVersion { 51 | return V0_11_0_0 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/add_offsets_to_txn_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | type AddOffsetsToTxnResponse struct { 8 | ThrottleTime time.Duration 9 | Err KError 10 | } 11 | 12 | func (a *AddOffsetsToTxnResponse) encode(pe packetEncoder) error { 13 | pe.putInt32(int32(a.ThrottleTime / time.Millisecond)) 14 | pe.putInt16(int16(a.Err)) 15 | return nil 16 | } 17 | 18 | func (a *AddOffsetsToTxnResponse) decode(pd packetDecoder, version int16) (err error) { 19 | throttleTime, err := pd.getInt32() 20 | if err != nil { 21 | return err 22 | } 23 | a.ThrottleTime = time.Duration(throttleTime) * time.Millisecond 24 | 25 | kerr, err := pd.getInt16() 26 | if err != nil { 27 | return err 28 | } 29 | a.Err = KError(kerr) 30 | 31 | return nil 32 | } 33 | 34 | func (a *AddOffsetsToTxnResponse) key() int16 { 35 | return 25 36 | } 37 | 38 | func (a *AddOffsetsToTxnResponse) version() int16 { 39 | return 0 40 | } 41 | 42 | func (a *AddOffsetsToTxnResponse) requiredVersion() KafkaVersion { 43 | return V0_11_0_0 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/api_versions_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type ApiVersionsRequest struct { 4 | } 5 | 6 | func (r *ApiVersionsRequest) encode(pe packetEncoder) error { 7 | return nil 8 | } 9 | 10 | func (r *ApiVersionsRequest) decode(pd packetDecoder, version int16) (err error) { 11 | return nil 12 | } 13 | 14 | func (r *ApiVersionsRequest) key() int16 { 15 | return 18 16 | } 17 | 18 | func (r *ApiVersionsRequest) version() int16 { 19 | return 0 20 | } 21 | 22 | func (r *ApiVersionsRequest) requiredVersion() KafkaVersion { 23 | return V0_10_0_0 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/config_resource_type.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type ConfigResourceType int8 4 | 5 | // Taken from : 6 | // https://cwiki.apache.org/confluence/display/KAFKA/KIP-133%3A+Describe+and+Alter+Configs+Admin+APIs#KIP-133:DescribeandAlterConfigsAdminAPIs-WireFormattypes 7 | 8 | const ( 9 | UnknownResource ConfigResourceType = 0 10 | AnyResource ConfigResourceType = 1 11 | TopicResource ConfigResourceType = 2 12 | GroupResource ConfigResourceType = 3 13 | ClusterResource ConfigResourceType = 4 14 | BrokerResource ConfigResourceType = 5 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/consumer_metadata_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type ConsumerMetadataRequest struct { 4 | ConsumerGroup string 5 | } 6 | 7 | func (r *ConsumerMetadataRequest) encode(pe packetEncoder) error { 8 | return pe.putString(r.ConsumerGroup) 9 | } 10 | 11 | func (r *ConsumerMetadataRequest) decode(pd packetDecoder, version int16) (err error) { 12 | r.ConsumerGroup, err = pd.getString() 13 | return err 14 | } 15 | 16 | func (r *ConsumerMetadataRequest) key() int16 { 17 | return 10 18 | } 19 | 20 | func (r *ConsumerMetadataRequest) version() int16 { 21 | return 0 22 | } 23 | 24 | func (r *ConsumerMetadataRequest) requiredVersion() KafkaVersion { 25 | return V0_8_2_0 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/delete_topics_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import "time" 4 | 5 | type DeleteTopicsRequest struct { 6 | Topics []string 7 | Timeout time.Duration 8 | } 9 | 10 | func (d *DeleteTopicsRequest) encode(pe packetEncoder) error { 11 | if err := pe.putStringArray(d.Topics); err != nil { 12 | return err 13 | } 14 | pe.putInt32(int32(d.Timeout / time.Millisecond)) 15 | 16 | return nil 17 | } 18 | 19 | func (d *DeleteTopicsRequest) decode(pd packetDecoder, version int16) (err error) { 20 | if d.Topics, err = pd.getStringArray(); err != nil { 21 | return err 22 | } 23 | timeout, err := pd.getInt32() 24 | if err != nil { 25 | return err 26 | } 27 | d.Timeout = time.Duration(timeout) * time.Millisecond 28 | return nil 29 | } 30 | 31 | func (d *DeleteTopicsRequest) key() int16 { 32 | return 20 33 | } 34 | 35 | func (d *DeleteTopicsRequest) version() int16 { 36 | return 0 37 | } 38 | 39 | func (d *DeleteTopicsRequest) requiredVersion() KafkaVersion { 40 | return V0_10_1_0 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/describe_groups_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type DescribeGroupsRequest struct { 4 | Groups []string 5 | } 6 | 7 | func (r *DescribeGroupsRequest) encode(pe packetEncoder) error { 8 | return pe.putStringArray(r.Groups) 9 | } 10 | 11 | func (r *DescribeGroupsRequest) decode(pd packetDecoder, version int16) (err error) { 12 | r.Groups, err = pd.getStringArray() 13 | return 14 | } 15 | 16 | func (r *DescribeGroupsRequest) key() int16 { 17 | return 15 18 | } 19 | 20 | func (r *DescribeGroupsRequest) version() int16 { 21 | return 0 22 | } 23 | 24 | func (r *DescribeGroupsRequest) requiredVersion() KafkaVersion { 25 | return V0_9_0_0 26 | } 27 | 28 | func (r *DescribeGroupsRequest) AddGroup(group string) { 29 | r.Groups = append(r.Groups, group) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/dev.yml: -------------------------------------------------------------------------------- 1 | name: sarama 2 | 3 | up: 4 | - go: 5 | version: '1.9' 6 | 7 | commands: 8 | test: 9 | run: make test 10 | desc: 'run unit tests' 11 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/end_txn_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type EndTxnRequest struct { 4 | TransactionalID string 5 | ProducerID int64 6 | ProducerEpoch int16 7 | TransactionResult bool 8 | } 9 | 10 | func (a *EndTxnRequest) encode(pe packetEncoder) error { 11 | if err := pe.putString(a.TransactionalID); err != nil { 12 | return err 13 | } 14 | 15 | pe.putInt64(a.ProducerID) 16 | 17 | pe.putInt16(a.ProducerEpoch) 18 | 19 | pe.putBool(a.TransactionResult) 20 | 21 | return nil 22 | } 23 | 24 | func (a *EndTxnRequest) decode(pd packetDecoder, version int16) (err error) { 25 | if a.TransactionalID, err = pd.getString(); err != nil { 26 | return err 27 | } 28 | if a.ProducerID, err = pd.getInt64(); err != nil { 29 | return err 30 | } 31 | if a.ProducerEpoch, err = pd.getInt16(); err != nil { 32 | return err 33 | } 34 | if a.TransactionResult, err = pd.getBool(); err != nil { 35 | return err 36 | } 37 | return nil 38 | } 39 | 40 | func (a *EndTxnRequest) key() int16 { 41 | return 26 42 | } 43 | 44 | func (a *EndTxnRequest) version() int16 { 45 | return 0 46 | } 47 | 48 | func (a *EndTxnRequest) requiredVersion() KafkaVersion { 49 | return V0_11_0_0 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/end_txn_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | type EndTxnResponse struct { 8 | ThrottleTime time.Duration 9 | Err KError 10 | } 11 | 12 | func (e *EndTxnResponse) encode(pe packetEncoder) error { 13 | pe.putInt32(int32(e.ThrottleTime / time.Millisecond)) 14 | pe.putInt16(int16(e.Err)) 15 | return nil 16 | } 17 | 18 | func (e *EndTxnResponse) decode(pd packetDecoder, version int16) (err error) { 19 | throttleTime, err := pd.getInt32() 20 | if err != nil { 21 | return err 22 | } 23 | e.ThrottleTime = time.Duration(throttleTime) * time.Millisecond 24 | 25 | kerr, err := pd.getInt16() 26 | if err != nil { 27 | return err 28 | } 29 | e.Err = KError(kerr) 30 | 31 | return nil 32 | } 33 | 34 | func (e *EndTxnResponse) key() int16 { 35 | return 25 36 | } 37 | 38 | func (e *EndTxnResponse) version() int16 { 39 | return 0 40 | } 41 | 42 | func (e *EndTxnResponse) requiredVersion() KafkaVersion { 43 | return V0_11_0_0 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/heartbeat_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type HeartbeatRequest struct { 4 | GroupId string 5 | GenerationId int32 6 | MemberId string 7 | } 8 | 9 | func (r *HeartbeatRequest) encode(pe packetEncoder) error { 10 | if err := pe.putString(r.GroupId); err != nil { 11 | return err 12 | } 13 | 14 | pe.putInt32(r.GenerationId) 15 | 16 | if err := pe.putString(r.MemberId); err != nil { 17 | return err 18 | } 19 | 20 | return nil 21 | } 22 | 23 | func (r *HeartbeatRequest) decode(pd packetDecoder, version int16) (err error) { 24 | if r.GroupId, err = pd.getString(); err != nil { 25 | return 26 | } 27 | if r.GenerationId, err = pd.getInt32(); err != nil { 28 | return 29 | } 30 | if r.MemberId, err = pd.getString(); err != nil { 31 | return 32 | } 33 | 34 | return nil 35 | } 36 | 37 | func (r *HeartbeatRequest) key() int16 { 38 | return 12 39 | } 40 | 41 | func (r *HeartbeatRequest) version() int16 { 42 | return 0 43 | } 44 | 45 | func (r *HeartbeatRequest) requiredVersion() KafkaVersion { 46 | return V0_9_0_0 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/heartbeat_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type HeartbeatResponse struct { 4 | Err KError 5 | } 6 | 7 | func (r *HeartbeatResponse) encode(pe packetEncoder) error { 8 | pe.putInt16(int16(r.Err)) 9 | return nil 10 | } 11 | 12 | func (r *HeartbeatResponse) decode(pd packetDecoder, version int16) error { 13 | kerr, err := pd.getInt16() 14 | if err != nil { 15 | return err 16 | } 17 | r.Err = KError(kerr) 18 | 19 | return nil 20 | } 21 | 22 | func (r *HeartbeatResponse) key() int16 { 23 | return 12 24 | } 25 | 26 | func (r *HeartbeatResponse) version() int16 { 27 | return 0 28 | } 29 | 30 | func (r *HeartbeatResponse) requiredVersion() KafkaVersion { 31 | return V0_9_0_0 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/init_producer_id_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import "time" 4 | 5 | type InitProducerIDRequest struct { 6 | TransactionalID *string 7 | TransactionTimeout time.Duration 8 | } 9 | 10 | func (i *InitProducerIDRequest) encode(pe packetEncoder) error { 11 | if err := pe.putNullableString(i.TransactionalID); err != nil { 12 | return err 13 | } 14 | pe.putInt32(int32(i.TransactionTimeout / time.Millisecond)) 15 | 16 | return nil 17 | } 18 | 19 | func (i *InitProducerIDRequest) decode(pd packetDecoder, version int16) (err error) { 20 | if i.TransactionalID, err = pd.getNullableString(); err != nil { 21 | return err 22 | } 23 | 24 | timeout, err := pd.getInt32() 25 | if err != nil { 26 | return err 27 | } 28 | i.TransactionTimeout = time.Duration(timeout) * time.Millisecond 29 | 30 | return nil 31 | } 32 | 33 | func (i *InitProducerIDRequest) key() int16 { 34 | return 22 35 | } 36 | 37 | func (i *InitProducerIDRequest) version() int16 { 38 | return 0 39 | } 40 | 41 | func (i *InitProducerIDRequest) requiredVersion() KafkaVersion { 42 | return V0_11_0_0 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/init_producer_id_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import "time" 4 | 5 | type InitProducerIDResponse struct { 6 | ThrottleTime time.Duration 7 | Err KError 8 | ProducerID int64 9 | ProducerEpoch int16 10 | } 11 | 12 | func (i *InitProducerIDResponse) encode(pe packetEncoder) error { 13 | pe.putInt32(int32(i.ThrottleTime / time.Millisecond)) 14 | pe.putInt16(int16(i.Err)) 15 | pe.putInt64(i.ProducerID) 16 | pe.putInt16(i.ProducerEpoch) 17 | 18 | return nil 19 | } 20 | 21 | func (i *InitProducerIDResponse) decode(pd packetDecoder, version int16) (err error) { 22 | throttleTime, err := pd.getInt32() 23 | if err != nil { 24 | return err 25 | } 26 | i.ThrottleTime = time.Duration(throttleTime) * time.Millisecond 27 | 28 | kerr, err := pd.getInt16() 29 | if err != nil { 30 | return err 31 | } 32 | i.Err = KError(kerr) 33 | 34 | if i.ProducerID, err = pd.getInt64(); err != nil { 35 | return err 36 | } 37 | 38 | if i.ProducerEpoch, err = pd.getInt16(); err != nil { 39 | return err 40 | } 41 | 42 | return nil 43 | } 44 | 45 | func (i *InitProducerIDResponse) key() int16 { 46 | return 22 47 | } 48 | 49 | func (i *InitProducerIDResponse) version() int16 { 50 | return 0 51 | } 52 | 53 | func (i *InitProducerIDResponse) requiredVersion() KafkaVersion { 54 | return V0_11_0_0 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/leave_group_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type LeaveGroupRequest struct { 4 | GroupId string 5 | MemberId string 6 | } 7 | 8 | func (r *LeaveGroupRequest) encode(pe packetEncoder) error { 9 | if err := pe.putString(r.GroupId); err != nil { 10 | return err 11 | } 12 | if err := pe.putString(r.MemberId); err != nil { 13 | return err 14 | } 15 | 16 | return nil 17 | } 18 | 19 | func (r *LeaveGroupRequest) decode(pd packetDecoder, version int16) (err error) { 20 | if r.GroupId, err = pd.getString(); err != nil { 21 | return 22 | } 23 | if r.MemberId, err = pd.getString(); err != nil { 24 | return 25 | } 26 | 27 | return nil 28 | } 29 | 30 | func (r *LeaveGroupRequest) key() int16 { 31 | return 13 32 | } 33 | 34 | func (r *LeaveGroupRequest) version() int16 { 35 | return 0 36 | } 37 | 38 | func (r *LeaveGroupRequest) requiredVersion() KafkaVersion { 39 | return V0_9_0_0 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/leave_group_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type LeaveGroupResponse struct { 4 | Err KError 5 | } 6 | 7 | func (r *LeaveGroupResponse) encode(pe packetEncoder) error { 8 | pe.putInt16(int16(r.Err)) 9 | return nil 10 | } 11 | 12 | func (r *LeaveGroupResponse) decode(pd packetDecoder, version int16) (err error) { 13 | kerr, err := pd.getInt16() 14 | if err != nil { 15 | return err 16 | } 17 | r.Err = KError(kerr) 18 | 19 | return nil 20 | } 21 | 22 | func (r *LeaveGroupResponse) key() int16 { 23 | return 13 24 | } 25 | 26 | func (r *LeaveGroupResponse) version() int16 { 27 | return 0 28 | } 29 | 30 | func (r *LeaveGroupResponse) requiredVersion() KafkaVersion { 31 | return V0_9_0_0 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/list_groups_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type ListGroupsRequest struct { 4 | } 5 | 6 | func (r *ListGroupsRequest) encode(pe packetEncoder) error { 7 | return nil 8 | } 9 | 10 | func (r *ListGroupsRequest) decode(pd packetDecoder, version int16) (err error) { 11 | return nil 12 | } 13 | 14 | func (r *ListGroupsRequest) key() int16 { 15 | return 16 16 | } 17 | 18 | func (r *ListGroupsRequest) version() int16 { 19 | return 0 20 | } 21 | 22 | func (r *ListGroupsRequest) requiredVersion() KafkaVersion { 23 | return V0_9_0_0 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/metadata_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type MetadataRequest struct { 4 | Topics []string 5 | } 6 | 7 | func (r *MetadataRequest) encode(pe packetEncoder) error { 8 | err := pe.putArrayLength(len(r.Topics)) 9 | if err != nil { 10 | return err 11 | } 12 | 13 | for i := range r.Topics { 14 | err = pe.putString(r.Topics[i]) 15 | if err != nil { 16 | return err 17 | } 18 | } 19 | return nil 20 | } 21 | 22 | func (r *MetadataRequest) decode(pd packetDecoder, version int16) error { 23 | topicCount, err := pd.getArrayLength() 24 | if err != nil { 25 | return err 26 | } 27 | if topicCount == 0 { 28 | return nil 29 | } 30 | 31 | r.Topics = make([]string, topicCount) 32 | for i := range r.Topics { 33 | topic, err := pd.getString() 34 | if err != nil { 35 | return err 36 | } 37 | r.Topics[i] = topic 38 | } 39 | return nil 40 | } 41 | 42 | func (r *MetadataRequest) key() int16 { 43 | return 3 44 | } 45 | 46 | func (r *MetadataRequest) version() int16 { 47 | return 0 48 | } 49 | 50 | func (r *MetadataRequest) requiredVersion() KafkaVersion { 51 | return minVersion 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/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) (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 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/sasl_handshake_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type SaslHandshakeRequest struct { 4 | Mechanism string 5 | } 6 | 7 | func (r *SaslHandshakeRequest) encode(pe packetEncoder) error { 8 | if err := pe.putString(r.Mechanism); err != nil { 9 | return err 10 | } 11 | 12 | return nil 13 | } 14 | 15 | func (r *SaslHandshakeRequest) decode(pd packetDecoder, version int16) (err error) { 16 | if r.Mechanism, err = pd.getString(); err != nil { 17 | return err 18 | } 19 | 20 | return nil 21 | } 22 | 23 | func (r *SaslHandshakeRequest) key() int16 { 24 | return 17 25 | } 26 | 27 | func (r *SaslHandshakeRequest) version() int16 { 28 | return 0 29 | } 30 | 31 | func (r *SaslHandshakeRequest) requiredVersion() KafkaVersion { 32 | return V0_10_0_0 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/sasl_handshake_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type SaslHandshakeResponse struct { 4 | Err KError 5 | EnabledMechanisms []string 6 | } 7 | 8 | func (r *SaslHandshakeResponse) encode(pe packetEncoder) error { 9 | pe.putInt16(int16(r.Err)) 10 | return pe.putStringArray(r.EnabledMechanisms) 11 | } 12 | 13 | func (r *SaslHandshakeResponse) decode(pd packetDecoder, version int16) error { 14 | kerr, err := pd.getInt16() 15 | if err != nil { 16 | return err 17 | } 18 | 19 | r.Err = KError(kerr) 20 | 21 | if r.EnabledMechanisms, err = pd.getStringArray(); err != nil { 22 | return err 23 | } 24 | 25 | return nil 26 | } 27 | 28 | func (r *SaslHandshakeResponse) key() int16 { 29 | return 17 30 | } 31 | 32 | func (r *SaslHandshakeResponse) version() int16 { 33 | return 0 34 | } 35 | 36 | func (r *SaslHandshakeResponse) requiredVersion() KafkaVersion { 37 | return V0_10_0_0 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/sync_group_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type SyncGroupResponse struct { 4 | Err KError 5 | MemberAssignment []byte 6 | } 7 | 8 | func (r *SyncGroupResponse) GetMemberAssignment() (*ConsumerGroupMemberAssignment, error) { 9 | assignment := new(ConsumerGroupMemberAssignment) 10 | err := decode(r.MemberAssignment, assignment) 11 | return assignment, err 12 | } 13 | 14 | func (r *SyncGroupResponse) encode(pe packetEncoder) error { 15 | pe.putInt16(int16(r.Err)) 16 | return pe.putBytes(r.MemberAssignment) 17 | } 18 | 19 | func (r *SyncGroupResponse) decode(pd packetDecoder, version int16) (err error) { 20 | kerr, err := pd.getInt16() 21 | if err != nil { 22 | return err 23 | } 24 | 25 | r.Err = KError(kerr) 26 | 27 | r.MemberAssignment, err = pd.getBytes() 28 | return 29 | } 30 | 31 | func (r *SyncGroupResponse) key() int16 { 32 | return 14 33 | } 34 | 35 | func (r *SyncGroupResponse) version() int16 { 36 | return 0 37 | } 38 | 39 | func (r *SyncGroupResponse) requiredVersion() KafkaVersion { 40 | return V0_9_0_0 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/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/aws/aws-sdk-go/NOTICE.txt: -------------------------------------------------------------------------------- 1 | AWS SDK for Go 2 | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | Copyright 2014-2015 Stripe, Inc. 4 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go: -------------------------------------------------------------------------------- 1 | package awsutil 2 | 3 | import ( 4 | "reflect" 5 | ) 6 | 7 | // DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. 8 | // In addition to this, this method will also dereference the input values if 9 | // possible so the DeepEqual performed will not fail if one parameter is a 10 | // pointer and the other is not. 11 | // 12 | // DeepEqual will not perform indirection of nested values of the input parameters. 13 | func DeepEqual(a, b interface{}) bool { 14 | ra := reflect.Indirect(reflect.ValueOf(a)) 15 | rb := reflect.Indirect(reflect.ValueOf(b)) 16 | 17 | if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { 18 | // If the elements are both nil, and of the same type the are equal 19 | // If they are of different types they are not equal 20 | return reflect.TypeOf(a) == reflect.TypeOf(b) 21 | } else if raValid != rbValid { 22 | // Both values must be valid to be equal 23 | return false 24 | } 25 | 26 | return reflect.DeepEqual(ra.Interface(), rb.Interface()) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go: -------------------------------------------------------------------------------- 1 | package metadata 2 | 3 | // ClientInfo wraps immutable data from the client.Client structure. 4 | type ClientInfo struct { 5 | ServiceName string 6 | APIVersion string 7 | Endpoint string 8 | SigningName string 9 | SigningRegion string 10 | JSONVersion string 11 | TargetPrefix string 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package aws 4 | 5 | import "time" 6 | 7 | // An emptyCtx is a copy of the Go 1.7 context.emptyCtx type. This is copied to 8 | // provide a 1.6 and 1.5 safe version of context that is compatible with Go 9 | // 1.7's Context. 10 | // 11 | // An emptyCtx is never canceled, has no values, and has no deadline. It is not 12 | // struct{}, since vars of this type must have distinct addresses. 13 | type emptyCtx int 14 | 15 | func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { 16 | return 17 | } 18 | 19 | func (*emptyCtx) Done() <-chan struct{} { 20 | return nil 21 | } 22 | 23 | func (*emptyCtx) Err() error { 24 | return nil 25 | } 26 | 27 | func (*emptyCtx) Value(key interface{}) interface{} { 28 | return nil 29 | } 30 | 31 | func (e *emptyCtx) String() string { 32 | switch e { 33 | case backgroundCtx: 34 | return "aws.BackgroundContext" 35 | } 36 | return "unknown empty Context" 37 | } 38 | 39 | var ( 40 | backgroundCtx = new(emptyCtx) 41 | ) 42 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package aws 4 | 5 | import "context" 6 | 7 | var ( 8 | backgroundCtx = context.Background() 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go: -------------------------------------------------------------------------------- 1 | package corehandlers 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | // ValidateParametersHandler is a request handler to validate the input parameters. 6 | // Validating parameters only has meaning if done prior to the request being sent. 7 | var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) { 8 | if !r.ParamsFilled() { 9 | return 10 | } 11 | 12 | if v, ok := r.Params.(request.Validator); ok { 13 | if err := v.Validate(); err != nil { 14 | r.Error = err 15 | } 16 | } 17 | }} 18 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini: -------------------------------------------------------------------------------- 1 | [default] 2 | aws_access_key_id = accessKey 3 | aws_secret_access_key = secret 4 | aws_session_token = token 5 | 6 | [no_token] 7 | aws_access_key_id = accessKey 8 | aws_secret_access_key = secret 9 | 10 | [with_colon] 11 | aws_access_key_id: accessKey 12 | aws_secret_access_key: secret 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go: -------------------------------------------------------------------------------- 1 | package defaults 2 | 3 | import ( 4 | "github.com/aws/aws-sdk-go/internal/shareddefaults" 5 | ) 6 | 7 | // SharedCredentialsFilename returns the SDK's default file path 8 | // for the shared credentials file. 9 | // 10 | // Builds the shared config file path based on the OS's platform. 11 | // 12 | // - Linux/Unix: $HOME/.aws/credentials 13 | // - Windows: %USERPROFILE%\.aws\credentials 14 | func SharedCredentialsFilename() string { 15 | return shareddefaults.SharedCredentialsFilename() 16 | } 17 | 18 | // SharedConfigFilename returns the SDK's default file path for 19 | // the shared config file. 20 | // 21 | // Builds the shared config file path based on the OS's platform. 22 | // 23 | // - Linux/Unix: $HOME/.aws/config 24 | // - Windows: %USERPROFILE%\.aws\config 25 | func SharedConfigFilename() string { 26 | return shareddefaults.SharedConfigFilename() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/errors.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | import "github.com/aws/aws-sdk-go/aws/awserr" 4 | 5 | var ( 6 | // ErrMissingRegion is an error that is returned if region configuration is 7 | // not found. 8 | // 9 | // @readonly 10 | ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) 11 | 12 | // ErrMissingEndpoint is an error that is returned if an endpoint cannot be 13 | // resolved for a service. 14 | // 15 | // @readonly 16 | ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | // JSONValue is a representation of a grab bag type that will be marshaled 4 | // into a json string. This type can be used just like any other map. 5 | // 6 | // Example: 7 | // 8 | // values := aws.JSONValue{ 9 | // "Foo": "Bar", 10 | // } 11 | // values["Baz"] = "Qux" 12 | type JSONValue map[string]interface{} 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!plan9 2 | 3 | package request 4 | 5 | import ( 6 | "net" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | func isErrConnectionReset(err error) bool { 12 | if opErr, ok := err.(*net.OpError); ok { 13 | if sysErr, ok := opErr.Err.(*os.SyscallError); ok { 14 | return sysErr.Err == syscall.ECONNRESET 15 | } 16 | } 17 | 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go: -------------------------------------------------------------------------------- 1 | // +build appengine plan9 2 | 3 | package request 4 | 5 | import ( 6 | "strings" 7 | ) 8 | 9 | func isErrConnectionReset(err error) bool { 10 | return strings.Contains(err.Error(), "connection reset") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "net/url" 7 | ) 8 | 9 | func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request { 10 | req := new(http.Request) 11 | *req = *r 12 | req.URL = &url.URL{} 13 | *req.URL = *r.URL 14 | req.Body = body 15 | 16 | req.Header = http.Header{} 17 | for k, v := range r.Header { 18 | for _, vv := range v { 19 | req.Header.Add(k, vv) 20 | } 21 | } 22 | 23 | return req 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package request 4 | 5 | import ( 6 | "net/http" 7 | ) 8 | 9 | // NoBody is a http.NoBody reader instructing Go HTTP client to not include 10 | // and body in the HTTP request. 11 | var NoBody = http.NoBody 12 | 13 | // ResetBody rewinds the request body back to its starting position, and 14 | // set's the HTTP Request body reference. When the body is read prior 15 | // to being sent in the HTTP request it will need to be rewound. 16 | // 17 | // ResetBody will automatically be called by the SDK's build handler, but if 18 | // the request is being used directly ResetBody must be called before the request 19 | // is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically 20 | // call ResetBody. 21 | // 22 | // Will also set the Go 1.8's http.Request.GetBody member to allow retrying 23 | // PUT/POST redirects. 24 | func (r *Request) ResetBody() { 25 | body, err := r.getNextRequestBody() 26 | if err != nil { 27 | r.Error = err 28 | return 29 | } 30 | 31 | r.HTTPRequest.Body = body 32 | r.HTTPRequest.GetBody = r.getNextRequestBody 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package request 4 | 5 | import "github.com/aws/aws-sdk-go/aws" 6 | 7 | // setContext updates the Request to use the passed in context for cancellation. 8 | // Context will also be used for request retry delay. 9 | // 10 | // Creates shallow copy of the http.Request with the WithContext method. 11 | func setRequestContext(r *Request, ctx aws.Context) { 12 | r.context = ctx 13 | r.HTTPRequest = r.HTTPRequest.WithContext(ctx) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package request 4 | 5 | import "github.com/aws/aws-sdk-go/aws" 6 | 7 | // setContext updates the Request to use the passed in context for cancellation. 8 | // Context will also be used for request retry delay. 9 | // 10 | // Creates shallow copy of the http.Request with the WithContext method. 11 | func setRequestContext(r *Request, ctx aws.Context) { 12 | r.context = ctx 13 | r.HTTPRequest.Cancel = ctx.Done() 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go: -------------------------------------------------------------------------------- 1 | package v4 2 | 3 | // WithUnsignedPayload will enable and set the UnsignedPayload field to 4 | // true of the signer. 5 | func WithUnsignedPayload(v4 *Signer) { 6 | v4.UnsignedPayload = true 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package v4 4 | 5 | import ( 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | func getURIPath(u *url.URL) string { 11 | var uri string 12 | 13 | if len(u.Opaque) > 0 { 14 | uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") 15 | } else { 16 | uri = u.EscapedPath() 17 | } 18 | 19 | if len(uri) == 0 { 20 | uri = "/" 21 | } 22 | 23 | return uri 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/url.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package aws 4 | 5 | import "net/url" 6 | 7 | // URLHostname will extract the Hostname without port from the URL value. 8 | // 9 | // Wrapper of net/url#URL.Hostname for backwards Go version compatibility. 10 | func URLHostname(url *url.URL) string { 11 | return url.Hostname() 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package aws 4 | 5 | import ( 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | // URLHostname will extract the Hostname without port from the URL value. 11 | // 12 | // Copy of Go 1.8's net/url#URL.Hostname functionality. 13 | func URLHostname(url *url.URL) string { 14 | return stripPort(url.Host) 15 | 16 | } 17 | 18 | // stripPort is copy of Go 1.8 url#URL.Hostname functionality. 19 | // https://golang.org/src/net/url/url.go 20 | func stripPort(hostport string) string { 21 | colon := strings.IndexByte(hostport, ':') 22 | if colon == -1 { 23 | return hostport 24 | } 25 | if i := strings.IndexByte(hostport, ']'); i != -1 { 26 | return strings.TrimPrefix(hostport[:i], "[") 27 | } 28 | return hostport[:colon] 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/version.go: -------------------------------------------------------------------------------- 1 | // Package aws provides core functionality for making requests to AWS services. 2 | package aws 3 | 4 | // SDKName is the name of this AWS SDK 5 | const SDKName = "aws-sdk-go" 6 | 7 | // SDKVersion is the version of this SDK 8 | const SDKVersion = "1.13.11" 9 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go: -------------------------------------------------------------------------------- 1 | package sdkrand 2 | 3 | import ( 4 | "math/rand" 5 | "sync" 6 | "time" 7 | ) 8 | 9 | // lockedSource is a thread-safe implementation of rand.Source 10 | type lockedSource struct { 11 | lk sync.Mutex 12 | src rand.Source 13 | } 14 | 15 | func (r *lockedSource) Int63() (n int64) { 16 | r.lk.Lock() 17 | n = r.src.Int63() 18 | r.lk.Unlock() 19 | return 20 | } 21 | 22 | func (r *lockedSource) Seed(seed int64) { 23 | r.lk.Lock() 24 | r.src.Seed(seed) 25 | r.lk.Unlock() 26 | } 27 | 28 | // SeededRand is a new RNG using a thread safe implementation of rand.Source 29 | var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go: -------------------------------------------------------------------------------- 1 | package shareddefaults 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | "runtime" 7 | ) 8 | 9 | // SharedCredentialsFilename returns the SDK's default file path 10 | // for the shared credentials file. 11 | // 12 | // Builds the shared config file path based on the OS's platform. 13 | // 14 | // - Linux/Unix: $HOME/.aws/credentials 15 | // - Windows: %USERPROFILE%\.aws\credentials 16 | func SharedCredentialsFilename() string { 17 | return filepath.Join(UserHomeDir(), ".aws", "credentials") 18 | } 19 | 20 | // SharedConfigFilename returns the SDK's default file path for 21 | // the shared config file. 22 | // 23 | // Builds the shared config file path based on the OS's platform. 24 | // 25 | // - Linux/Unix: $HOME/.aws/config 26 | // - Windows: %USERPROFILE%\.aws\config 27 | func SharedConfigFilename() string { 28 | return filepath.Join(UserHomeDir(), ".aws", "config") 29 | } 30 | 31 | // UserHomeDir returns the home directory for the user the process is 32 | // running under. 33 | func UserHomeDir() string { 34 | if runtime.GOOS == "windows" { // Windows 35 | return os.Getenv("USERPROFILE") 36 | } 37 | 38 | // *nix 39 | return os.Getenv("HOME") 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go: -------------------------------------------------------------------------------- 1 | // Package query provides serialization of AWS query requests, and responses. 2 | package query 3 | 4 | //go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/query.json build_test.go 5 | 6 | import ( 7 | "net/url" 8 | 9 | "github.com/aws/aws-sdk-go/aws/awserr" 10 | "github.com/aws/aws-sdk-go/aws/request" 11 | "github.com/aws/aws-sdk-go/private/protocol/query/queryutil" 12 | ) 13 | 14 | // BuildHandler is a named request handler for building query protocol requests 15 | var BuildHandler = request.NamedHandler{Name: "awssdk.query.Build", Fn: Build} 16 | 17 | // Build builds a request for an AWS Query service. 18 | func Build(r *request.Request) { 19 | body := url.Values{ 20 | "Action": {r.Operation.Name}, 21 | "Version": {r.ClientInfo.APIVersion}, 22 | } 23 | if err := queryutil.Parse(body, r.Params, false); err != nil { 24 | r.Error = awserr.New("SerializationError", "failed encoding Query request", err) 25 | return 26 | } 27 | 28 | if r.ExpireTime == 0 { 29 | r.HTTPRequest.Method = "POST" 30 | r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") 31 | r.SetBufferBody([]byte(body.Encode())) 32 | } else { // This is a pre-signed request 33 | r.HTTPRequest.Method = "GET" 34 | r.HTTPRequest.URL.RawQuery = body.Encode() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import "reflect" 4 | 5 | // PayloadMember returns the payload field member of i if there is one, or nil. 6 | func PayloadMember(i interface{}) interface{} { 7 | if i == nil { 8 | return nil 9 | } 10 | 11 | v := reflect.ValueOf(i).Elem() 12 | if !v.IsValid() { 13 | return nil 14 | } 15 | if field, ok := v.Type().FieldByName("_"); ok { 16 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 17 | field, _ := v.Type().FieldByName(payloadName) 18 | if field.Tag.Get("type") != "structure" { 19 | return nil 20 | } 21 | 22 | payload := v.FieldByName(payloadName) 23 | if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) { 24 | return payload.Interface() 25 | } 26 | } 27 | } 28 | return nil 29 | } 30 | 31 | // PayloadType returns the type of a payload field member of i if there is one, or "". 32 | func PayloadType(i interface{}) string { 33 | v := reflect.Indirect(reflect.ValueOf(i)) 34 | if !v.IsValid() { 35 | return "" 36 | } 37 | if field, ok := v.Type().FieldByName("_"); ok { 38 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 39 | if member, ok := v.Type().FieldByName(payloadName); ok { 40 | return member.Tag.Get("type") 41 | } 42 | } 43 | } 44 | return "" 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | import ( 4 | "io" 5 | "io/ioutil" 6 | 7 | "github.com/aws/aws-sdk-go/aws/request" 8 | ) 9 | 10 | // UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body 11 | var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "awssdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody} 12 | 13 | // UnmarshalDiscardBody is a request handler to empty a response's body and closing it. 14 | func UnmarshalDiscardBody(r *request.Request) { 15 | if r.HTTPResponse == nil || r.HTTPResponse.Body == nil { 16 | return 17 | } 18 | 19 | io.Copy(ioutil.Discard, r.HTTPResponse.Body) 20 | r.HTTPResponse.Body.Close() 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go: -------------------------------------------------------------------------------- 1 | /* 2 | AttributeValue Marshaling and Unmarshaling Helpers 3 | 4 | Utility helpers to marshal and unmarshal AttributeValue to and 5 | from Go types can be found in the dynamodbattribute sub package. This package 6 | provides has specialized functions for the common ways of working with 7 | AttributeValues. Such as map[string]*AttributeValue, []*AttributeValue, and 8 | directly with *AttributeValue. This is helpful for marshaling Go types for API 9 | operations such as PutItem, and unmarshaling Query and Scan APIs' responses. 10 | 11 | See the dynamodbattribute package documentation for more information. 12 | https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/dynamodbattribute/ 13 | 14 | Expression Builders 15 | 16 | The expression package provides utility types and functions to build DynamoDB 17 | expression for type safe construction of API ExpressionAttributeNames, and 18 | ExpressionAttribute Values. 19 | 20 | The package represents the various DynamoDB Expressions as structs named 21 | accordingly. For example, ConditionBuilder represents a DynamoDB Condition 22 | Expression, an UpdateBuilder represents a DynamoDB Update Expression, and so on. 23 | 24 | See the expression package documentation for more information. 25 | https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/expression/ 26 | */ 27 | package dynamodb 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go: -------------------------------------------------------------------------------- 1 | package sts 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | func init() { 6 | initRequest = func(r *request.Request) { 7 | switch r.Operation.Name { 8 | case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity: 9 | r.Handlers.Sign.Clear() // these operations are unsigned 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/bsm/sarama-cluster/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.pid 3 | kafka*/ 4 | vendor/ 5 | -------------------------------------------------------------------------------- /vendor/github.com/bsm/sarama-cluster/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.9.x 5 | - 1.8.x 6 | install: 7 | - go get -u github.com/golang/dep/cmd/dep 8 | - dep ensure 9 | env: 10 | - SCALA_VERSION=2.11 KAFKA_VERSION=0.10.1.1 11 | - SCALA_VERSION=2.12 KAFKA_VERSION=0.10.2.1 12 | - SCALA_VERSION=2.12 KAFKA_VERSION=0.11.0.1 13 | - SCALA_VERSION=2.12 KAFKA_VERSION=1.0.0 14 | script: 15 | - make default test-race 16 | addons: 17 | apt: 18 | packages: 19 | - oracle-java8-set-default 20 | -------------------------------------------------------------------------------- /vendor/github.com/bsm/sarama-cluster/Gopkg.toml: -------------------------------------------------------------------------------- 1 | 2 | # Gopkg.toml example 3 | # 4 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 5 | # for detailed Gopkg.toml documentation. 6 | # 7 | # required = ["github.com/user/thing/cmd/thing"] 8 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 9 | # 10 | # [[constraint]] 11 | # name = "github.com/user/project" 12 | # version = "1.0.0" 13 | # 14 | # [[constraint]] 15 | # name = "github.com/user/project2" 16 | # branch = "dev" 17 | # source = "github.com/myfork/project2" 18 | # 19 | # [[override]] 20 | # name = "github.com/x/y" 21 | # version = "2.4.0" 22 | 23 | 24 | [[constraint]] 25 | name = "github.com/Shopify/sarama" 26 | version = "^1.14.0" 27 | -------------------------------------------------------------------------------- /vendor/github.com/bsm/sarama-cluster/Makefile: -------------------------------------------------------------------------------- 1 | SCALA_VERSION?= 2.12 2 | KAFKA_VERSION?= 1.0.0 3 | KAFKA_DIR= kafka_$(SCALA_VERSION)-$(KAFKA_VERSION) 4 | KAFKA_SRC= https://archive.apache.org/dist/kafka/$(KAFKA_VERSION)/$(KAFKA_DIR).tgz 5 | KAFKA_ROOT= testdata/$(KAFKA_DIR) 6 | PKG=$(shell go list ./... | grep -v vendor) 7 | 8 | default: vet test 9 | 10 | vet: 11 | go vet $(PKG) 12 | 13 | test: testdeps 14 | KAFKA_DIR=$(KAFKA_DIR) go test $(PKG) -ginkgo.slowSpecThreshold=60 15 | 16 | test-verbose: testdeps 17 | KAFKA_DIR=$(KAFKA_DIR) go test $(PKG) -ginkgo.slowSpecThreshold=60 -v 18 | 19 | test-race: testdeps 20 | KAFKA_DIR=$(KAFKA_DIR) go test $(PKG) -ginkgo.slowSpecThreshold=60 -v -race 21 | 22 | testdeps: $(KAFKA_ROOT) 23 | 24 | doc: README.md 25 | 26 | .PHONY: test testdeps vet doc 27 | 28 | # --------------------------------------------------------------------- 29 | 30 | $(KAFKA_ROOT): 31 | @mkdir -p $(dir $@) 32 | cd $(dir $@) && curl -sSL $(KAFKA_SRC) | tar xz 33 | 34 | README.md: README.md.tpl $(wildcard *.go) 35 | becca -package $(subst $(GOPATH)/src/,,$(PWD)) 36 | -------------------------------------------------------------------------------- /vendor/github.com/bsm/sarama-cluster/client.go: -------------------------------------------------------------------------------- 1 | package cluster 2 | 3 | import ( 4 | "errors" 5 | "sync/atomic" 6 | 7 | "github.com/Shopify/sarama" 8 | ) 9 | 10 | var errClientInUse = errors.New("cluster: client is already used by another consumer") 11 | 12 | // Client is a group client 13 | type Client struct { 14 | sarama.Client 15 | config Config 16 | 17 | inUse uint32 18 | } 19 | 20 | // NewClient creates a new client instance 21 | func NewClient(addrs []string, config *Config) (*Client, error) { 22 | if config == nil { 23 | config = NewConfig() 24 | } 25 | 26 | if err := config.Validate(); err != nil { 27 | return nil, err 28 | } 29 | 30 | client, err := sarama.NewClient(addrs, &config.Config) 31 | if err != nil { 32 | return nil, err 33 | } 34 | 35 | return &Client{Client: client, config: *config}, nil 36 | } 37 | 38 | // ClusterConfig returns the cluster configuration. 39 | func (c *Client) ClusterConfig() *Config { 40 | cfg := c.config 41 | return &cfg 42 | } 43 | 44 | func (c *Client) claim() bool { 45 | return atomic.CompareAndSwapUint32(&c.inUse, 0, 1) 46 | } 47 | 48 | func (c *Client) release() { 49 | atomic.CompareAndSwapUint32(&c.inUse, 1, 0) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/bsm/sarama-cluster/cluster.go: -------------------------------------------------------------------------------- 1 | package cluster 2 | 3 | // Strategy for partition to consumer assignement 4 | type Strategy string 5 | 6 | const ( 7 | // StrategyRange is the default and assigns partition ranges to consumers. 8 | // Example with six partitions and two consumers: 9 | // C1: [0, 1, 2] 10 | // C2: [3, 4, 5] 11 | StrategyRange Strategy = "range" 12 | 13 | // StrategyRoundRobin assigns partitions by alternating over consumers. 14 | // Example with six partitions and two consumers: 15 | // C1: [0, 2, 4] 16 | // C2: [1, 3, 5] 17 | StrategyRoundRobin Strategy = "roundrobin" 18 | ) 19 | 20 | // Error instances are wrappers for internal errors with a context and 21 | // may be returned through the consumer's Errors() channel 22 | type Error struct { 23 | Ctx string 24 | error 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/bsm/sarama-cluster/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package cluster provides cluster extensions for Sarama, enabing users 3 | to consume topics across from multiple, balanced nodes. 4 | 5 | It requires Kafka v0.9+ and follows the steps guide, described in: 6 | https://cwiki.apache.org/confluence/display/KAFKA/Kafka+0.9+Consumer+Rewrite+Design 7 | */ 8 | package cluster 9 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-resiliency/breaker/README.md: -------------------------------------------------------------------------------- 1 | circuit-breaker 2 | =============== 3 | 4 | [![Build Status](https://travis-ci.org/eapache/go-resiliency.svg?branch=master)](https://travis-ci.org/eapache/go-resiliency) 5 | [![GoDoc](https://godoc.org/github.com/eapache/go-resiliency/breaker?status.svg)](https://godoc.org/github.com/eapache/go-resiliency/breaker) 6 | 7 | The circuit-breaker resiliency pattern for golang. 8 | 9 | Creating a breaker takes three parameters: 10 | - error threshold (for opening the breaker) 11 | - success threshold (for closing the breaker) 12 | - timeout (how long to keep the breaker open) 13 | 14 | ```go 15 | b := breaker.New(3, 1, 5*time.Second) 16 | 17 | for { 18 | result := b.Run(func() error { 19 | // communicate with some external service and 20 | // return an error if the communication failed 21 | return nil 22 | }) 23 | 24 | switch result { 25 | case nil: 26 | // success! 27 | case breaker.ErrBreakerOpen: 28 | // our function wasn't run because the breaker was open 29 | default: 30 | // some other error 31 | } 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /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/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/go-xerial-snappy/snappy.go: -------------------------------------------------------------------------------- 1 | package snappy 2 | 3 | import ( 4 | "bytes" 5 | "encoding/binary" 6 | 7 | master "github.com/golang/snappy" 8 | ) 9 | 10 | var xerialHeader = []byte{130, 83, 78, 65, 80, 80, 89, 0} 11 | 12 | // Encode encodes data as snappy with no framing header. 13 | func Encode(src []byte) []byte { 14 | return master.Encode(nil, src) 15 | } 16 | 17 | // Decode decodes snappy data whether it is traditional unframed 18 | // or includes the xerial framing format. 19 | func Decode(src []byte) ([]byte, error) { 20 | if !bytes.Equal(src[:8], xerialHeader) { 21 | return master.Decode(nil, src) 22 | } 23 | 24 | var ( 25 | pos = uint32(16) 26 | max = uint32(len(src)) 27 | dst = make([]byte, 0, len(src)) 28 | chunk []byte 29 | err error 30 | ) 31 | for pos < max { 32 | size := binary.BigEndian.Uint32(src[pos : pos+4]) 33 | pos += 4 34 | 35 | chunk, err = master.Decode(chunk, src[pos:pos+size]) 36 | if err != nil { 37 | return nil, err 38 | } 39 | pos += size 40 | dst = append(dst, chunk...) 41 | } 42 | return dst, nil 43 | } 44 | -------------------------------------------------------------------------------- /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/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/gin-contrib/sse/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.6.4 5 | - 1.7.4 6 | - tip 7 | 8 | git: 9 | depth: 3 10 | 11 | script: 12 | - go test -v -covermode=count -coverprofile=coverage.out 13 | 14 | after_success: 15 | - bash <(curl -s https://codecov.io/bash) -------------------------------------------------------------------------------- /vendor/github.com/gin-contrib/sse/writer.go: -------------------------------------------------------------------------------- 1 | package sse 2 | 3 | import "io" 4 | 5 | type stringWriter interface { 6 | io.Writer 7 | WriteString(string) (int, error) 8 | } 9 | 10 | type stringWrapper struct { 11 | io.Writer 12 | } 13 | 14 | func (w stringWrapper) WriteString(str string) (int, error) { 15 | return w.Writer.Write([]byte(str)) 16 | } 17 | 18 | func checkWriter(writer io.Writer) stringWriter { 19 | if w, ok := writer.(stringWriter); ok { 20 | return w 21 | } else { 22 | return stringWrapper{writer} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/* 2 | !vendor/vendor.json 3 | coverage.out 4 | count.out 5 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.6.x 5 | - 1.7.x 6 | - 1.8.x 7 | - master 8 | 9 | git: 10 | depth: 3 11 | 12 | install: 13 | - make install 14 | 15 | script: 16 | - make vet 17 | - make fmt-check 18 | - make embedmd 19 | - make misspell-check 20 | - make test 21 | 22 | after_success: 23 | - bash <(curl -s https://codecov.io/bash) 24 | 25 | notifications: 26 | webhooks: 27 | urls: 28 | - https://webhooks.gitter.im/e/7f95bf605c4d356372f4 29 | on_success: change # options: [always|never|change] default: always 30 | on_failure: always # options: [always|never|change] default: always 31 | on_start: false # default: false 32 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/default_validator.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "reflect" 9 | "sync" 10 | 11 | "gopkg.in/go-playground/validator.v8" 12 | ) 13 | 14 | type defaultValidator struct { 15 | once sync.Once 16 | validate *validator.Validate 17 | } 18 | 19 | var _ StructValidator = &defaultValidator{} 20 | 21 | func (v *defaultValidator) ValidateStruct(obj interface{}) error { 22 | if kindOfData(obj) == reflect.Struct { 23 | v.lazyinit() 24 | if err := v.validate.Struct(obj); err != nil { 25 | return error(err) 26 | } 27 | } 28 | return nil 29 | } 30 | 31 | func (v *defaultValidator) lazyinit() { 32 | v.once.Do(func() { 33 | config := &validator.Config{TagName: "binding"} 34 | v.validate = validator.New(config) 35 | }) 36 | } 37 | 38 | func kindOfData(data interface{}) reflect.Kind { 39 | value := reflect.ValueOf(data) 40 | valueType := value.Kind() 41 | if valueType == reflect.Ptr { 42 | valueType = value.Elem().Kind() 43 | } 44 | return valueType 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "encoding/json" 9 | "net/http" 10 | ) 11 | 12 | type jsonBinding struct{} 13 | 14 | func (jsonBinding) Name() string { 15 | return "json" 16 | } 17 | 18 | func (jsonBinding) Bind(req *http.Request, obj interface{}) error { 19 | decoder := json.NewDecoder(req.Body) 20 | if err := decoder.Decode(obj); err != nil { 21 | return err 22 | } 23 | return validate(obj) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/msgpack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "net/http" 9 | 10 | "github.com/ugorji/go/codec" 11 | ) 12 | 13 | type msgpackBinding struct{} 14 | 15 | func (msgpackBinding) Name() string { 16 | return "msgpack" 17 | } 18 | 19 | func (msgpackBinding) Bind(req *http.Request, obj interface{}) error { 20 | 21 | if err := codec.NewDecoder(req.Body, new(codec.MsgpackHandle)).Decode(&obj); err != nil { 22 | //var decoder *codec.Decoder = codec.NewDecoder(req.Body, &codec.MsgpackHandle) 23 | //if err := decoder.Decode(&obj); err != nil { 24 | return err 25 | } 26 | return validate(obj) 27 | 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/protobuf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "io/ioutil" 9 | "net/http" 10 | 11 | "github.com/golang/protobuf/proto" 12 | ) 13 | 14 | type protobufBinding struct{} 15 | 16 | func (protobufBinding) Name() string { 17 | return "protobuf" 18 | } 19 | 20 | func (protobufBinding) Bind(req *http.Request, obj interface{}) error { 21 | 22 | buf, err := ioutil.ReadAll(req.Body) 23 | if err != nil { 24 | return err 25 | } 26 | 27 | if err = proto.Unmarshal(buf, obj.(proto.Message)); err != nil { 28 | return err 29 | } 30 | 31 | //Here it's same to return validate(obj), but util now we cann't add `binding:""` to the struct 32 | //which automatically generate by gen-proto 33 | return nil 34 | //return validate(obj) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "encoding/xml" 9 | "net/http" 10 | ) 11 | 12 | type xmlBinding struct{} 13 | 14 | func (xmlBinding) Name() string { 15 | return "xml" 16 | } 17 | 18 | func (xmlBinding) Bind(req *http.Request, obj interface{}) error { 19 | decoder := xml.NewDecoder(req.Body) 20 | if err := decoder.Decode(obj); err != nil { 21 | return err 22 | } 23 | return validate(obj) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | notify: 3 | gitter: 4 | default: 5 | url: https://webhooks.gitter.im/e/d90dcdeeab2f1e357165 6 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/context_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | func init() { 10 | defaultAppEngine = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/deprecated.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "github.com/gin-gonic/gin/binding" 9 | "log" 10 | ) 11 | 12 | func (c *Context) GetCookie(name string) (string, error) { 13 | log.Println("GetCookie() method is deprecated. Use Cookie() instead.") 14 | return c.Cookie(name) 15 | } 16 | 17 | // BindWith binds the passed struct pointer using the specified binding engine. 18 | // See the binding package. 19 | func (c *Context) BindWith(obj interface{}, b binding.Binding) error { 20 | log.Println(`BindWith(\"interface{}, binding.Binding\") error is going to 21 | be deprecated, please check issue #662 and either use MustBindWith() if you 22 | want HTTP 400 to be automatically returned if any error occur, of use 23 | ShouldBindWith() if you need to manage the error.`) 24 | return c.MustBindWith(obj, b) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/fs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "net/http" 9 | "os" 10 | ) 11 | 12 | type ( 13 | onlyfilesFS struct { 14 | fs http.FileSystem 15 | } 16 | neuteredReaddirFile struct { 17 | http.File 18 | } 19 | ) 20 | 21 | // Dir returns a http.Filesystem that can be used by http.FileServer(). It is used internally 22 | // in router.Static(). 23 | // if listDirectory == true, then it works the same as http.Dir() otherwise it returns 24 | // a filesystem that prevents http.FileServer() to list the directory files. 25 | func Dir(root string, listDirectory bool) http.FileSystem { 26 | fs := http.Dir(root) 27 | if listDirectory { 28 | return fs 29 | } 30 | return &onlyfilesFS{fs} 31 | } 32 | 33 | // Conforms to http.Filesystem 34 | func (fs onlyfilesFS) Open(name string) (http.File, error) { 35 | f, err := fs.fs.Open(name) 36 | if err != nil { 37 | return nil, err 38 | } 39 | return neuteredReaddirFile{f}, nil 40 | } 41 | 42 | // Overrides the http.File default implementation 43 | func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) { 44 | // this disables directory listing 45 | return nil, nil 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-gadgets/eventsourcing/eeebc8ff0c43b243e4b7a8d8a070c74323e468c2/vendor/github.com/gin-gonic/gin/logo.jpg -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/data.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | type Data struct { 10 | ContentType string 11 | Data []byte 12 | } 13 | 14 | // Render (Data) writes data with custom ContentType 15 | func (r Data) Render(w http.ResponseWriter) (err error) { 16 | r.WriteContentType(w) 17 | _, err = w.Write(r.Data) 18 | return 19 | } 20 | 21 | func (r Data) WriteContentType(w http.ResponseWriter) { 22 | writeContentType(w, []string{r.ContentType}) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "encoding/json" 9 | "net/http" 10 | ) 11 | 12 | type ( 13 | JSON struct { 14 | Data interface{} 15 | } 16 | 17 | IndentedJSON struct { 18 | Data interface{} 19 | } 20 | ) 21 | 22 | var jsonContentType = []string{"application/json; charset=utf-8"} 23 | 24 | func (r JSON) Render(w http.ResponseWriter) (err error) { 25 | if err = WriteJSON(w, r.Data); err != nil { 26 | panic(err) 27 | } 28 | return 29 | } 30 | 31 | func (r JSON) WriteContentType(w http.ResponseWriter) { 32 | writeContentType(w, jsonContentType) 33 | } 34 | 35 | func WriteJSON(w http.ResponseWriter, obj interface{}) error { 36 | writeContentType(w, jsonContentType) 37 | jsonBytes, err := json.Marshal(obj) 38 | if err != nil { 39 | return err 40 | } 41 | w.Write(jsonBytes) 42 | return nil 43 | } 44 | 45 | func (r IndentedJSON) Render(w http.ResponseWriter) error { 46 | r.WriteContentType(w) 47 | jsonBytes, err := json.MarshalIndent(r.Data, "", " ") 48 | if err != nil { 49 | return err 50 | } 51 | w.Write(jsonBytes) 52 | return nil 53 | } 54 | 55 | func (r IndentedJSON) WriteContentType(w http.ResponseWriter) { 56 | writeContentType(w, jsonContentType) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/msgpack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "github.com/ugorji/go/codec" 11 | ) 12 | 13 | type MsgPack struct { 14 | Data interface{} 15 | } 16 | 17 | var msgpackContentType = []string{"application/msgpack; charset=utf-8"} 18 | 19 | func (r MsgPack) WriteContentType(w http.ResponseWriter) { 20 | writeContentType(w, msgpackContentType) 21 | } 22 | 23 | func (r MsgPack) Render(w http.ResponseWriter) error { 24 | return WriteMsgPack(w, r.Data) 25 | } 26 | 27 | func WriteMsgPack(w http.ResponseWriter, obj interface{}) error { 28 | writeContentType(w, msgpackContentType) 29 | var h codec.Handle = new(codec.MsgpackHandle) 30 | return codec.NewEncoder(w, h).Encode(obj) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/redirect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "net/http" 10 | ) 11 | 12 | type Redirect struct { 13 | Code int 14 | Request *http.Request 15 | Location string 16 | } 17 | 18 | func (r Redirect) Render(w http.ResponseWriter) error { 19 | if (r.Code < 300 || r.Code > 308) && r.Code != 201 { 20 | panic(fmt.Sprintf("Cannot redirect with status code %d", r.Code)) 21 | } 22 | http.Redirect(w, r.Request, r.Location, r.Code) 23 | return nil 24 | } 25 | 26 | func (r Redirect) WriteContentType(http.ResponseWriter) {} 27 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/render.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | type Render interface { 10 | Render(http.ResponseWriter) error 11 | WriteContentType(w http.ResponseWriter) 12 | } 13 | 14 | var ( 15 | _ Render = JSON{} 16 | _ Render = IndentedJSON{} 17 | _ Render = XML{} 18 | _ Render = String{} 19 | _ Render = Redirect{} 20 | _ Render = Data{} 21 | _ Render = HTML{} 22 | _ HTMLRender = HTMLDebug{} 23 | _ HTMLRender = HTMLProduction{} 24 | _ Render = YAML{} 25 | _ Render = MsgPack{} 26 | _ Render = MsgPack{} 27 | ) 28 | 29 | func writeContentType(w http.ResponseWriter, value []string) { 30 | header := w.Header() 31 | if val := header["Content-Type"]; len(val) == 0 { 32 | header["Content-Type"] = value 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/text.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | "net/http" 11 | ) 12 | 13 | type String struct { 14 | Format string 15 | Data []interface{} 16 | } 17 | 18 | var plainContentType = []string{"text/plain; charset=utf-8"} 19 | 20 | func (r String) Render(w http.ResponseWriter) error { 21 | WriteString(w, r.Format, r.Data) 22 | return nil 23 | } 24 | 25 | func (r String) WriteContentType(w http.ResponseWriter) { 26 | writeContentType(w, plainContentType) 27 | } 28 | 29 | func WriteString(w http.ResponseWriter, format string, data []interface{}) { 30 | writeContentType(w, plainContentType) 31 | if len(data) > 0 { 32 | fmt.Fprintf(w, format, data...) 33 | } else { 34 | io.WriteString(w, format) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "encoding/xml" 9 | "net/http" 10 | ) 11 | 12 | type XML struct { 13 | Data interface{} 14 | } 15 | 16 | var xmlContentType = []string{"application/xml; charset=utf-8"} 17 | 18 | func (r XML) Render(w http.ResponseWriter) error { 19 | r.WriteContentType(w) 20 | return xml.NewEncoder(w).Encode(r.Data) 21 | } 22 | 23 | func (r XML) WriteContentType(w http.ResponseWriter) { 24 | writeContentType(w, xmlContentType) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/yaml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "gopkg.in/yaml.v2" 11 | ) 12 | 13 | type YAML struct { 14 | Data interface{} 15 | } 16 | 17 | var yamlContentType = []string{"application/x-yaml; charset=utf-8"} 18 | 19 | func (r YAML) Render(w http.ResponseWriter) error { 20 | r.WriteContentType(w) 21 | 22 | bytes, err := yaml.Marshal(r.Data) 23 | if err != nil { 24 | return err 25 | } 26 | 27 | w.Write(bytes) 28 | return nil 29 | } 30 | 31 | func (r YAML) WriteContentType(w http.ResponseWriter) { 32 | writeContentType(w, yamlContentType) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/test_helpers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "net/http" 9 | ) 10 | 11 | func CreateTestContext(w http.ResponseWriter) (c *Context, r *Engine) { 12 | r = New() 13 | c = r.allocateContext() 14 | c.reset() 15 | c.writermem.reset(w) 16 | return 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/wercker.yml: -------------------------------------------------------------------------------- 1 | box: wercker/default -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/.gitignore: -------------------------------------------------------------------------------- 1 | _harness 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go_import_path: github.com/globalsign/mgo 4 | 5 | go: 6 | - 1.8.x 7 | - 1.9.x 8 | 9 | env: 10 | global: 11 | - BUCKET=https://s3.eu-west-2.amazonaws.com/globalsign-mgo 12 | - FASTDL=https://fastdl.mongodb.org/linux 13 | matrix: 14 | - MONGODB=x86_64-ubuntu1404-3.0.15 15 | - MONGODB=x86_64-ubuntu1404-3.2.17 16 | - MONGODB=x86_64-ubuntu1404-3.4.10 17 | - MONGODB=x86_64-ubuntu1404-3.6.0 18 | 19 | install: 20 | 21 | - wget $FASTDL/mongodb-linux-$MONGODB.tgz 22 | - tar xzvf mongodb-linux-$MONGODB.tgz 23 | - export PATH=$PWD/mongodb-linux-$MONGODB/bin:$PATH 24 | 25 | - wget $BUCKET/daemontools.tar.gz 26 | - tar xzvf daemontools.tar.gz 27 | - export PATH=$PWD/daemontools:$PATH 28 | 29 | - go get gopkg.in/check.v1 30 | - go get gopkg.in/yaml.v2 31 | - go get gopkg.in/tomb.v2 32 | - go get github.com/golang/lint/golint 33 | 34 | before_script: 35 | - golint ./... | grep -v 'ID' | cat 36 | - go vet github.com/globalsign/mgo/bson github.com/globalsign/mgo/txn github.com/globalsign/mgo 37 | - export NOIPV6=1 38 | - make startdb 39 | 40 | script: 41 | - (cd bson && go test -check.v) 42 | - go test -check.v -fast 43 | - (cd txn && go test -check.v) 44 | - make stopdb 45 | 46 | git: 47 | depth: 3 48 | 49 | # vim:sw=4:ts=4:et 50 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ------------------------- 3 | 4 | We really appreciate contributions, but they must meet the following requirements: 5 | 6 | * A PR should have a brief description of the problem/feature being proposed 7 | * Pull requests should target the `development` branch 8 | * Existing tests should pass and any new code should be covered with it's own test(s) (use [travis-ci](https://travis-ci.org)) 9 | * New functions should be [documented](https://blog.golang.org/godoc-documenting-go-code) clearly 10 | * Code should pass `golint`, `go vet` and `go fmt` 11 | 12 | We merge PRs into `development`, which is then tested in a sharded, replicated environment in our datacenter for regressions. Once everyone is happy, we merge to master - this is to maintain a bit of quality control past the usual PR process. 13 | 14 | **Thanks** for helping! 15 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/Makefile: -------------------------------------------------------------------------------- 1 | startdb: 2 | @harness/setup.sh start 3 | 4 | stopdb: 5 | @harness/setup.sh stop 6 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/bson/compatibility.go: -------------------------------------------------------------------------------- 1 | package bson 2 | 3 | // Current state of the JSON tag fallback option. 4 | var useJSONTagFallback = false 5 | 6 | // SetJSONTagFallback enables or disables the JSON-tag fallback for structure tagging. When this is enabled, structures 7 | // without BSON tags on a field will fall-back to using the JSON tag (if present). 8 | func SetJSONTagFallback(state bool) { 9 | useJSONTagFallback = state 10 | } 11 | 12 | // JSONTagFallbackState returns the current status of the JSON tag fallback compatability option. See SetJSONTagFallback 13 | // for more information. 14 | func JSONTagFallbackState() bool { 15 | return useJSONTagFallback 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/doc.go: -------------------------------------------------------------------------------- 1 | // Package mgo offers a rich MongoDB driver for Go. 2 | // 3 | // Details about the mgo project (pronounced as "mango") are found 4 | // in its web page: 5 | // 6 | // http://labix.org/mgo 7 | // 8 | // Usage of the driver revolves around the concept of sessions. To 9 | // get started, obtain a session using the Dial function: 10 | // 11 | // session, err := mgo.Dial(url) 12 | // 13 | // This will establish one or more connections with the cluster of 14 | // servers defined by the url parameter. From then on, the cluster 15 | // may be queried with multiple consistency rules (see SetMode) and 16 | // documents retrieved with statements such as: 17 | // 18 | // c := session.DB(database).C(collection) 19 | // err := c.Find(query).One(&result) 20 | // 21 | // New sessions are typically created by calling session.Copy on the 22 | // initial session obtained at dial time. These new sessions will share 23 | // the same cluster information and connection pool, and may be easily 24 | // handed into other methods and functions for organizing logic. 25 | // Every session created must have its Close method called at the end 26 | // of its life time, so its resources may be put back in the pool or 27 | // collected, depending on the case. 28 | // 29 | // For more details, see the documentation for the types and methods. 30 | // 31 | package mgo 32 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/internal/json/tags.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 json 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // tagOptions is the string following a comma in a struct field's "json" 12 | // tag, or the empty string. It does not include the leading comma. 13 | type tagOptions string 14 | 15 | // parseTag splits a struct field's json tag into its name and 16 | // comma-separated options. 17 | func parseTag(tag string) (string, tagOptions) { 18 | if idx := strings.Index(tag, ","); idx != -1 { 19 | return tag[:idx], tagOptions(tag[idx+1:]) 20 | } 21 | return tag, tagOptions("") 22 | } 23 | 24 | // Contains reports whether a comma-separated list of options 25 | // contains a particular substr flag. substr must be surrounded by a 26 | // string boundary or commas. 27 | func (o tagOptions) Contains(optionName string) bool { 28 | if len(o) == 0 { 29 | return false 30 | } 31 | s := string(o) 32 | for s != "" { 33 | var next string 34 | i := strings.Index(s, ",") 35 | if i >= 0 { 36 | s, next = s[:i], s[i+1:] 37 | } 38 | if s == optionName { 39 | return true 40 | } 41 | s = next 42 | } 43 | return false 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/internal/sasl/sasl_windows.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "sspi_windows.h" 4 | 5 | SECURITY_STATUS SEC_ENTRY sspi_acquire_credentials_handle(CredHandle* cred_handle, char* username, char* password, char* domain); 6 | int sspi_step(CredHandle* cred_handle, int has_context, CtxtHandle* context, PVOID buffer, ULONG buffer_length, PVOID* out_buffer, ULONG* out_buffer_length, char* target); 7 | int sspi_send_client_authz_id(CtxtHandle* context, PVOID* buffer, ULONG* buffer_length, char* user_plus_realm); 8 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/raceoff.go: -------------------------------------------------------------------------------- 1 | // +build !race 2 | 3 | package mgo 4 | 5 | const raceDetector = false 6 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/raceon.go: -------------------------------------------------------------------------------- 1 | // +build race 2 | 3 | package mgo 4 | 5 | const raceDetector = true 6 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/saslimpl.go: -------------------------------------------------------------------------------- 1 | //+build sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "github.com/globalsign/mgo/internal/sasl" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return sasl.New(cred.Username, cred.Password, cred.Mechanism, cred.Service, host) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/saslstub.go: -------------------------------------------------------------------------------- 1 | //+build !sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return nil, fmt.Errorf("SASL support not enabled during build (-tags sasl)") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ini/ini/.gitignore: -------------------------------------------------------------------------------- 1 | testdata/conf_out.ini 2 | ini.sublime-project 3 | ini.sublime-workspace 4 | testdata/conf_reflect.ini 5 | .idea 6 | /.vscode 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-ini/ini/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.5.x 5 | - 1.6.x 6 | - 1.7.x 7 | - 1.8.x 8 | - 1.9.x 9 | - 1.10.x 10 | 11 | script: 12 | - go get golang.org/x/tools/cmd/cover 13 | - go get github.com/smartystreets/goconvey 14 | - mkdir -p $HOME/gopath/src/gopkg.in 15 | - ln -s $HOME/gopath/src/github.com/go-ini/ini $HOME/gopath/src/gopkg.in/ini.v1 16 | - go test -v -cover -race 17 | -------------------------------------------------------------------------------- /vendor/github.com/go-ini/ini/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: build test bench vet coverage 2 | 3 | build: vet bench 4 | 5 | test: 6 | go test -v -cover -race 7 | 8 | bench: 9 | go test -v -cover -race -test.bench=. -test.benchmem 10 | 11 | vet: 12 | go vet 13 | 14 | coverage: 15 | go test -coverprofile=c.out && go tool cover -html=c.out && rm c.out 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-ini/ini/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // 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, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | import ( 18 | "fmt" 19 | ) 20 | 21 | type ErrDelimiterNotFound struct { 22 | Line string 23 | } 24 | 25 | func IsErrDelimiterNotFound(err error) bool { 26 | _, ok := err.(ErrDelimiterNotFound) 27 | return ok 28 | } 29 | 30 | func (err ErrDelimiterNotFound) Error() string { 31 | return fmt.Sprintf("key-value delimiter not found: %s", err.Line) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/.gitignore: -------------------------------------------------------------------------------- 1 | *.rdb 2 | testdata/*/ 3 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | services: 5 | - redis-server 6 | 7 | go: 8 | - 1.7.x 9 | - 1.8.x 10 | - 1.9.x 11 | - 1.10.x 12 | - tip 13 | 14 | matrix: 15 | allow_failures: 16 | - go: tip 17 | 18 | install: 19 | - go get github.com/onsi/ginkgo 20 | - go get github.com/onsi/gomega 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/Makefile: -------------------------------------------------------------------------------- 1 | all: testdeps 2 | go test ./... 3 | go test ./... -short -race 4 | env GOOS=linux GOARCH=386 go test ./... 5 | go vet 6 | 7 | testdeps: testdata/redis/src/redis-server 8 | 9 | bench: testdeps 10 | go test ./... -test.run=NONE -test.bench=. -test.benchmem 11 | 12 | .PHONY: all test testdeps bench 13 | 14 | testdata/redis: 15 | mkdir -p $@ 16 | wget -qO- https://github.com/antirez/redis/archive/unstable.tar.gz | tar xvz --strip-components=1 -C $@ 17 | 18 | testdata/redis/src/redis-server: testdata/redis 19 | sed -i.bak 's/libjemalloc.a/libjemalloc.a -lrt/g' $ maxBackoff || backoff < minBackoff { 17 | backoff = maxBackoff 18 | } 19 | 20 | if backoff == 0 { 21 | return 0 22 | } 23 | return time.Duration(rand.Int63n(int64(backoff))) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/log.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | ) 7 | 8 | var Logger *log.Logger 9 | 10 | func Logf(s string, args ...interface{}) { 11 | if Logger == nil { 12 | return 13 | } 14 | Logger.Output(2, fmt.Sprintf(s, args...)) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/pool/pool_single.go: -------------------------------------------------------------------------------- 1 | package pool 2 | 3 | type SingleConnPool struct { 4 | cn *Conn 5 | } 6 | 7 | var _ Pooler = (*SingleConnPool)(nil) 8 | 9 | func NewSingleConnPool(cn *Conn) *SingleConnPool { 10 | return &SingleConnPool{ 11 | cn: cn, 12 | } 13 | } 14 | 15 | func (p *SingleConnPool) NewConn() (*Conn, error) { 16 | panic("not implemented") 17 | } 18 | 19 | func (p *SingleConnPool) CloseConn(*Conn) error { 20 | panic("not implemented") 21 | } 22 | 23 | func (p *SingleConnPool) Get() (*Conn, bool, error) { 24 | return p.cn, false, nil 25 | } 26 | 27 | func (p *SingleConnPool) Put(cn *Conn) error { 28 | if p.cn != cn { 29 | panic("p.cn != cn") 30 | } 31 | return nil 32 | } 33 | 34 | func (p *SingleConnPool) Remove(cn *Conn) error { 35 | if p.cn != cn { 36 | panic("p.cn != cn") 37 | } 38 | return nil 39 | } 40 | 41 | func (p *SingleConnPool) Len() int { 42 | return 1 43 | } 44 | 45 | func (p *SingleConnPool) FreeLen() int { 46 | return 0 47 | } 48 | 49 | func (p *SingleConnPool) Stats() *Stats { 50 | return nil 51 | } 52 | 53 | func (p *SingleConnPool) Close() error { 54 | return nil 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/util.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import "github.com/go-redis/redis/internal/util" 4 | 5 | func ToLower(s string) string { 6 | if isLower(s) { 7 | return s 8 | } 9 | 10 | b := make([]byte, len(s)) 11 | for i := range b { 12 | c := s[i] 13 | if c >= 'A' && c <= 'Z' { 14 | c += 'a' - 'A' 15 | } 16 | b[i] = c 17 | } 18 | return util.BytesToString(b) 19 | } 20 | 21 | func isLower(s string) bool { 22 | for i := 0; i < len(s); i++ { 23 | c := s[i] 24 | if c >= 'A' && c <= 'Z' { 25 | return false 26 | } 27 | } 28 | return true 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/util/safe.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package util 4 | 5 | func BytesToString(b []byte) string { 6 | return string(b) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/util/strconv.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "strconv" 4 | 5 | func Atoi(b []byte) (int, error) { 6 | return strconv.Atoi(BytesToString(b)) 7 | } 8 | 9 | func ParseInt(b []byte, base int, bitSize int) (int64, error) { 10 | return strconv.ParseInt(BytesToString(b), base, bitSize) 11 | } 12 | 13 | func ParseUint(b []byte, base int, bitSize int) (uint64, error) { 14 | return strconv.ParseUint(BytesToString(b), base, bitSize) 15 | } 16 | 17 | func ParseFloat(b []byte, bitSize int) (float64, error) { 18 | return strconv.ParseFloat(BytesToString(b), bitSize) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-redis/redis/internal/util/unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package util 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // BytesToString converts byte slice to string. 10 | func BytesToString(b []byte) string { 11 | return *(*string)(unsafe.Pointer(&b)) 12 | } 13 | -------------------------------------------------------------------------------- /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/decode_amd64.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 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_amd64.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 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) 30 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/cmpopts/sort_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build !go1.8 6 | 7 | package cmpopts 8 | 9 | import ( 10 | "reflect" 11 | "sort" 12 | ) 13 | 14 | const hasReflectStructOf = false 15 | 16 | func mapEntryType(reflect.Type) reflect.Type { 17 | return reflect.TypeOf(struct{ K, V interface{} }{}) 18 | } 19 | 20 | func sliceIsSorted(slice interface{}, less func(i, j int) bool) bool { 21 | return sort.IsSorted(reflectSliceSorter{reflect.ValueOf(slice), less}) 22 | } 23 | func sortSlice(slice interface{}, less func(i, j int) bool) { 24 | sort.Sort(reflectSliceSorter{reflect.ValueOf(slice), less}) 25 | } 26 | func sortSliceStable(slice interface{}, less func(i, j int) bool) { 27 | sort.Stable(reflectSliceSorter{reflect.ValueOf(slice), less}) 28 | } 29 | 30 | type reflectSliceSorter struct { 31 | slice reflect.Value 32 | less func(i, j int) bool 33 | } 34 | 35 | func (ss reflectSliceSorter) Len() int { 36 | return ss.slice.Len() 37 | } 38 | func (ss reflectSliceSorter) Less(i, j int) bool { 39 | return ss.less(i, j) 40 | } 41 | func (ss reflectSliceSorter) Swap(i, j int) { 42 | vi := ss.slice.Index(i).Interface() 43 | vj := ss.slice.Index(j).Interface() 44 | ss.slice.Index(i).Set(reflect.ValueOf(vj)) 45 | ss.slice.Index(j).Set(reflect.ValueOf(vi)) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/cmpopts/sort_go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build go1.8 6 | 7 | package cmpopts 8 | 9 | import ( 10 | "reflect" 11 | "sort" 12 | ) 13 | 14 | const hasReflectStructOf = true 15 | 16 | func mapEntryType(t reflect.Type) reflect.Type { 17 | return reflect.StructOf([]reflect.StructField{ 18 | {Name: "K", Type: t.Key()}, 19 | {Name: "V", Type: t.Elem()}, 20 | }) 21 | } 22 | 23 | func sliceIsSorted(slice interface{}, less func(i, j int) bool) bool { 24 | return sort.SliceIsSorted(slice, less) 25 | } 26 | func sortSlice(slice interface{}, less func(i, j int) bool) { 27 | sort.Slice(slice, less) 28 | } 29 | func sortSliceStable(slice interface{}, less func(i, j int) bool) { 30 | sort.SliceStable(slice, less) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/internal/diff/debug_disable.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build !debug 6 | 7 | package diff 8 | 9 | var debug debugger 10 | 11 | type debugger struct{} 12 | 13 | func (debugger) Begin(_, _ int, f EqualFunc, _, _ *EditScript) EqualFunc { 14 | return f 15 | } 16 | func (debugger) Update() {} 17 | func (debugger) Finish() {} 18 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/unsafe_panic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build purego appengine js 6 | 7 | package cmp 8 | 9 | import "reflect" 10 | 11 | const supportAllowUnexported = false 12 | 13 | func unsafeRetrieveField(reflect.Value, reflect.StructField) reflect.Value { 14 | panic("unsafeRetrieveField is not implemented") 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/google/go-cmp/cmp/unsafe_reflect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017, The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE.md file. 4 | 5 | // +build !purego,!appengine,!js 6 | 7 | package cmp 8 | 9 | import ( 10 | "reflect" 11 | "unsafe" 12 | ) 13 | 14 | const supportAllowUnexported = true 15 | 16 | // unsafeRetrieveField uses unsafe to forcibly retrieve any field from a struct 17 | // such that the value has read-write permissions. 18 | // 19 | // The parent struct, v, must be addressable, while f must be a StructField 20 | // describing the field to retrieve. 21 | func unsafeRetrieveField(v reflect.Value, f reflect.StructField) reflect.Value { 22 | return reflect.NewAt(f.Type, unsafe.Pointer(v.UnsafeAddr()+f.Offset)).Elem() 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/.gitignore: -------------------------------------------------------------------------------- 1 | jpgo 2 | jmespath-fuzz.zip 3 | cpu.out 4 | go-jmespath.test 5 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | go: 6 | - 1.4 7 | 8 | install: go get -v -t ./... 9 | script: make test 10 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CMD = jpgo 3 | 4 | help: 5 | @echo "Please use \`make ' where is one of" 6 | @echo " test to run all the tests" 7 | @echo " build to build the library and jp executable" 8 | @echo " generate to run codegen" 9 | 10 | 11 | generate: 12 | go generate ./... 13 | 14 | build: 15 | rm -f $(CMD) 16 | go build ./... 17 | rm -f cmd/$(CMD)/$(CMD) && cd cmd/$(CMD)/ && go build ./... 18 | mv cmd/$(CMD)/$(CMD) . 19 | 20 | test: 21 | go test -v ./... 22 | 23 | check: 24 | go vet ./... 25 | @echo "golint ./..." 26 | @lint=`golint ./...`; \ 27 | lint=`echo "$$lint" | grep -v "astnodetype_string.go" | grep -v "toktype_string.go"`; \ 28 | echo "$$lint"; \ 29 | if [ "$$lint" != "" ]; then exit 1; fi 30 | 31 | htmlc: 32 | go test -coverprofile="/tmp/jpcov" && go tool cover -html="/tmp/jpcov" && unlink /tmp/jpcov 33 | 34 | buildfuzz: 35 | go-fuzz-build github.com/jmespath/go-jmespath/fuzz 36 | 37 | fuzz: buildfuzz 38 | go-fuzz -bin=./jmespath-fuzz.zip -workdir=fuzz/testdata 39 | 40 | bench: 41 | go test -bench . -cpuprofile cpu.out 42 | 43 | pprof-cpu: 44 | go tool pprof ./go-jmespath.test ./cpu.out 45 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/README.md: -------------------------------------------------------------------------------- 1 | # go-jmespath - A JMESPath implementation in Go 2 | 3 | [![Build Status](https://img.shields.io/travis/jmespath/go-jmespath.svg)](https://travis-ci.org/jmespath/go-jmespath) 4 | 5 | 6 | 7 | See http://jmespath.org for more info. 8 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/astnodetype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type astNodeType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _astNodeType_name = "ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection" 8 | 9 | var _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307} 10 | 11 | func (i astNodeType) String() string { 12 | if i < 0 || i >= astNodeType(len(_astNodeType_index)-1) { 13 | return fmt.Sprintf("astNodeType(%d)", i) 14 | } 15 | return _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/toktype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=tokType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF" 8 | 9 | var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214} 10 | 11 | func (i tokType) String() string { 12 | if i < 0 || i >= tokType(len(_tokType_index)-1) { 13 | return fmt.Sprintf("tokType(%d)", i) 14 | } 15 | return _tokType_name[_tokType_index[i]:_tokType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | 5 | before_install: 6 | - go get github.com/mattn/goveralls 7 | - go get golang.org/x/tools/cmd/cover 8 | script: 9 | - $HOME/gopath/bin/goveralls -repotoken 3gHdORO5k5ziZcWMBxnd9LrMZaJs8m9x5 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4 | [![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) 5 | [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 | 8 | isatty for golang 9 | 10 | ## Usage 11 | 12 | ```go 13 | package main 14 | 15 | import ( 16 | "fmt" 17 | "github.com/mattn/go-isatty" 18 | "os" 19 | ) 20 | 21 | func main() { 22 | if isatty.IsTerminal(os.Stdout.Fd()) { 23 | fmt.Println("Is Terminal") 24 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 | fmt.Println("Is Cygwin/MSYS2 Terminal") 26 | } else { 27 | fmt.Println("Is Not Terminal") 28 | } 29 | } 30 | ``` 31 | 32 | ## Installation 33 | 34 | ``` 35 | $ go get github.com/mattn/go-isatty 36 | ``` 37 | 38 | ## License 39 | 40 | MIT 41 | 42 | ## Author 43 | 44 | Yasuhiro Matsumoto (a.k.a mattn) 45 | 46 | ## Thanks 47 | 48 | * k-takata: base idea for IsCygwinTerminal 49 | 50 | https://github.com/k-takata/go-iscygpty 51 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | 11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 12 | // terminal. This is also always false on this environment. 13 | func IsCygwinTerminal(fd uintptr) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine,!ppc64,!ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build ppc64 ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "unsafe" 8 | 9 | syscall "golang.org/x/sys/unix" 10 | ) 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var termios syscall.Termios 17 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 18 | return err == 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 7 | // terminal. This is also always false on this environment. 8 | func IsCygwinTerminal(fd uintptr) bool { 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.9.x 5 | - tip 6 | 7 | script: 8 | - go test 9 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/error.go: -------------------------------------------------------------------------------- 1 | package mapstructure 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "sort" 7 | "strings" 8 | ) 9 | 10 | // Error implements the error interface and can represents multiple 11 | // errors that occur in the course of a single decode. 12 | type Error struct { 13 | Errors []string 14 | } 15 | 16 | func (e *Error) Error() string { 17 | points := make([]string, len(e.Errors)) 18 | for i, err := range e.Errors { 19 | points[i] = fmt.Sprintf("* %s", err) 20 | } 21 | 22 | sort.Strings(points) 23 | return fmt.Sprintf( 24 | "%d error(s) decoding:\n\n%s", 25 | len(e.Errors), strings.Join(points, "\n")) 26 | } 27 | 28 | // WrappedErrors implements the errwrap.Wrapper interface to make this 29 | // return value more useful with the errwrap and go-multierror libraries. 30 | func (e *Error) WrappedErrors() []error { 31 | if e == nil { 32 | return nil 33 | } 34 | 35 | result := make([]error, len(e.Errors)) 36 | for i, e := range e.Errors { 37 | result[i] = errors.New(e) 38 | } 39 | 40 | return result 41 | } 42 | 43 | func appendErrors(errors []string, err error) []string { 44 | switch e := err.(type) { 45 | case *Error: 46 | return append(errors, e.Errors...) 47 | default: 48 | return append(errors, e.Error()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/.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 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | 6 | script: 7 | - go test -v -cpu=2 8 | - go test -v -cpu=2 -race -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.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/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.4.3 5 | - 1.5.4 6 | - 1.6.2 7 | - 1.7.1 8 | - tip 9 | 10 | script: 11 | - go test -v ./... 12 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /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.2 5 | - 1.3 6 | - 1.4 7 | - 1.5 8 | - 1.6 9 | - 1.7 10 | - 1.8 11 | - 1.9 12 | 13 | script: 14 | - ./validate.sh 15 | 16 | # this should give us faster builds according to 17 | # http://docs.travis-ci.com/user/migrating-from-legacy/ 18 | sudo: false 19 | -------------------------------------------------------------------------------- /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/rwynn/gtm/.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 | -------------------------------------------------------------------------------- /vendor/github.com/satori/go.uuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.2 5 | - 1.3 6 | - 1.4 7 | - 1.5 8 | - 1.6 9 | - 1.7 10 | - 1.8 11 | - 1.9 12 | - tip 13 | matrix: 14 | allow_failures: 15 | - go: tip 16 | fast_finish: true 17 | before_install: 18 | - go get github.com/mattn/goveralls 19 | - go get golang.org/x/tools/cmd/cover 20 | script: 21 | - $HOME/gopath/bin/goveralls -service=travis-ci 22 | notifications: 23 | email: false 24 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.6.x 4 | - 1.7.x 5 | - 1.8.x 6 | - tip 7 | env: 8 | - GOMAXPROCS=4 GORACE=halt_on_error=1 9 | install: 10 | - go get github.com/stretchr/testify/assert 11 | - go get gopkg.in/gemnasium/logrus-airbrake-hook.v2 12 | - go get golang.org/x/sys/unix 13 | - go get golang.org/x/sys/windows 14 | script: 15 | - go test -race -v ./... 16 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | platform: x64 3 | clone_folder: c:\gopath\src\github.com\sirupsen\logrus 4 | environment: 5 | GOPATH: c:\gopath 6 | branches: 7 | only: 8 | - master 9 | install: 10 | - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% 11 | - go version 12 | build_script: 13 | - go get -t 14 | - go test 15 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/hooks.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | // A hook to be fired when logging on the logging levels returned from 4 | // `Levels()` on your implementation of the interface. Note that this is not 5 | // fired in a goroutine or a channel with workers, you should handle such 6 | // functionality yourself if your call is non-blocking and you don't wish for 7 | // the logging calls for levels returned from `Levels()` to block. 8 | type Hook interface { 9 | Levels() []Level 10 | Fire(*Entry) error 11 | } 12 | 13 | // Internal type for storing the hooks on a logger instance. 14 | type LevelHooks map[Level][]Hook 15 | 16 | // Add a hook to an instance of logger. This is called with 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. 18 | func (hooks LevelHooks) Add(hook Hook) { 19 | for _, level := range hook.Levels() { 20 | hooks[level] = append(hooks[level], hook) 21 | } 22 | } 23 | 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire 25 | // appropriate hooks for a log entry. 26 | func (hooks LevelHooks) Fire(level Level, entry *Entry) error { 27 | for _, hook := range hooks[level] { 28 | if err := hook.Fire(entry); err != nil { 29 | return err 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine,!gopherjs 3 | 4 | package logrus 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | const ioctlReadTermios = unix.TIOCGETA 9 | 10 | type Termios unix.Termios 11 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine gopherjs 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!gopherjs 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | "golang.org/x/crypto/ssh/terminal" 10 | ) 11 | 12 | func checkIfTerminal(w io.Writer) bool { 13 | switch v := w.(type) { 14 | case *os.File: 15 | return terminal.IsTerminal(int(v.Fd())) 16 | default: 17 | return false 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine,!gopherjs 7 | 8 | package logrus 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | const ioctlReadTermios = unix.TCGETS 13 | 14 | type Termios unix.Termios 15 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /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 go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = true 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | return reflect.ArrayOf(count, elem) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = false 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | panic("codec: reflect.ArrayOf unsupported in this go version") 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | if size < 0 { 12 | return reflect.MakeMapWithSize(t, 4) 13 | } 14 | return reflect.MakeMapWithSize(t, size) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | return reflect.MakeMap(t) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = false 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = true 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.4 5 | 6 | package codec 7 | 8 | // This codec package will only work for go1.4 and above. 9 | // This is for the following reasons: 10 | // - go 1.4 was released in 2014 11 | // - go runtime is written fully in go 12 | // - interface only holds pointers 13 | // - reflect.Value is stabilized as 3 words 14 | 15 | func init() { 16 | panic("codec: go 1.3 and below are not supported") 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5,!go1.6 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" 11 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.6,!go1.7 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" 11 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.7 5 | 6 | package codec 7 | 8 | const genCheckVendor = true 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | var genCheckVendor = false 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 23 | BL runtime·entersyscall(SB) 24 | MOVW trap+0(FP), R7 25 | MOVW a1+4(FP), R0 26 | MOVW a2+8(FP), R1 27 | MOVW a3+12(FP), R2 28 | MOVW $0, R3 29 | MOVW $0, R4 30 | MOVW $0, R5 31 | SWI $0 32 | MOVW R0, r1+16(FP) 33 | MOVW $0, R0 34 | MOVW R0, r2+20(FP) 35 | BL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | B syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | B syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW trap+0(FP), R7 // syscall entry 46 | MOVW a1+4(FP), R0 47 | MOVW a2+8(FP), R1 48 | MOVW a3+12(FP), R2 49 | SWI $0 50 | MOVW R0, r1+16(FP) 51 | MOVW $0, R0 52 | MOVW R0, r2+20(FP) 53 | RET 54 | 55 | TEXT ·seek(SB),NOSPLIT,$0-28 56 | B syscall·seek(SB) 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 21 | BL runtime·entersyscall(SB) 22 | MOVD a1+8(FP), R0 23 | MOVD a2+16(FP), R1 24 | MOVD a3+24(FP), R2 25 | MOVD $0, R3 26 | MOVD $0, R4 27 | MOVD $0, R5 28 | MOVD trap+0(FP), R8 // syscall entry 29 | SVC 30 | MOVD R0, r1+32(FP) // r1 31 | MOVD R1, r2+40(FP) // r2 32 | BL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | B syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | B syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOVD a1+8(FP), R0 43 | MOVD a2+16(FP), R1 44 | MOVD a3+24(FP), R2 45 | MOVD $0, R3 46 | MOVD $0, R4 47 | MOVD $0, R5 48 | MOVD trap+0(FP), R8 // syscall entry 49 | SVC 50 | MOVD R0, r1+32(FP) 51 | MOVD R1, r2+40(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | JAL runtime·entersyscall(SB) 26 | MOVV a1+8(FP), R4 27 | MOVV a2+16(FP), R5 28 | MOVV a3+24(FP), R6 29 | MOVV R0, R7 30 | MOVV R0, R8 31 | MOVV R0, R9 32 | MOVV trap+0(FP), R2 // syscall entry 33 | SYSCALL 34 | MOVV R2, r1+32(FP) 35 | MOVV R3, r2+40(FP) 36 | JAL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | JMP syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | JMP syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVV a1+8(FP), R4 47 | MOVV a2+16(FP), R5 48 | MOVV a3+24(FP), R6 49 | MOVV R0, R7 50 | MOVV R0, R8 51 | MOVV R0, R9 52 | MOVV trap+0(FP), R2 // syscall entry 53 | SYSCALL 54 | MOVV R2, r1+32(FP) 55 | MOVV R3, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 28 | JAL runtime·entersyscall(SB) 29 | MOVW a1+4(FP), R4 30 | MOVW a2+8(FP), R5 31 | MOVW a3+12(FP), R6 32 | MOVW R0, R7 33 | MOVW trap+0(FP), R2 // syscall entry 34 | SYSCALL 35 | MOVW R2, r1+16(FP) // r1 36 | MOVW R3, r2+20(FP) // r2 37 | JAL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 47 | MOVW a1+4(FP), R4 48 | MOVW a2+8(FP), R5 49 | MOVW a3+12(FP), R6 50 | MOVW trap+0(FP), R2 // syscall entry 51 | SYSCALL 52 | MOVW R2, r1+16(FP) 53 | MOVW R3, r2+20(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | BL runtime·entersyscall(SB) 26 | MOVD a1+8(FP), R2 27 | MOVD a2+16(FP), R3 28 | MOVD a3+24(FP), R4 29 | MOVD $0, R5 30 | MOVD $0, R6 31 | MOVD $0, R7 32 | MOVD trap+0(FP), R1 // syscall entry 33 | SYSCALL 34 | MOVD R2, r1+32(FP) 35 | MOVD R3, r2+40(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | BR syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | BR syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVD a1+8(FP), R2 47 | MOVD a2+16(FP), R3 48 | MOVD a3+24(FP), R4 49 | MOVD $0, R5 50 | MOVD $0, R6 51 | MOVD $0, R7 52 | MOVD trap+0(FP), R1 // syscall entry 53 | SYSCALL 54 | MOVD R2, r1+32(FP) 55 | MOVD R3, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 16 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 17 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 18 | if errno == 0 { 19 | return nil 20 | } 21 | return errno 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $3; 33 | my $name = $4; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build gccgo 7 | // +build 386 arm 8 | 9 | package unix 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) { 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err = Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | 25 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 26 | // TODO(aram): implement this, see issue 5847. 27 | panic("unimplemented") 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracearm_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build arm arm64 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsArm is the registers used by arm binaries. 11 | type PtraceRegsArm struct { 12 | Uregs [18]uint32 13 | } 14 | 15 | // PtraceGetRegsArm fetches the registers used by arm binaries. 16 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 17 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 18 | } 19 | 20 | // PtraceSetRegsArm sets the registers used by arm binaries. 21 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 22 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 23 | } 24 | 25 | // PtraceRegsArm64 is the registers used by arm64 binaries. 26 | type PtraceRegsArm64 struct { 27 | Regs [31]uint64 28 | Sp uint64 29 | Pc uint64 30 | Pstate uint64 31 | } 32 | 33 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 34 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 35 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 36 | } 37 | 38 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 39 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 40 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-8 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-4 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-8 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | 27 | func Unsetenv(key string) error { 28 | return syscall.Unsetenv(key) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/go-playground/validator.v8/.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 | *.test 26 | *.out 27 | *.txt 28 | cover.html 29 | README.html -------------------------------------------------------------------------------- /vendor/gopkg.in/go-playground/validator.v8/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/go-gadgets/eventsourcing/eeebc8ff0c43b243e4b7a8d8a070c74323e468c2/vendor/gopkg.in/go-playground/validator.v8/logo.png -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4 5 | - 1.5 6 | - 1.6 7 | - 1.7 8 | - 1.8 9 | - 1.9 10 | - tip 11 | 12 | go_import_path: gopkg.in/yaml.v2 13 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/go.mod: -------------------------------------------------------------------------------- 1 | module "gopkg.in/yaml.v2" 2 | 3 | require ( 4 | "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 5 | ) 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | --------------------------------------------------------------------------------