├── README.md ├── client └── client.go ├── constant └── constant.go ├── examples ├── client │ └── client_example.go ├── gateway │ ├── gateway │ ├── gateway_example.go │ ├── server.key │ └── server.pem ├── pb │ ├── example.pb.go │ ├── example.pb.gw.go │ └── example.proto └── server │ └── server_example.go ├── grpc_error └── error.go ├── plugin ├── breaker │ ├── circuitbreaker.go │ ├── circuitbreaker_test.go │ ├── client.go │ ├── example_test.go │ ├── interceptor.go │ ├── panel.go │ ├── panel_test.go │ ├── window.go │ └── window_test.go ├── loadbalance │ └── registry │ │ └── etcd │ │ ├── registry.go │ │ ├── resolver.go │ │ └── watcher.go ├── prometheus │ ├── client.go │ ├── client_metrics.go │ ├── client_reporter.go │ ├── client_test.go │ ├── metric_options.go │ ├── server.go │ ├── server_metrics.go │ ├── server_reporter.go │ ├── server_test.go │ └── util.go ├── ratelimit │ ├── interceptor.go │ ├── ratelimit.go │ └── ratelimit_test.go └── tracing │ ├── client.go │ ├── errors.go │ ├── errors_test.go │ ├── options.go │ ├── package.go │ ├── server.go │ └── shared.go ├── server └── server.go └── vendor ├── github.com ├── Shopify │ └── sarama │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── Vagrantfile │ │ ├── acl_bindings.go │ │ ├── acl_create_request.go │ │ ├── acl_create_response.go │ │ ├── acl_delete_request.go │ │ ├── acl_delete_response.go │ │ ├── acl_describe_request.go │ │ ├── acl_describe_response.go │ │ ├── acl_filter.go │ │ ├── acl_types.go │ │ ├── add_offsets_to_txn_request.go │ │ ├── add_offsets_to_txn_response.go │ │ ├── add_partitions_to_txn_request.go │ │ ├── add_partitions_to_txn_response.go │ │ ├── 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_records_request.go │ │ ├── delete_records_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 │ │ ├── find_coordinator_request.go │ │ ├── find_coordinator_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 ├── apache │ └── thrift │ │ └── lib │ │ └── go │ │ └── thrift │ │ ├── application_exception.go │ │ ├── binary_protocol.go │ │ ├── buffered_transport.go │ │ ├── client.go │ │ ├── compact_protocol.go │ │ ├── context.go │ │ ├── debug_protocol.go │ │ ├── deserializer.go │ │ ├── exception.go │ │ ├── field.go │ │ ├── framed_transport.go │ │ ├── http_client.go │ │ ├── http_transport.go │ │ ├── iostream_transport.go │ │ ├── json_protocol.go │ │ ├── memory_buffer.go │ │ ├── messagetype.go │ │ ├── multiplexed_protocol.go │ │ ├── numeric.go │ │ ├── pointerize.go │ │ ├── processor_factory.go │ │ ├── protocol.go │ │ ├── protocol_exception.go │ │ ├── protocol_factory.go │ │ ├── rich_transport.go │ │ ├── serializer.go │ │ ├── server.go │ │ ├── server_socket.go │ │ ├── server_transport.go │ │ ├── simple_json_protocol.go │ │ ├── simple_server.go │ │ ├── socket.go │ │ ├── ssl_server_socket.go │ │ ├── ssl_socket.go │ │ ├── transport.go │ │ ├── transport_exception.go │ │ ├── transport_factory.go │ │ ├── type.go │ │ └── zlib_transport.go ├── beorn7 │ └── perks │ │ ├── LICENSE │ │ └── quantile │ │ ├── exampledata.txt │ │ └── stream.go ├── cenk │ └── backoff │ │ ├── LICENSE │ │ ├── README.md │ │ ├── backoff.go │ │ ├── context.go │ │ ├── exponential.go │ │ ├── retry.go │ │ ├── ticker.go │ │ └── tries.go ├── chuangyou │ └── rsa │ │ └── rsa.go ├── coreos │ ├── etcd │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── auth │ │ │ └── authpb │ │ │ │ ├── auth.pb.go │ │ │ │ └── auth.proto │ │ ├── clientv3 │ │ │ ├── README.md │ │ │ ├── auth.go │ │ │ ├── balancer │ │ │ │ ├── doc.go │ │ │ │ └── grpc1.7-health.go │ │ │ ├── client.go │ │ │ ├── cluster.go │ │ │ ├── compact_op.go │ │ │ ├── compare.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── kv.go │ │ │ ├── lease.go │ │ │ ├── logger.go │ │ │ ├── maintenance.go │ │ │ ├── op.go │ │ │ ├── options.go │ │ │ ├── ready_wait.go │ │ │ ├── retry.go │ │ │ ├── sort.go │ │ │ ├── txn.go │ │ │ └── watch.go │ │ ├── etcdserver │ │ │ ├── api │ │ │ │ └── v3rpc │ │ │ │ │ └── rpctypes │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── error.go │ │ │ │ │ ├── md.go │ │ │ │ │ └── metadatafields.go │ │ │ └── etcdserverpb │ │ │ │ ├── etcdserver.pb.go │ │ │ │ ├── etcdserver.proto │ │ │ │ ├── raft_internal.pb.go │ │ │ │ ├── raft_internal.proto │ │ │ │ ├── rpc.pb.go │ │ │ │ └── rpc.proto │ │ ├── mvcc │ │ │ └── mvccpb │ │ │ │ ├── kv.pb.go │ │ │ │ └── kv.proto │ │ ├── pkg │ │ │ ├── logutil │ │ │ │ ├── discard_logger.go │ │ │ │ ├── doc.go │ │ │ │ ├── logger.go │ │ │ │ ├── merge_logger.go │ │ │ │ ├── package_logger.go │ │ │ │ └── zap.go │ │ │ └── types │ │ │ │ ├── doc.go │ │ │ │ ├── id.go │ │ │ │ ├── set.go │ │ │ │ ├── slice.go │ │ │ │ ├── urls.go │ │ │ │ └── urlsmap.go │ │ └── raft │ │ │ ├── README.md │ │ │ ├── design.md │ │ │ ├── doc.go │ │ │ ├── log.go │ │ │ ├── log_unstable.go │ │ │ ├── logger.go │ │ │ ├── node.go │ │ │ ├── progress.go │ │ │ ├── raft.go │ │ │ ├── raftpb │ │ │ ├── raft.pb.go │ │ │ └── raft.proto │ │ │ ├── rawnode.go │ │ │ ├── read_only.go │ │ │ ├── status.go │ │ │ ├── storage.go │ │ │ └── util.go │ ├── go-systemd │ │ ├── LICENSE │ │ └── journal │ │ │ └── journal.go │ └── pkg │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── capnslog │ │ ├── formatters.go │ │ ├── glog_formatter.go │ │ ├── init.go │ │ ├── init_windows.go │ │ ├── journald_formatter.go │ │ ├── log_hijack.go │ │ ├── logmap.go │ │ ├── pkg_logger.go │ │ └── syslog_formatter.go ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── eapache │ ├── go-resiliency │ │ ├── LICENSE │ │ └── breaker │ │ │ ├── README.md │ │ │ └── breaker.go │ ├── go-xerial-snappy │ │ ├── LICENSE │ │ ├── README.md │ │ └── snappy.go │ └── queue │ │ ├── LICENSE │ │ ├── README.md │ │ └── queue.go ├── facebookgo │ └── clock │ │ ├── LICENSE │ │ ├── README.md │ │ └── clock.go ├── go-logfmt │ └── logfmt │ │ ├── LICENSE │ │ ├── README.md │ │ ├── decode.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── fuzz.go │ │ └── jsonstring.go ├── gogo │ └── protobuf │ │ ├── LICENSE │ │ ├── gogoproto │ │ ├── doc.go │ │ ├── gogo.pb.go │ │ └── helper.go │ │ ├── proto │ │ ├── Makefile │ │ ├── clone.go │ │ ├── decode.go │ │ ├── decode_gogo.go │ │ ├── duration.go │ │ ├── duration_gogo.go │ │ ├── encode.go │ │ ├── encode_gogo.go │ │ ├── equal.go │ │ ├── extensions.go │ │ ├── extensions_gogo.go │ │ ├── lib.go │ │ ├── lib_gogo.go │ │ ├── message_set.go │ │ ├── pointer_reflect.go │ │ ├── pointer_reflect_gogo.go │ │ ├── pointer_unsafe.go │ │ ├── pointer_unsafe_gogo.go │ │ ├── properties.go │ │ ├── properties_gogo.go │ │ ├── skip_gogo.go │ │ ├── text.go │ │ ├── text_gogo.go │ │ ├── text_parser.go │ │ ├── timestamp.go │ │ └── timestamp_gogo.go │ │ └── protoc-gen-gogo │ │ └── descriptor │ │ ├── descriptor.go │ │ ├── descriptor.pb.go │ │ ├── descriptor_gostring.gen.go │ │ └── helper.go ├── golang │ ├── protobuf │ │ ├── LICENSE │ │ ├── jsonpb │ │ │ └── jsonpb.go │ │ ├── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── deprecated.go │ │ │ ├── discard.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── table_marshal.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ │ ├── protoc-gen-go │ │ │ ├── descriptor │ │ │ │ ├── descriptor.pb.go │ │ │ │ └── descriptor.proto │ │ │ ├── generator │ │ │ │ ├── generator.go │ │ │ │ └── internal │ │ │ │ │ └── remap │ │ │ │ │ └── remap.go │ │ │ └── plugin │ │ │ │ ├── plugin.pb.go │ │ │ │ ├── plugin.pb.golden │ │ │ │ └── plugin.proto │ │ └── ptypes │ │ │ ├── any.go │ │ │ ├── any │ │ │ ├── any.pb.go │ │ │ └── any.proto │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration │ │ │ ├── duration.pb.go │ │ │ └── duration.proto │ │ │ ├── struct │ │ │ ├── struct.pb.go │ │ │ └── struct.proto │ │ │ ├── timestamp.go │ │ │ ├── timestamp │ │ │ ├── timestamp.pb.go │ │ │ └── timestamp.proto │ │ │ └── wrappers │ │ │ ├── wrappers.pb.go │ │ │ └── wrappers.proto │ └── snappy │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README │ │ ├── decode.go │ │ ├── decode_amd64.go │ │ ├── decode_amd64.s │ │ ├── decode_other.go │ │ ├── encode.go │ │ ├── encode_amd64.go │ │ ├── encode_amd64.s │ │ ├── encode_other.go │ │ └── snappy.go ├── grpc-ecosystem │ ├── go-grpc-middleware │ │ ├── CONTRIBUTING.md │ │ ├── DOC.md │ │ ├── Gopkg.lock │ │ ├── Gopkg.toml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── auth │ │ │ ├── DOC.md │ │ │ ├── README.md │ │ │ ├── auth.go │ │ │ ├── doc.go │ │ │ └── metadata.go │ │ ├── chain.go │ │ ├── doc.go │ │ ├── makefile │ │ ├── util │ │ │ └── metautils │ │ │ │ ├── DOC.md │ │ │ │ ├── README.md │ │ │ │ ├── doc.go │ │ │ │ ├── nicemd.go │ │ │ │ └── single_key.go │ │ └── wrappers.go │ └── grpc-gateway │ │ ├── LICENSE.txt │ │ ├── internal │ │ ├── BUILD.bazel │ │ ├── stream_chunk.pb.go │ │ └── stream_chunk.proto │ │ ├── runtime │ │ ├── BUILD.bazel │ │ ├── context.go │ │ ├── convert.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── fieldmask.go │ │ ├── handler.go │ │ ├── marshal_httpbodyproto.go │ │ ├── marshal_json.go │ │ ├── marshal_jsonpb.go │ │ ├── marshal_proto.go │ │ ├── marshaler.go │ │ ├── marshaler_registry.go │ │ ├── mux.go │ │ ├── pattern.go │ │ ├── proto2_convert.go │ │ ├── proto_errors.go │ │ └── query.go │ │ └── utilities │ │ ├── BUILD.bazel │ │ ├── doc.go │ │ ├── pattern.go │ │ ├── readerfactory.go │ │ └── trie.go ├── matttproud │ └── golang_protobuf_extensions │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── pbutil │ │ ├── Makefile │ │ ├── decode.go │ │ ├── doc.go │ │ └── encode.go ├── opentracing-contrib │ └── go-observer │ │ ├── LICENSE │ │ ├── README.md │ │ └── observer.go ├── opentracing │ └── opentracing-go │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── ext │ │ └── tags.go │ │ ├── globaltracer.go │ │ ├── gocontext.go │ │ ├── log │ │ ├── field.go │ │ └── util.go │ │ ├── mocktracer │ │ ├── mocklogrecord.go │ │ ├── mockspan.go │ │ ├── mocktracer.go │ │ └── propagation.go │ │ ├── noop.go │ │ ├── propagation.go │ │ ├── span.go │ │ └── tracer.go ├── openzipkin │ └── zipkin-go-opentracing │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── circle.yml │ │ ├── collector-http.go │ │ ├── collector-kafka.go │ │ ├── collector-scribe.go │ │ ├── collector.go │ │ ├── context.go │ │ ├── debug.go │ │ ├── event.go │ │ ├── flag │ │ └── flags.go │ │ ├── log-materializers.go │ │ ├── logger.go │ │ ├── observer.go │ │ ├── propagation.go │ │ ├── propagation_ot.go │ │ ├── raw.go │ │ ├── recorder.go │ │ ├── sample.go │ │ ├── span.go │ │ ├── thrift │ │ └── gen-go │ │ │ ├── scribe │ │ │ ├── GoUnusedProtection__.go │ │ │ ├── scribe-consts.go │ │ │ └── scribe.go │ │ │ └── zipkincore │ │ │ ├── GoUnusedProtection__.go │ │ │ ├── zipkinCore-consts.go │ │ │ └── zipkinCore.go │ │ ├── tracer.go │ │ ├── types │ │ └── traceid.go │ │ ├── util.go │ │ ├── wire │ │ ├── carrier.go │ │ ├── gen.go │ │ ├── wire.pb.go │ │ └── wire.proto │ │ ├── zipkin-endpoint.go │ │ └── zipkin-recorder.go ├── pierrec │ ├── lz4 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── block.go │ │ ├── lz4.go │ │ ├── reader.go │ │ └── writer.go │ └── xxHash │ │ ├── LICENSE │ │ └── xxHash32 │ │ └── xxHash32.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── pquerna │ └── ffjson │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── ffjson │ │ ├── decoder.go │ │ ├── encoder.go │ │ ├── marshal.go │ │ └── pool.go │ │ └── fflib │ │ └── v1 │ │ ├── buffer.go │ │ ├── buffer_nopool.go │ │ ├── buffer_pool.go │ │ ├── bytenum.go │ │ ├── decimal.go │ │ ├── extfloat.go │ │ ├── fold.go │ │ ├── ftoa.go │ │ ├── internal │ │ ├── atof.go │ │ ├── atoi.go │ │ ├── extfloat.go │ │ └── ftoa.go │ │ ├── iota.go │ │ ├── jsonstring.go │ │ ├── lexer.go │ │ ├── reader.go │ │ └── reader_scan_generic.go ├── prometheus │ ├── client_golang │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── prometheus │ │ │ ├── README.md │ │ │ ├── collector.go │ │ │ ├── counter.go │ │ │ ├── desc.go │ │ │ ├── doc.go │ │ │ ├── expvar_collector.go │ │ │ ├── fnv.go │ │ │ ├── gauge.go │ │ │ ├── go_collector.go │ │ │ ├── histogram.go │ │ │ ├── http.go │ │ │ ├── internal │ │ │ └── metric.go │ │ │ ├── labels.go │ │ │ ├── metric.go │ │ │ ├── observer.go │ │ │ ├── process_collector.go │ │ │ ├── promhttp │ │ │ ├── delegator.go │ │ │ ├── delegator_1_8.go │ │ │ ├── delegator_pre_1_8.go │ │ │ ├── http.go │ │ │ ├── instrument_client.go │ │ │ ├── instrument_client_1_8.go │ │ │ └── instrument_server.go │ │ │ ├── registry.go │ │ │ ├── summary.go │ │ │ ├── testutil │ │ │ └── testutil.go │ │ │ ├── timer.go │ │ │ ├── untyped.go │ │ │ ├── value.go │ │ │ ├── vec.go │ │ │ └── wrap.go │ ├── client_model │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── go │ │ │ └── metrics.pb.go │ ├── common │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── expfmt │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── expfmt.go │ │ │ ├── fuzz.go │ │ │ ├── text_create.go │ │ │ └── text_parse.go │ │ ├── internal │ │ │ └── bitbucket.org │ │ │ │ └── ww │ │ │ │ └── goautoneg │ │ │ │ ├── README.txt │ │ │ │ └── autoneg.go │ │ └── model │ │ │ ├── alert.go │ │ │ ├── fingerprinting.go │ │ │ ├── fnv.go │ │ │ ├── labels.go │ │ │ ├── labelset.go │ │ │ ├── metric.go │ │ │ ├── model.go │ │ │ ├── signature.go │ │ │ ├── silence.go │ │ │ ├── time.go │ │ │ └── value.go │ └── procfs │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── MAINTAINERS.md │ │ ├── Makefile │ │ ├── NOTICE │ │ ├── README.md │ │ ├── buddyinfo.go │ │ ├── doc.go │ │ ├── fs.go │ │ ├── ipvs.go │ │ ├── mdstat.go │ │ ├── mountstats.go │ │ ├── proc.go │ │ ├── proc_io.go │ │ ├── proc_limits.go │ │ ├── proc_stat.go │ │ ├── stat.go │ │ └── xfs │ │ ├── parse.go │ │ └── xfs.go ├── rcrowley │ └── go-metrics │ │ ├── LICENSE │ │ ├── README.md │ │ ├── counter.go │ │ ├── debug.go │ │ ├── ewma.go │ │ ├── gauge.go │ │ ├── gauge_float64.go │ │ ├── graphite.go │ │ ├── healthcheck.go │ │ ├── histogram.go │ │ ├── json.go │ │ ├── log.go │ │ ├── memory.md │ │ ├── meter.go │ │ ├── metrics.go │ │ ├── opentsdb.go │ │ ├── registry.go │ │ ├── runtime.go │ │ ├── runtime_cgo.go │ │ ├── runtime_gccpufraction.go │ │ ├── runtime_no_cgo.go │ │ ├── runtime_no_gccpufraction.go │ │ ├── sample.go │ │ ├── syslog.go │ │ ├── timer.go │ │ ├── validate.sh │ │ └── writer.go ├── stretchr │ └── testify │ │ ├── LICENSE │ │ ├── assert │ │ ├── assertion_forward.go │ │ ├── assertion_forward.go.tmpl │ │ ├── assertions.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ └── http_assertions.go │ │ ├── require │ │ ├── doc.go │ │ ├── forward_requirements.go │ │ ├── require.go │ │ ├── require.go.tmpl │ │ ├── require_forward.go │ │ ├── require_forward.go.tmpl │ │ └── requirements.go │ │ └── suite │ │ ├── doc.go │ │ ├── interfaces.go │ │ └── suite.go └── zheng-ji │ └── goSnowFlake │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ └── uid.go ├── go.uber.org ├── atomic │ ├── LICENSE.txt │ ├── atomic.go │ └── string.go ├── multierr │ ├── LICENSE.txt │ └── error.go └── zap │ ├── LICENSE.txt │ ├── array.go │ ├── buffer │ ├── buffer.go │ └── pool.go │ ├── config.go │ ├── doc.go │ ├── encoder.go │ ├── error.go │ ├── field.go │ ├── flag.go │ ├── global.go │ ├── http_handler.go │ ├── internal │ ├── bufferpool │ │ └── bufferpool.go │ ├── color │ │ └── color.go │ └── exit │ │ └── exit.go │ ├── level.go │ ├── logger.go │ ├── options.go │ ├── stacktrace.go │ ├── sugar.go │ ├── time.go │ ├── writer.go │ └── zapcore │ ├── console_encoder.go │ ├── core.go │ ├── doc.go │ ├── encoder.go │ ├── entry.go │ ├── error.go │ ├── field.go │ ├── hook.go │ ├── json_encoder.go │ ├── level.go │ ├── level_strings.go │ ├── marshaler.go │ ├── memory_encoder.go │ ├── sampler.go │ ├── tee.go │ └── write_syncer.go ├── golang.org └── x │ ├── net │ ├── LICENSE │ ├── PATENTS │ ├── context │ │ ├── context.go │ │ ├── go17.go │ │ ├── go19.go │ │ ├── pre_go17.go │ │ └── pre_go19.go │ ├── http2 │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README │ │ ├── ciphers.go │ │ ├── client_conn_pool.go │ │ ├── configure_transport.go │ │ ├── databuffer.go │ │ ├── errors.go │ │ ├── flow.go │ │ ├── frame.go │ │ ├── go16.go │ │ ├── go17.go │ │ ├── go17_not18.go │ │ ├── go18.go │ │ ├── go19.go │ │ ├── gotrack.go │ │ ├── headermap.go │ │ ├── hpack │ │ │ ├── encode.go │ │ │ ├── hpack.go │ │ │ ├── huffman.go │ │ │ └── tables.go │ │ ├── http2.go │ │ ├── not_go16.go │ │ ├── not_go17.go │ │ ├── not_go18.go │ │ ├── not_go19.go │ │ ├── pipe.go │ │ ├── server.go │ │ ├── transport.go │ │ ├── write.go │ │ ├── writesched.go │ │ ├── writesched_priority.go │ │ └── writesched_random.go │ ├── idna │ │ ├── idna.go │ │ ├── punycode.go │ │ ├── tables.go │ │ ├── trie.go │ │ └── trieval.go │ ├── internal │ │ └── timeseries │ │ │ └── timeseries.go │ ├── lex │ │ └── httplex │ │ │ └── httplex.go │ └── trace │ │ ├── events.go │ │ ├── histogram.go │ │ ├── trace.go │ │ ├── trace_go16.go │ │ └── trace_go17.go │ ├── sys │ ├── LICENSE │ ├── PATENTS │ └── unix │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.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_aix_ppc.go │ │ ├── dev_aix_ppc64.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 │ │ ├── fcntl.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ioctl.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mkpost.go │ │ ├── mksyscall.pl │ │ ├── mksyscall_aix.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_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.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_gc_386.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.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_aix.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.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_riscv64.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_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.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_riscv64.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_riscv64.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_aix_ppc.go │ │ ├── ztypes_aix_ppc64.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_riscv64.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 │ └── text │ ├── LICENSE │ ├── PATENTS │ ├── secure │ └── bidirule │ │ └── bidirule.go │ ├── transform │ └── transform.go │ └── unicode │ ├── bidi │ ├── bidi.go │ ├── bracket.go │ ├── core.go │ ├── gen.go │ ├── gen_ranges.go │ ├── gen_trieval.go │ ├── prop.go │ ├── tables.go │ └── trieval.go │ └── norm │ ├── composition.go │ ├── forminfo.go │ ├── input.go │ ├── iter.go │ ├── maketables.go │ ├── normalize.go │ ├── readwriter.go │ ├── tables.go │ ├── transform.go │ ├── trie.go │ └── triegen.go ├── google.golang.org ├── genproto │ ├── LICENSE │ ├── googleapis │ │ ├── api │ │ │ ├── annotations │ │ │ │ ├── annotations.pb.go │ │ │ │ └── http.pb.go │ │ │ └── httpbody │ │ │ │ └── httpbody.pb.go │ │ └── rpc │ │ │ ├── errdetails │ │ │ └── error_details.pb.go │ │ │ └── status │ │ │ └── status.pb.go │ └── protobuf │ │ └── field_mask │ │ └── field_mask.pb.go └── grpc │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── backoff.go │ ├── balancer.go │ ├── balancer │ ├── balancer.go │ ├── base │ │ ├── balancer.go │ │ └── base.go │ └── roundrobin │ │ └── roundrobin.go │ ├── balancer_conn_wrappers.go │ ├── balancer_v1_wrapper.go │ ├── binarylog │ └── grpc_binarylog_v1 │ │ └── binarylog.pb.go │ ├── call.go │ ├── clientconn.go │ ├── codec.go │ ├── codegen.sh │ ├── codes │ ├── code_string.go │ └── codes.go │ ├── connectivity │ └── connectivity.go │ ├── credentials │ ├── credentials.go │ └── internal │ │ ├── syscallconn.go │ │ └── syscallconn_appengine.go │ ├── dialoptions.go │ ├── doc.go │ ├── encoding │ ├── encoding.go │ └── proto │ │ └── proto.go │ ├── go.mod │ ├── go.sum │ ├── grpclb │ └── grpc_lb_v1 │ │ └── messages │ │ └── messages.pb.go │ ├── grpclog │ ├── grpclog.go │ ├── logger.go │ └── loggerv2.go │ ├── health │ └── grpc_health_v1 │ │ └── health.pb.go │ ├── install_gae.sh │ ├── interceptor.go │ ├── internal │ ├── backoff │ │ └── backoff.go │ ├── binarylog │ │ ├── binarylog.go │ │ ├── binarylog_testutil.go │ │ ├── env_config.go │ │ ├── method_logger.go │ │ ├── regenerate.sh │ │ ├── sink.go │ │ └── util.go │ ├── channelz │ │ ├── funcs.go │ │ ├── types.go │ │ ├── types_linux.go │ │ ├── types_nonlinux.go │ │ ├── util_linux.go │ │ └── util_nonlinux.go │ ├── envconfig │ │ └── envconfig.go │ ├── grpcrand │ │ └── grpcrand.go │ ├── grpcsync │ │ └── event.go │ ├── internal.go │ ├── syscall │ │ ├── syscall_linux.go │ │ └── syscall_nonlinux.go │ └── transport │ │ ├── bdp_estimator.go │ │ ├── controlbuf.go │ │ ├── defaults.go │ │ ├── flowcontrol.go │ │ ├── handler_server.go │ │ ├── http2_client.go │ │ ├── http2_server.go │ │ ├── http_util.go │ │ ├── log.go │ │ └── transport.go │ ├── keepalive │ └── keepalive.go │ ├── metadata │ └── metadata.go │ ├── naming │ ├── dns_resolver.go │ └── naming.go │ ├── peer │ └── peer.go │ ├── picker_wrapper.go │ ├── pickfirst.go │ ├── proxy.go │ ├── resolver │ ├── dns │ │ └── dns_resolver.go │ ├── passthrough │ │ └── passthrough.go │ └── resolver.go │ ├── resolver_conn_wrapper.go │ ├── rpc_util.go │ ├── server.go │ ├── service_config.go │ ├── stats │ ├── handlers.go │ └── stats.go │ ├── status │ └── status.go │ ├── stream.go │ ├── tap │ └── tap.go │ ├── trace.go │ ├── transport │ ├── bdp_estimator.go │ ├── control.go │ ├── handler_server.go │ ├── http2_client.go │ ├── http2_server.go │ ├── http_util.go │ ├── log.go │ └── transport.go │ ├── version.go │ └── vet.sh └── vendor.json /README.md: -------------------------------------------------------------------------------- 1 | # QSF2.0 - 服务治理框架 2 | 3 | ------ 4 | 5 | QSF2.0是基于GRPC生态圈打造的一个简单、易用、功能强大的服务治理框架。 6 | 7 | > * 简单易用 8 | 易于入门,易于开发,易于集成,,易于发布,易于监控。 9 | > * 高性能 10 | 基于GRPC(HTTP2、Protocol Buffer)高性能传输。 11 | > * 跨平台、多语言 12 | 由于采用GRPC,即可很容易部署在Windows/Linux/MacOS等平台,同时也支持各种编程语言的调用。 13 | > * 服务发现 14 | 除了直连外,目前支持ETCD注册中心。 15 | > * 服务治理 16 | 目前支持随机、轮询、权重等负载均衡算法,支持限流、熔断、降级等服务保护手段,支持基于prometheus+alertmanager实现的服务监控以及告警(可用grafana展示),支持基于opentracing实现的服务调用链追踪。 17 | > * API网关 18 | 目前接入GRPC-GATEWAY。 19 | # 快速开始 20 | 1、安装ProtocolBuffers 21 | 22 | mkdir tmp 23 | cd tmp 24 | git clone https://github.com/google/protobuf 25 | cd protobuf 26 | ./autogen.sh 27 | ./configure 28 | make 29 | make check 30 | sudo make install 31 | 32 | 2、安装proto,protoc-gen-go 33 | 34 | go get -u github.com/golang/protobuf/{proto,protoc-gen-go} 35 | 36 | 3、安装GRPC-API-GATEWAY(用于生成网关代码,具体请参考grpc-gateway生成方式) 37 | 38 | go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway 39 | go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger 40 | 41 | 4、安装QSF 42 | 43 | go get github.com/chuangyou/qsf 44 | 45 | 5、QSF2.0与QSF的区别 46 | 47 | - 封装底层实现 48 | - 调用简单 49 | - 所有组件可以一键配置 50 | - 具体请参考 [examples][1] 51 | 52 | [1]: https://github.com/chuangyou/qsf/tree/master/examples -------------------------------------------------------------------------------- /constant/constant.go: -------------------------------------------------------------------------------- 1 | package constant 2 | 3 | const ( 4 | DEFAULT_ETCD_PATH = "/qsf.service" 5 | InitialWindowSize = 1 << 30 6 | InitialConnWindowSize = 1 << 30 7 | MaxSendMsgSize = 1<<31 - 1 8 | MaxCallMsgSize = 1<<31 - 1 9 | ) 10 | -------------------------------------------------------------------------------- /examples/gateway/gateway: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chuangyou/qsf/7277fceb931f99c523f68ad2c52f09ce5d1f90ae/examples/gateway/gateway -------------------------------------------------------------------------------- /examples/gateway/server.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDmDCCAoACCQDwTSOz5CJsUzANBgkqhkiG9w0BAQUFADCBjTELMAkGA1UEBhMC 3 | Q04xDzANBgNVBAgMBkZ1SmlhbjEPMA0GA1UEBwwGRnVaaG91MRIwEAYDVQQKDAlD 4 | aHVhbmdZb3UxFDASBgNVBAsMC0NodWFuZ1lvdVREMREwDwYDVQQDDAhxdWppLmNv 5 | bTEfMB0GCSqGSIb3DQEJARYQc2VydmljZUBxdWppLmNvbTAeFw0xNjExMzAwNzEz 6 | NTdaFw0xOTExMzAwNzEzNTdaMIGNMQswCQYDVQQGEwJDTjEPMA0GA1UECAwGRnVK 7 | aWFuMQ8wDQYDVQQHDAZGdVpob3UxEjAQBgNVBAoMCUNodWFuZ1lvdTEUMBIGA1UE 8 | CwwLQ2h1YW5nWW91VEQxETAPBgNVBAMMCHF1amkuY29tMR8wHQYJKoZIhvcNAQkB 9 | FhBzZXJ2aWNlQHF1amkuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC 10 | AQEAu3gBgSgKyBhowisZiP3ZblvgspepegSW7miDsfto2W5sreBSN2uliajekO19 11 | SFCB0qA2ASBFa1qdT0BGTeeJdFvD47r7uBl+GGRR5XLU2PCYR+r32G/xpyrI5UY9 12 | LZD9ysoIKjmER8dCNMrTc3snY5ykk+SoQ0roWQSLcLuwU5VnqKqedEjXoHuwPSNr 13 | MGgD/wu2nrEITw0noFZ0l7GjzlBD15vmgn+HDvyBRnZNpSrXypBpXo2dMBspxI4U 14 | kQHKRIYMnjYh+cLSwzGelO4081VyFhvOujbknkD2TaUB6zhahJS9GHk9Z9TAEEN+ 15 | lHOHVTnVgCbewNql6KzaSMexYQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQBF+P7T 16 | EmjvsvbN3JijXjP75Fp9/8wx7aBQy/Ip5r5G9GEW464owriGco2b9SHn7EtXwOW9 17 | r2iW5REM8/ToIE8S+LFwmsu6N/OqyQ8bU+Z+VWKyoYRD1aCJNZlivo9CZ1a29HLb 18 | EPxWQV51KGdtyglAS6FnEdxGyn6raKMsyCwvn5VCE/69p4akfRysQ1y5ldKqR28Z 19 | MWt6djHQAc8neuD+5XPymrk+PqfohsigjZdUc+NcFD7LF4nNy2qUItEipRldm5KI 20 | 6105LHm4+Q5oJdA+Drm4XnCbkpY6kEAaPDGEW66pQiBxEvyqDvvo8lcDsBaAt7jo 21 | QsJQBXv+XwlYqK0R 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /examples/pb/example.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package chuangyou.touyuan.example.v1; 3 | import "google/api/annotations.proto"; 4 | message Example { 5 | string value = 1; 6 | } 7 | message GetExampleRequest { 8 | string value = 1; 9 | } 10 | service ExampleService { 11 | rpc GetExample(GetExampleRequest) returns (Example) { 12 | option (google.api.http) = { 13 | get: "/v1/examples"; 14 | }; 15 | } 16 | } -------------------------------------------------------------------------------- /plugin/breaker/interceptor.go: -------------------------------------------------------------------------------- 1 | package breaker 2 | 3 | import ( 4 | "github.com/chuangyou/qsf/grpc_error" 5 | "golang.org/x/net/context" 6 | "google.golang.org/grpc" 7 | ) 8 | 9 | func UnaryClientInterceptor(breaker *Breaker) grpc.UnaryClientInterceptor { 10 | return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error { 11 | err := breaker.Call(func() error { 12 | return invoker(ctx, method, req, reply, cc, opts...) 13 | }, 0) 14 | 15 | if err == ErrBreakerOpen { 16 | //service fallback 17 | return grpc_error.Unavailable() 18 | } 19 | return err 20 | } 21 | } 22 | func StreamServerInterceptor(breaker *Breaker) grpc.StreamServerInterceptor { 23 | return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { 24 | err := breaker.Call(func() error { 25 | return handler(srv, stream) 26 | }, 0) 27 | if err == ErrBreakerOpen { 28 | //service fallback 29 | return grpc_error.Unavailable() 30 | } 31 | return err 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /plugin/loadbalance/registry/etcd/resolver.go: -------------------------------------------------------------------------------- 1 | package etcd 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | 7 | etcd3 "github.com/coreos/etcd/clientv3" 8 | "google.golang.org/grpc/naming" 9 | ) 10 | 11 | // EtcdResolver is an implementation of grpc.naming.Resolver 12 | type EtcdResolver struct { 13 | Config etcd3.Config 14 | RegistryDir string 15 | ServiceName string 16 | } 17 | 18 | func NewResolver(registryDir, serviceName string, cfg etcd3.Config) naming.Resolver { 19 | return &EtcdResolver{RegistryDir: registryDir, ServiceName: serviceName, Config: cfg} 20 | } 21 | 22 | // Resolve to resolve the service from etcd 23 | func (er *EtcdResolver) Resolve(target string) (naming.Watcher, error) { 24 | if er.ServiceName == "" { 25 | return nil, errors.New("no service name provided") 26 | } 27 | client, err := etcd3.New(er.Config) 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | key := fmt.Sprintf("%s/%s", er.RegistryDir, er.ServiceName) 33 | return newEtcdWatcher(key, client), nil 34 | } 35 | -------------------------------------------------------------------------------- /plugin/prometheus/metric_options.go: -------------------------------------------------------------------------------- 1 | package grpc_prometheus 2 | 3 | import ( 4 | prom "github.com/prometheus/client_golang/prometheus" 5 | ) 6 | 7 | // A CounterOption lets you add options to Counter metrics using With* funcs. 8 | type CounterOption func(*prom.CounterOpts) 9 | 10 | type counterOptions []CounterOption 11 | 12 | func (co counterOptions) apply(o prom.CounterOpts) prom.CounterOpts { 13 | for _, f := range co { 14 | f(&o) 15 | } 16 | return o 17 | } 18 | 19 | // WithConstLabels allows you to add ConstLabels to Counter metrics. 20 | func WithConstLabels(labels prom.Labels) CounterOption { 21 | return func(o *prom.CounterOpts) { 22 | o.ConstLabels = labels 23 | } 24 | } 25 | 26 | // A HistogramOption lets you add options to Histogram metrics using With* 27 | // funcs. 28 | type HistogramOption func(*prom.HistogramOpts) 29 | 30 | // WithHistogramBuckets allows you to specify custom bucket ranges for histograms if EnableHandlingTimeHistogram is on. 31 | func WithHistogramBuckets(buckets []float64) HistogramOption { 32 | return func(o *prom.HistogramOpts) { o.Buckets = buckets } 33 | } 34 | 35 | // WithHistogramConstLabels allows you to add custom ConstLabels to 36 | // histograms metrics. 37 | func WithHistogramConstLabels(labels prom.Labels) HistogramOption { 38 | return func(o *prom.HistogramOpts) { 39 | o.ConstLabels = labels 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /plugin/ratelimit/interceptor.go: -------------------------------------------------------------------------------- 1 | package ratelimit 2 | 3 | import ( 4 | "strconv" 5 | 6 | "golang.org/x/net/context" 7 | "google.golang.org/grpc" 8 | 9 | "github.com/chuangyou/qsf/grpc_error" 10 | ) 11 | 12 | func UnaryServerInterceptor(rl *RateLimiter) grpc.UnaryServerInterceptor { 13 | return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) { 14 | if !rl.Limit() { 15 | return handler(ctx, req) 16 | } else { 17 | return nil, grpc_error.ResourceExhausted("服务并发限制", "当前服务最大并发数为"+strconv.FormatUint(rl.rate, 10)+",请稍后重试。", 30) 18 | } 19 | } 20 | } 21 | func StreamServerInterceptor(rl *RateLimiter) grpc.StreamServerInterceptor { 22 | return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { 23 | if !rl.Limit() { 24 | return handler(srv, stream) 25 | } else { 26 | return grpc_error.ResourceExhausted("服务并发限制", "当前服务最大并发数为"+strconv.FormatUint(rl.rate, 10)+",请稍后重试。", 30) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /plugin/tracing/package.go: -------------------------------------------------------------------------------- 1 | // Package otgrpc provides OpenTracing support for any gRPC client or server. 2 | // 3 | // See the README for simple usage examples: 4 | // https://github.com/grpc-ecosystem/grpc-opentracing/blob/master/go/otgrpc/README.md 5 | package otgrpc 6 | -------------------------------------------------------------------------------- /plugin/tracing/shared.go: -------------------------------------------------------------------------------- 1 | package otgrpc 2 | 3 | import ( 4 | "strings" 5 | 6 | opentracing "github.com/opentracing/opentracing-go" 7 | "github.com/opentracing/opentracing-go/ext" 8 | "google.golang.org/grpc/metadata" 9 | ) 10 | 11 | var ( 12 | // Morally a const: 13 | gRPCComponentTag = opentracing.Tag{string(ext.Component), "gRPC"} 14 | ) 15 | 16 | // metadataReaderWriter satisfies both the opentracing.TextMapReader and 17 | // opentracing.TextMapWriter interfaces. 18 | type metadataReaderWriter struct { 19 | metadata.MD 20 | } 21 | 22 | func (w metadataReaderWriter) Set(key, val string) { 23 | // The GRPC HPACK implementation rejects any uppercase keys here. 24 | // 25 | // As such, since the HTTP_HEADERS format is case-insensitive anyway, we 26 | // blindly lowercase the key (which is guaranteed to work in the 27 | // Inject/Extract sense per the OpenTracing spec). 28 | key = strings.ToLower(key) 29 | w.MD[key] = append(w.MD[key], val) 30 | } 31 | 32 | func (w metadataReaderWriter) ForeachKey(handler func(key, val string) error) error { 33 | for k, vals := range w.MD { 34 | for _, v := range vals { 35 | if err := handler(k, v); err != nil { 36 | return err 37 | } 38 | } 39 | } 40 | 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Shopify 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /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 -p 1 -v -timeout 90s -race -coverprofile=profile.out -covermode=atomic $$d || exit 1; \ 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/Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 5 | VAGRANTFILE_API_VERSION = "2" 6 | 7 | # We have 5 * 192MB ZK processes and 5 * 320MB Kafka processes => 2560MB 8 | MEMORY = 3072 9 | 10 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 11 | config.vm.box = "ubuntu/trusty64" 12 | 13 | config.vm.provision :shell, path: "vagrant/provision.sh" 14 | 15 | config.vm.network "private_network", ip: "192.168.100.67" 16 | 17 | config.vm.provider "virtualbox" do |v| 18 | v.memory = MEMORY 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /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 | tmp := new(FindCoordinatorRequest) 9 | tmp.CoordinatorKey = r.ConsumerGroup 10 | tmp.CoordinatorType = CoordinatorGroup 11 | return tmp.encode(pe) 12 | } 13 | 14 | func (r *ConsumerMetadataRequest) decode(pd packetDecoder, version int16) (err error) { 15 | tmp := new(FindCoordinatorRequest) 16 | if err := tmp.decode(pd, version); err != nil { 17 | return err 18 | } 19 | r.ConsumerGroup = tmp.CoordinatorKey 20 | return nil 21 | } 22 | 23 | func (r *ConsumerMetadataRequest) key() int16 { 24 | return 10 25 | } 26 | 27 | func (r *ConsumerMetadataRequest) version() int16 { 28 | return 0 29 | } 30 | 31 | func (r *ConsumerMetadataRequest) requiredVersion() KafkaVersion { 32 | return V0_8_2_0 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/Shopify/sarama/delete_topics_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | import "time" 4 | 5 | type DeleteTopicsRequest struct { 6 | Version int16 7 | Topics []string 8 | Timeout time.Duration 9 | } 10 | 11 | func (d *DeleteTopicsRequest) encode(pe packetEncoder) error { 12 | if err := pe.putStringArray(d.Topics); err != nil { 13 | return err 14 | } 15 | pe.putInt32(int32(d.Timeout / time.Millisecond)) 16 | 17 | return nil 18 | } 19 | 20 | func (d *DeleteTopicsRequest) decode(pd packetDecoder, version int16) (err error) { 21 | if d.Topics, err = pd.getStringArray(); err != nil { 22 | return err 23 | } 24 | timeout, err := pd.getInt32() 25 | if err != nil { 26 | return err 27 | } 28 | d.Timeout = time.Duration(timeout) * time.Millisecond 29 | d.Version = version 30 | return nil 31 | } 32 | 33 | func (d *DeleteTopicsRequest) key() int16 { 34 | return 20 35 | } 36 | 37 | func (d *DeleteTopicsRequest) version() int16 { 38 | return d.Version 39 | } 40 | 41 | func (d *DeleteTopicsRequest) requiredVersion() KafkaVersion { 42 | switch d.Version { 43 | case 1: 44 | return V0_11_0_0 45 | default: 46 | return V0_10_1_0 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /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/find_coordinator_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type CoordinatorType int8 4 | 5 | const ( 6 | CoordinatorGroup CoordinatorType = 0 7 | CoordinatorTransaction CoordinatorType = 1 8 | ) 9 | 10 | type FindCoordinatorRequest struct { 11 | Version int16 12 | CoordinatorKey string 13 | CoordinatorType CoordinatorType 14 | } 15 | 16 | func (f *FindCoordinatorRequest) encode(pe packetEncoder) error { 17 | if err := pe.putString(f.CoordinatorKey); err != nil { 18 | return err 19 | } 20 | 21 | if f.Version >= 1 { 22 | pe.putInt8(int8(f.CoordinatorType)) 23 | } 24 | 25 | return nil 26 | } 27 | 28 | func (f *FindCoordinatorRequest) decode(pd packetDecoder, version int16) (err error) { 29 | if f.CoordinatorKey, err = pd.getString(); err != nil { 30 | return err 31 | } 32 | 33 | if version >= 1 { 34 | f.Version = version 35 | coordinatorType, err := pd.getInt8() 36 | if err != nil { 37 | return err 38 | } 39 | 40 | f.CoordinatorType = CoordinatorType(coordinatorType) 41 | } 42 | 43 | return nil 44 | } 45 | 46 | func (f *FindCoordinatorRequest) key() int16 { 47 | return 10 48 | } 49 | 50 | func (f *FindCoordinatorRequest) version() int16 { 51 | return f.Version 52 | } 53 | 54 | func (f *FindCoordinatorRequest) requiredVersion() KafkaVersion { 55 | switch f.Version { 56 | case 1: 57 | return V0_11_0_0 58 | default: 59 | return V0_8_2_0 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /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/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/apache/thrift/lib/go/thrift/context.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package thrift 21 | 22 | import "context" 23 | 24 | var defaultCtx = context.Background() 25 | -------------------------------------------------------------------------------- /vendor/github.com/apache/thrift/lib/go/thrift/messagetype.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package thrift 21 | 22 | // Message type constants in the Thrift protocol. 23 | type TMessageType int32 24 | 25 | const ( 26 | INVALID_TMESSAGE_TYPE TMessageType = 0 27 | CALL TMessageType = 1 28 | REPLY TMessageType = 2 29 | EXCEPTION TMessageType = 3 30 | ONEWAY TMessageType = 4 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/github.com/apache/thrift/lib/go/thrift/protocol_factory.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package thrift 21 | 22 | // Factory interface for constructing protocol instances. 23 | type TProtocolFactory interface { 24 | GetProtocol(trans TTransport) TProtocol 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/beorn7/perks/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Blake Mizerany 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/cenk/backoff/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Cenk Altı 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/cenk/backoff/context.go: -------------------------------------------------------------------------------- 1 | package backoff 2 | 3 | import ( 4 | "time" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // BackOffContext is a backoff policy that stops retrying after the context 10 | // is canceled. 11 | type BackOffContext interface { 12 | BackOff 13 | Context() context.Context 14 | } 15 | 16 | type backOffContext struct { 17 | BackOff 18 | ctx context.Context 19 | } 20 | 21 | // WithContext returns a BackOffContext with context ctx 22 | // 23 | // ctx must not be nil 24 | func WithContext(b BackOff, ctx context.Context) BackOffContext { 25 | if ctx == nil { 26 | panic("nil context") 27 | } 28 | 29 | if b, ok := b.(*backOffContext); ok { 30 | return &backOffContext{ 31 | BackOff: b.BackOff, 32 | ctx: ctx, 33 | } 34 | } 35 | 36 | return &backOffContext{ 37 | BackOff: b, 38 | ctx: ctx, 39 | } 40 | } 41 | 42 | func ensureContext(b BackOff) BackOffContext { 43 | if cb, ok := b.(BackOffContext); ok { 44 | return cb 45 | } 46 | return WithContext(b, context.Background()) 47 | } 48 | 49 | func (b *backOffContext) Context() context.Context { 50 | return b.ctx 51 | } 52 | 53 | func (b *backOffContext) NextBackOff() time.Duration { 54 | select { 55 | case <-b.Context().Done(): 56 | return Stop 57 | default: 58 | return b.BackOff.NextBackOff() 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/github.com/cenk/backoff/tries.go: -------------------------------------------------------------------------------- 1 | package backoff 2 | 3 | import "time" 4 | 5 | /* 6 | WithMaxRetries creates a wrapper around another BackOff, which will 7 | return Stop if NextBackOff() has been called too many times since 8 | the last time Reset() was called 9 | 10 | Note: Implementation is not thread-safe. 11 | */ 12 | func WithMaxRetries(b BackOff, max uint64) BackOff { 13 | return &backOffTries{delegate: b, maxTries: max} 14 | } 15 | 16 | type backOffTries struct { 17 | delegate BackOff 18 | maxTries uint64 19 | numTries uint64 20 | } 21 | 22 | func (b *backOffTries) NextBackOff() time.Duration { 23 | if b.maxTries > 0 { 24 | if b.maxTries <= b.numTries { 25 | return Stop 26 | } 27 | b.numTries++ 28 | } 29 | return b.delegate.NextBackOff() 30 | } 31 | 32 | func (b *backOffTries) Reset() { 33 | b.numTries = 0 34 | b.delegate.Reset() 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/NOTICE: -------------------------------------------------------------------------------- 1 | CoreOS Project 2 | Copyright 2014 CoreOS, Inc 3 | 4 | This product includes software developed at CoreOS, Inc. 5 | (http://www.coreos.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/auth/authpb/auth.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package authpb; 3 | 4 | import "gogoproto/gogo.proto"; 5 | 6 | option (gogoproto.marshaler_all) = true; 7 | option (gogoproto.sizer_all) = true; 8 | option (gogoproto.unmarshaler_all) = true; 9 | option (gogoproto.goproto_getters_all) = false; 10 | option (gogoproto.goproto_enum_prefix_all) = false; 11 | 12 | // User is a single entry in the bucket authUsers 13 | message User { 14 | bytes name = 1; 15 | bytes password = 2; 16 | repeated string roles = 3; 17 | } 18 | 19 | // Permission is a single entity 20 | message Permission { 21 | enum Type { 22 | READ = 0; 23 | WRITE = 1; 24 | READWRITE = 2; 25 | } 26 | Type permType = 1; 27 | 28 | bytes key = 2; 29 | bytes range_end = 3; 30 | } 31 | 32 | // Role is a single entry in the bucket authRoles 33 | message Role { 34 | bytes name = 1; 35 | 36 | repeated Permission keyPermission = 2; 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/clientv3/balancer/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package balancer implements client balancer. 16 | package balancer 17 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/clientv3/ready_wait.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package clientv3 16 | 17 | import "context" 18 | 19 | // TODO: remove this when "FailFast=false" is fixed. 20 | // See https://github.com/grpc/grpc-go/issues/1532. 21 | func readyWait(rpcCtx, clientCtx context.Context, ready <-chan struct{}) error { 22 | select { 23 | case <-ready: 24 | return nil 25 | case <-rpcCtx.Done(): 26 | return rpcCtx.Err() 27 | case <-clientCtx.Done(): 28 | return clientCtx.Err() 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/clientv3/sort.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package clientv3 16 | 17 | type SortTarget int 18 | type SortOrder int 19 | 20 | const ( 21 | SortNone SortOrder = iota 22 | SortAscend 23 | SortDescend 24 | ) 25 | 26 | const ( 27 | SortByKey SortTarget = iota 28 | SortByVersion 29 | SortByCreateRevision 30 | SortByModRevision 31 | SortByValue 32 | ) 33 | 34 | type SortOption struct { 35 | Target SortTarget 36 | Order SortOrder 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package rpctypes has types and values shared by the etcd server and client for v3 RPC interaction. 16 | package rpctypes 17 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/md.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package rpctypes 16 | 17 | var ( 18 | MetadataRequireLeaderKey = "hasleader" 19 | MetadataHasLeader = "true" 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes/metadatafields.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package rpctypes 16 | 17 | var ( 18 | TokenFieldNameGRPC = "token" 19 | TokenFieldNameSwagger = "authorization" 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/pkg/logutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package logutil includes utilities to facilitate logging. 16 | package logutil 17 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/pkg/types/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package types declares various data types and implements type-checking 16 | // functions. 17 | package types 18 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/pkg/types/slice.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package types 16 | 17 | // Uint64Slice implements sort interface 18 | type Uint64Slice []uint64 19 | 20 | func (p Uint64Slice) Len() int { return len(p) } 21 | func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } 22 | func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } 23 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/pkg/NOTICE: -------------------------------------------------------------------------------- 1 | CoreOS Project 2 | Copyright 2014 CoreOS, Inc 3 | 4 | This product includes software developed at CoreOS, Inc. 5 | (http://www.coreos.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/pkg/capnslog/init_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package capnslog 16 | 17 | import "os" 18 | 19 | func init() { 20 | initHijack() 21 | 22 | // Go `log` package uses os.Stderr. 23 | SetFormatter(NewPrettyFormatter(os.Stderr, false)) 24 | SetGlobalLogLevel(INFO) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/pkg/capnslog/log_hijack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package capnslog 16 | 17 | import ( 18 | "log" 19 | ) 20 | 21 | func initHijack() { 22 | pkg := NewPackageLogger("log", "") 23 | w := packageWriter{pkg} 24 | log.SetFlags(0) 25 | log.SetPrefix("") 26 | log.SetOutput(w) 27 | } 28 | 29 | type packageWriter struct { 30 | pl *PackageLogger 31 | } 32 | 33 | func (p packageWriter) Write(b []byte) (int, error) { 34 | if p.pl.level < INFO { 35 | return 0, nil 36 | } 37 | p.pl.internalLog(calldepth+2, INFO, string(b)) 38 | return len(b), nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-resiliency/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Evan Huus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-resiliency/breaker/README.md: -------------------------------------------------------------------------------- 1 | circuit-breaker 2 | =============== 3 | 4 | [![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 | [![Code of Conduct](https://img.shields.io/badge/code%20of%20conduct-active-blue.svg)](https://eapache.github.io/conduct.html) 7 | 8 | The circuit-breaker resiliency pattern for golang. 9 | 10 | Creating a breaker takes three parameters: 11 | - error threshold (for opening the breaker) 12 | - success threshold (for closing the breaker) 13 | - timeout (how long to keep the breaker open) 14 | 15 | ```go 16 | b := breaker.New(3, 1, 5*time.Second) 17 | 18 | for { 19 | result := b.Run(func() error { 20 | // communicate with some external service and 21 | // return an error if the communication failed 22 | return nil 23 | }) 24 | 25 | switch result { 26 | case nil: 27 | // success! 28 | case breaker.ErrBreakerOpen: 29 | // our function wasn't run because the breaker was open 30 | default: 31 | // some other error 32 | } 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-xerial-snappy/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Evan Huus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/go-xerial-snappy/README.md: -------------------------------------------------------------------------------- 1 | # go-xerial-snappy 2 | 3 | [![Build Status](https://travis-ci.org/eapache/go-xerial-snappy.svg?branch=master)](https://travis-ci.org/eapache/go-xerial-snappy) 4 | 5 | Xerial-compatible Snappy framing support for golang. 6 | 7 | Packages using Xerial for snappy encoding use a framing format incompatible with 8 | basically everything else in existence. This package wraps Go's built-in snappy 9 | package to support it. 10 | 11 | Apps that use this format include Apache Kafka (see 12 | https://github.com/dpkp/kafka-python/issues/126#issuecomment-35478921 for 13 | details). 14 | -------------------------------------------------------------------------------- /vendor/github.com/eapache/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/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Evan Huus 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/eapache/queue/README.md: -------------------------------------------------------------------------------- 1 | Queue 2 | ===== 3 | 4 | [![Build Status](https://travis-ci.org/eapache/queue.svg)](https://travis-ci.org/eapache/queue) 5 | [![GoDoc](https://godoc.org/github.com/eapache/queue?status.svg)](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/facebookgo/clock/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Ben Johnson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-logfmt/logfmt/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 go-logfmt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-logfmt/logfmt/doc.go: -------------------------------------------------------------------------------- 1 | // Package logfmt implements utilities to marshal and unmarshal data in the 2 | // logfmt format. The logfmt format records key/value pairs in a way that 3 | // balances readability for humans and simplicity of computer parsing. It is 4 | // most commonly used as a more human friendly alternative to JSON for 5 | // structured logging. 6 | package logfmt 7 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Rodolfo Carvalho 15 | Sebastien Binet 16 | -------------------------------------------------------------------------------- /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/grpc-ecosystem/go-grpc-middleware/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We would love to have people submit pull requests and help make `grpc-ecosystem/go-grpc-middleware` even better 👍. 4 | 5 | Fork, then clone the repo: 6 | 7 | ```bash 8 | git clone git@github.com:your-username/go-grpc-middleware.git 9 | ``` 10 | 11 | Before checking in please run the following: 12 | 13 | ```bash 14 | make all 15 | ``` 16 | 17 | This will `vet`, `fmt`, regenerate documentation and run all tests. 18 | 19 | 20 | Push to your fork and open a pull request. -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/go-grpc-middleware/Gopkg.toml: -------------------------------------------------------------------------------- 1 | [[constraint]] 2 | name = "github.com/gogo/protobuf" 3 | version = "0.5.0" 4 | 5 | [[constraint]] 6 | branch = "master" 7 | name = "github.com/golang/protobuf" 8 | 9 | [[constraint]] 10 | name = "github.com/opentracing/opentracing-go" 11 | version = "1.0.2" 12 | 13 | [[constraint]] 14 | name = "github.com/sirupsen/logrus" 15 | version = "1.0.3" 16 | 17 | [[constraint]] 18 | name = "github.com/stretchr/testify" 19 | version = "1.1.4" 20 | 21 | [[constraint]] 22 | name = "go.uber.org/zap" 23 | version = "1.7.1" 24 | 25 | [[constraint]] 26 | branch = "master" 27 | name = "golang.org/x/net" 28 | 29 | [[constraint]] 30 | branch = "master" 31 | name = "golang.org/x/oauth2" 32 | 33 | [[constraint]] 34 | name = "google.golang.org/grpc" 35 | version = "1.8.0" 36 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/go-grpc-middleware/auth/README.md: -------------------------------------------------------------------------------- 1 | DOC.md -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/go-grpc-middleware/auth/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Michal Witkowski. All Rights Reserved. 2 | // See LICENSE for licensing terms. 3 | 4 | /* 5 | `grpc_auth` a generic server-side auth middleware for gRPC. 6 | 7 | Server Side Auth Middleware 8 | 9 | It allows for easy assertion of `:authorization` headers in gRPC calls, be it HTTP Basic auth, or 10 | OAuth2 Bearer tokens. 11 | 12 | The middleware takes a user-customizable `AuthFunc`, which can be customized to verify and extract 13 | auth information from the request. The extracted information can be put in the `context.Context` of 14 | handlers downstream for retrieval. 15 | 16 | It also allows for per-service implementation overrides of `AuthFunc`. See `ServiceAuthFuncOverride`. 17 | 18 | Please see examples for simple examples of use. 19 | */ 20 | package grpc_auth 21 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/go-grpc-middleware/makefile: -------------------------------------------------------------------------------- 1 | SHELL="/bin/bash" 2 | 3 | GOFILES_NOVENDOR = $(shell go list ./... | grep -v /vendor/) 4 | 5 | all: vet fmt docs test 6 | 7 | docs: 8 | ./scripts/docs.sh generate 9 | 10 | checkdocs: 11 | ./scripts/docs.sh check 12 | 13 | fmt: 14 | go fmt $(GOFILES_NOVENDOR) 15 | 16 | vet: 17 | go vet $(GOFILES_NOVENDOR) 18 | 19 | test: vet 20 | ./scripts/test_all.sh 21 | 22 | .PHONY: all docs validate test 23 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/README.md: -------------------------------------------------------------------------------- 1 | DOC.md -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Michal Witkowski. All Rights Reserved. 2 | // See LICENSE for licensing terms. 3 | 4 | /* 5 | Package `metautils` provides convenience functions for dealing with gRPC metadata.MD objects inside 6 | Context handlers. 7 | 8 | While the upstream grpc-go package contains decent functionality (see https://github.com/grpc/grpc-go/blob/master/Documentation/grpc-metadata.md) 9 | they are hard to use. 10 | 11 | The majority of functions center around the NiceMD, which is a convenience wrapper around metadata.MD. For example 12 | the following code allows you to easily extract incoming metadata (server handler) and put it into a new client context 13 | metadata. 14 | 15 | nmd := metautils.ExtractIncoming(serverCtx).Clone(":authorization", ":custom") 16 | clientCtx := nmd.Set("x-client-header", "2").Set("x-another", "3").ToOutgoing(ctx) 17 | */ 18 | 19 | package metautils 20 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/go-grpc-middleware/util/metautils/single_key.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Michal Witkowski. All Rights Reserved. 2 | // See LICENSE for licensing terms. 3 | 4 | package metautils 5 | 6 | import ( 7 | "encoding/base64" 8 | "strings" 9 | ) 10 | 11 | const ( 12 | binHdrSuffix = "-bin" 13 | ) 14 | 15 | func encodeKeyValue(k, v string) (string, string) { 16 | k = strings.ToLower(k) 17 | if strings.HasSuffix(k, binHdrSuffix) { 18 | val := base64.StdEncoding.EncodeToString([]byte(v)) 19 | v = string(val) 20 | } 21 | return k, v 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/go-grpc-middleware/wrappers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Michal Witkowski. All Rights Reserved. 2 | // See LICENSE for licensing terms. 3 | 4 | package grpc_middleware 5 | 6 | import ( 7 | "golang.org/x/net/context" 8 | "google.golang.org/grpc" 9 | ) 10 | 11 | // WrappedServerStream is a thin wrapper around grpc.ServerStream that allows modifying context. 12 | type WrappedServerStream struct { 13 | grpc.ServerStream 14 | // WrappedContext is the wrapper's own Context. You can assign it. 15 | WrappedContext context.Context 16 | } 17 | 18 | // Context returns the wrapper's WrappedContext, overwriting the nested grpc.ServerStream.Context() 19 | func (w *WrappedServerStream) Context() context.Context { 20 | return w.WrappedContext 21 | } 22 | 23 | // WrapServerStream returns a ServerStream that has the ability to overwrite context. 24 | func WrapServerStream(stream grpc.ServerStream) *WrappedServerStream { 25 | if existing, ok := stream.(*WrappedServerStream); ok { 26 | return existing 27 | } 28 | return &WrappedServerStream{ServerStream: stream, WrappedContext: stream.Context()} 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/internal/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@io_bazel_rules_go//go:def.bzl", "go_library") 2 | load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library") 3 | 4 | package(default_visibility = ["//visibility:public"]) 5 | 6 | proto_library( 7 | name = "internal_proto", 8 | srcs = ["stream_chunk.proto"], 9 | deps = ["@com_google_protobuf//:any_proto"], 10 | ) 11 | 12 | go_proto_library( 13 | name = "internal_go_proto", 14 | importpath = "github.com/grpc-ecosystem/grpc-gateway/internal", 15 | proto = ":internal_proto", 16 | ) 17 | 18 | go_library( 19 | name = "go_default_library", 20 | embed = [":internal_go_proto"], 21 | importpath = "github.com/grpc-ecosystem/grpc-gateway/internal", 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/internal/stream_chunk.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package grpc.gateway.runtime; 3 | option go_package = "internal"; 4 | 5 | import "google/protobuf/any.proto"; 6 | 7 | // StreamError is a response type which is returned when 8 | // streaming rpc returns an error. 9 | message StreamError { 10 | int32 grpc_code = 1; 11 | int32 http_code = 2; 12 | string message = 3; 13 | string http_status = 4; 14 | repeated google.protobuf.Any details = 5; 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package runtime contains runtime helper functions used by 3 | servers which protoc-gen-grpc-gateway generates. 4 | */ 5 | package runtime 6 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/BUILD.bazel: -------------------------------------------------------------------------------- 1 | load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") 2 | 3 | package(default_visibility = ["//visibility:public"]) 4 | 5 | go_library( 6 | name = "go_default_library", 7 | srcs = [ 8 | "doc.go", 9 | "pattern.go", 10 | "readerfactory.go", 11 | "trie.go", 12 | ], 13 | importpath = "github.com/grpc-ecosystem/grpc-gateway/utilities", 14 | ) 15 | 16 | go_test( 17 | name = "go_default_test", 18 | size = "small", 19 | srcs = ["trie_test.go"], 20 | embed = [":go_default_library"], 21 | ) 22 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go: -------------------------------------------------------------------------------- 1 | // Package utilities provides members for internal use in grpc-gateway. 2 | package utilities 3 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go: -------------------------------------------------------------------------------- 1 | package utilities 2 | 3 | // An OpCode is a opcode of compiled path patterns. 4 | type OpCode int 5 | 6 | // These constants are the valid values of OpCode. 7 | const ( 8 | // OpNop does nothing 9 | OpNop = OpCode(iota) 10 | // OpPush pushes a component to stack 11 | OpPush 12 | // OpLitPush pushes a component to stack if it matches to the literal 13 | OpLitPush 14 | // OpPushM concatenates the remaining components and pushes it to stack 15 | OpPushM 16 | // OpConcatN pops N items from stack, concatenates them and pushes it back to stack 17 | OpConcatN 18 | // OpCapture pops an item and binds it to the variable 19 | OpCapture 20 | // OpEnd is the least positive invalid opcode. 21 | OpEnd 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go: -------------------------------------------------------------------------------- 1 | package utilities 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | "io/ioutil" 7 | ) 8 | 9 | // IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins 10 | // at the start of the stream 11 | func IOReaderFactory(r io.Reader) (func() io.Reader, error) { 12 | b, err := ioutil.ReadAll(r) 13 | if err != nil { 14 | return nil, err 15 | } 16 | 17 | return func() io.Reader { 18 | return bytes.NewReader(b) 19 | }, nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Matt T. Proud (matt.proud@gmail.com) 2 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | 3 | cover: 4 | go test -cover -v -coverprofile=cover.dat ./... 5 | go tool cover -func cover.dat 6 | 7 | .PHONY: cover 8 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Matt T. Proud 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package pbutil provides record length-delimited Protocol Buffer streaming. 16 | package pbutil 17 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Changes by Version 2 | ================== 3 | 4 | 1.1.0 (unreleased) 5 | ------------------- 6 | 7 | - Deprecate InitGlobalTracer() in favor of SetGlobalTracer() 8 | 9 | 10 | 1.0.0 (2016-09-26) 11 | ------------------- 12 | 13 | - This release implements OpenTracing Specification 1.0 (http://opentracing.io/spec) 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/Makefile: -------------------------------------------------------------------------------- 1 | PACKAGES := . ./mocktracer/... ./ext/... 2 | 3 | .DEFAULT_GOAL := test-and-lint 4 | 5 | .PHONE: test-and-lint 6 | 7 | test-and-lint: test lint 8 | 9 | .PHONY: test 10 | test: 11 | go test -v -cover -race ./... 12 | 13 | cover: 14 | @rm -rf cover-all.out 15 | $(foreach pkg, $(PACKAGES), $(MAKE) cover-pkg PKG=$(pkg) || true;) 16 | @grep mode: cover.out > coverage.out 17 | @cat cover-all.out >> coverage.out 18 | go tool cover -html=coverage.out -o cover.html 19 | @rm -rf cover.out cover-all.out coverage.out 20 | 21 | cover-pkg: 22 | go test -coverprofile cover.out $(PKG) 23 | @grep -v mode: cover.out >> cover-all.out 24 | 25 | .PHONY: lint 26 | lint: 27 | go fmt ./... 28 | golint ./... 29 | @# Run again with magic to exit non-zero if golint outputs anything. 30 | @! (golint ./... | read dummy) 31 | go vet ./... 32 | 33 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/globaltracer.go: -------------------------------------------------------------------------------- 1 | package opentracing 2 | 3 | var ( 4 | globalTracer Tracer = NoopTracer{} 5 | ) 6 | 7 | // SetGlobalTracer sets the [singleton] opentracing.Tracer returned by 8 | // GlobalTracer(). Those who use GlobalTracer (rather than directly manage an 9 | // opentracing.Tracer instance) should call SetGlobalTracer as early as 10 | // possible in main(), prior to calling the `StartSpan` global func below. 11 | // Prior to calling `SetGlobalTracer`, any Spans started via the `StartSpan` 12 | // (etc) globals are noops. 13 | func SetGlobalTracer(tracer Tracer) { 14 | globalTracer = tracer 15 | } 16 | 17 | // GlobalTracer returns the global singleton `Tracer` implementation. 18 | // Before `SetGlobalTracer()` is called, the `GlobalTracer()` is a noop 19 | // implementation that drops all data handed to it. 20 | func GlobalTracer() Tracer { 21 | return globalTracer 22 | } 23 | 24 | // StartSpan defers to `Tracer.StartSpan`. See `GlobalTracer()`. 25 | func StartSpan(operationName string, opts ...StartSpanOption) Span { 26 | return globalTracer.StartSpan(operationName, opts...) 27 | } 28 | 29 | // InitGlobalTracer is deprecated. Please use SetGlobalTracer. 30 | func InitGlobalTracer(tracer Tracer) { 31 | SetGlobalTracer(tracer) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 The OpenTracing Authors 4 | Copyright (c) 2016 Bas van Beek 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/Makefile: -------------------------------------------------------------------------------- 1 | 2 | .DEFAULT_GOAL := test 3 | 4 | .PHONY: test 5 | test: 6 | go test -v -race -cover ./... 7 | 8 | .PHONY: bench 9 | bench: 10 | go test -v -run - -bench . -benchmem ./... 11 | 12 | .PHONY: lint 13 | lint: 14 | # Ignore grep's exit code since no match returns 1. 15 | -golint ./... | grep --invert-match -E '^.*\.pb\.go|^thrift' 16 | @ 17 | @! (golint ./... | grep --invert-match -E '^.*\.pb\.go|^thrift' | read dummy) 18 | 19 | .PHONY: vet 20 | vet: 21 | go vet ./... 22 | 23 | .PHONY: all 24 | all: vet lint test bench 25 | 26 | .PHONY: example 27 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/circle.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | override: 3 | - sudo rm -rf /home/ubuntu/.go_workspace/src/github.com/openzipkin 4 | - mkdir -p /home/ubuntu/.go_workspace/src/github.com/openzipkin 5 | - mv /home/ubuntu/zipkin-go-opentracing /home/ubuntu/.go_workspace/src/github.com/openzipkin 6 | - ln -s /home/ubuntu/.go_workspace/src/github.com/openzipkin/zipkin-go-opentracing /home/ubuntu/zipkin-go-opentracing 7 | - go get -u -t -v github.com/openzipkin/zipkin-go-opentracing/... 8 | test: 9 | override: 10 | - make test bench 11 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/raw.go: -------------------------------------------------------------------------------- 1 | package zipkintracer 2 | 3 | import ( 4 | "time" 5 | 6 | opentracing "github.com/opentracing/opentracing-go" 7 | ) 8 | 9 | // RawSpan encapsulates all state associated with a (finished) Span. 10 | type RawSpan struct { 11 | // Those recording the RawSpan should also record the contents of its 12 | // SpanContext. 13 | Context SpanContext 14 | 15 | // The name of the "operation" this span is an instance of. (Called a "span 16 | // name" in some implementations) 17 | Operation string 18 | 19 | // We store rather than so that only 20 | // one of the timestamps has global clock uncertainty issues. 21 | Start time.Time 22 | Duration time.Duration 23 | 24 | // Essentially an extension mechanism. Can be used for many purposes, 25 | // not to be enumerated here. 26 | Tags opentracing.Tags 27 | 28 | // The span's "microlog". 29 | Logs []opentracing.LogRecord 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/scribe/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (1.0.0-dev) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package scribe 5 | 6 | var GoUnusedProtection__ int; 7 | 8 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/scribe/scribe-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (1.0.0-dev) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package scribe 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "reflect" 10 | "fmt" 11 | "github.com/apache/thrift/lib/go/thrift" 12 | ) 13 | 14 | // (needed to ensure safety because of naive import list construction.) 15 | var _ = thrift.ZERO 16 | var _ = fmt.Printf 17 | var _ = context.Background 18 | var _ = reflect.DeepEqual 19 | var _ = bytes.Equal 20 | 21 | 22 | func init() { 23 | } 24 | 25 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore/GoUnusedProtection__.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (1.0.0-dev) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package zipkincore 5 | 6 | var GoUnusedProtection__ int; 7 | 8 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore/zipkinCore-consts.go: -------------------------------------------------------------------------------- 1 | // Autogenerated by Thrift Compiler (1.0.0-dev) 2 | // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 3 | 4 | package zipkincore 5 | 6 | import ( 7 | "bytes" 8 | "context" 9 | "reflect" 10 | "fmt" 11 | "github.com/apache/thrift/lib/go/thrift" 12 | ) 13 | 14 | // (needed to ensure safety because of naive import list construction.) 15 | var _ = thrift.ZERO 16 | var _ = fmt.Printf 17 | var _ = context.Background 18 | var _ = reflect.DeepEqual 19 | var _ = bytes.Equal 20 | 21 | const CLIENT_SEND = "cs" 22 | const CLIENT_RECV = "cr" 23 | const SERVER_SEND = "ss" 24 | const SERVER_RECV = "sr" 25 | const WIRE_SEND = "ws" 26 | const WIRE_RECV = "wr" 27 | const CLIENT_SEND_FRAGMENT = "csf" 28 | const CLIENT_RECV_FRAGMENT = "crf" 29 | const SERVER_SEND_FRAGMENT = "ssf" 30 | const SERVER_RECV_FRAGMENT = "srf" 31 | const HTTP_HOST = "http.host" 32 | const HTTP_METHOD = "http.method" 33 | const HTTP_PATH = "http.path" 34 | const HTTP_URL = "http.url" 35 | const HTTP_STATUS_CODE = "http.status_code" 36 | const HTTP_REQUEST_SIZE = "http.request.size" 37 | const HTTP_RESPONSE_SIZE = "http.response.size" 38 | const LOCAL_COMPONENT = "lc" 39 | const ERROR = "error" 40 | const CLIENT_ADDR = "ca" 41 | const SERVER_ADDR = "sa" 42 | 43 | func init() { 44 | } 45 | 46 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/types/traceid.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | ) 7 | 8 | // TraceID is a 128 bit number internally stored as 2x uint64 (high & low). 9 | type TraceID struct { 10 | High uint64 11 | Low uint64 12 | } 13 | 14 | // TraceIDFromHex returns the TraceID from a Hex string. 15 | func TraceIDFromHex(h string) (t TraceID, err error) { 16 | if len(h) > 16 { 17 | if t.High, err = strconv.ParseUint(h[0:len(h)-16], 16, 64); err != nil { 18 | return 19 | } 20 | t.Low, err = strconv.ParseUint(h[len(h)-16:], 16, 64) 21 | return 22 | } 23 | t.Low, err = strconv.ParseUint(h, 16, 64) 24 | return 25 | } 26 | 27 | // ToHex outputs the 128-bit traceID as hex string. 28 | func (t TraceID) ToHex() string { 29 | if t.High == 0 { 30 | return fmt.Sprintf("%016x", t.Low) 31 | } 32 | return fmt.Sprintf("%016x%016x", t.High, t.Low) 33 | } 34 | 35 | // Empty returns if TraceID has zero value 36 | func (t TraceID) Empty() bool { 37 | return t.Low == 0 && t.High == 0 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/util.go: -------------------------------------------------------------------------------- 1 | package zipkintracer 2 | 3 | import ( 4 | "math/rand" 5 | "sync" 6 | "time" 7 | ) 8 | 9 | var ( 10 | seededIDGen = rand.New(rand.NewSource(time.Now().UnixNano())) 11 | // The golang rand generators are *not* intrinsically thread-safe. 12 | seededIDLock sync.Mutex 13 | ) 14 | 15 | func randomID() uint64 { 16 | seededIDLock.Lock() 17 | defer seededIDLock.Unlock() 18 | return uint64(seededIDGen.Int63()) 19 | } 20 | 21 | func randomID2() (uint64, uint64) { 22 | seededIDLock.Lock() 23 | defer seededIDLock.Unlock() 24 | return uint64(seededIDGen.Int63()), uint64(seededIDGen.Int63()) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/wire/gen.go: -------------------------------------------------------------------------------- 1 | package wire 2 | 3 | //go:generate protoc --gogofaster_out=$GOPATH/src wire.proto 4 | 5 | // Run `go get github.com/gogo/protobuf/protoc-gen-gogofaster` to install the 6 | // gogofaster generator binary. 7 | -------------------------------------------------------------------------------- /vendor/github.com/openzipkin/zipkin-go-opentracing/wire/wire.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package zipkintracer_go.wire; 3 | option go_package = "github.com/openzipkin/zipkin-go-opentracing/wire"; 4 | 5 | message TracerState { 6 | fixed64 trace_id = 1; 7 | fixed64 span_id = 2; 8 | bool sampled = 3; 9 | map baggage_items = 4; 10 | fixed64 trace_id_high = 20; 11 | fixed64 parent_span_id = 21; 12 | fixed64 flags = 22; 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/pquerna/ffjson/NOTICE: -------------------------------------------------------------------------------- 1 | ffjson 2 | Copyright (c) 2014, Paul Querna 3 | 4 | This product includes software developed by 5 | Paul Querna (http://paul.querna.org/). 6 | 7 | Portions of this software were developed as 8 | part of Go, Copyright (c) 2012 The Go Authors. -------------------------------------------------------------------------------- /vendor/github.com/pquerna/ffjson/ffjson/pool.go: -------------------------------------------------------------------------------- 1 | package ffjson 2 | 3 | /** 4 | * Copyright 2015 Paul Querna, Klaus Post 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | */ 19 | 20 | import ( 21 | fflib "github.com/pquerna/ffjson/fflib/v1" 22 | ) 23 | 24 | // Send a buffer to the Pool to reuse for other instances. 25 | // 26 | // On servers where you have a lot of concurrent encoding going on, 27 | // you can hand back the byte buffer you get marshalling once you are done using it. 28 | // 29 | // You may no longer utilize the content of the buffer, since it may be used 30 | // by other goroutines. 31 | func Pool(b []byte) { 32 | fflib.Pool(b) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/pquerna/ffjson/fflib/v1/buffer_nopool.go: -------------------------------------------------------------------------------- 1 | // +build !go1.3 2 | 3 | package v1 4 | 5 | // Stub version of buffer_pool.go for Go 1.2, which doesn't have sync.Pool. 6 | 7 | func Pool(b []byte) {} 8 | 9 | func makeSlice(n int) []byte { 10 | return make([]byte, n) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/pquerna/ffjson/fflib/v1/reader_scan_generic.go: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2014 Paul Querna 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | package v1 19 | 20 | func scanString(s []byte, j int) (int, byte) { 21 | for { 22 | if j >= len(s) { 23 | return j, 0 24 | } 25 | 26 | c := s[j] 27 | j++ 28 | if byteLookupTable[c]&sliceStringMask == 0 { 29 | continue 30 | } 31 | 32 | return j, c 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/NOTICE: -------------------------------------------------------------------------------- 1 | Prometheus instrumentation library for Go applications 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | 7 | 8 | The following components are included in this product: 9 | 10 | perks - a fork of https://github.com/bmizerany/perks 11 | https://github.com/beorn7/perks 12 | Copyright 2013-2015 Blake Mizerany, Björn Rabenstein 13 | See https://github.com/beorn7/perks/blob/master/README.md for license details. 14 | 15 | Go support for Protocol Buffers - Google's data interchange format 16 | http://github.com/golang/protobuf/ 17 | Copyright 2010 The Go Authors 18 | See source code for license details. 19 | 20 | Support for streaming Protocol Buffer messages for the Go language (golang). 21 | https://github.com/matttproud/golang_protobuf_extensions 22 | Copyright 2013 Matt T. Proud 23 | Licensed under the Apache License, Version 2.0 24 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/README.md: -------------------------------------------------------------------------------- 1 | See [![go-doc](https://godoc.org/github.com/prometheus/client_golang/prometheus?status.svg)](https://godoc.org/github.com/prometheus/client_golang/prometheus). 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/fnv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package prometheus 15 | 16 | // Inline and byte-free variant of hash/fnv's fnv64a. 17 | 18 | const ( 19 | offset64 = 14695981039346656037 20 | prime64 = 1099511628211 21 | ) 22 | 23 | // hashNew initializies a new fnv64a hash value. 24 | func hashNew() uint64 { 25 | return offset64 26 | } 27 | 28 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 29 | func hashAdd(h uint64, s string) uint64 { 30 | for i := 0; i < len(s); i++ { 31 | h ^= uint64(s[i]) 32 | h *= prime64 33 | } 34 | return h 35 | } 36 | 37 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 38 | func hashAddByte(h uint64, b byte) uint64 { 39 | h ^= uint64(b) 40 | h *= prime64 41 | return h 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator_pre_1_8.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build !go1.8 15 | 16 | package promhttp 17 | 18 | import ( 19 | "io" 20 | "net/http" 21 | ) 22 | 23 | func newDelegator(w http.ResponseWriter, observeWriteHeaderFunc func(int)) delegator { 24 | d := &responseWriterDelegator{ 25 | ResponseWriter: w, 26 | observeWriteHeader: observeWriteHeaderFunc, 27 | } 28 | 29 | id := 0 30 | if _, ok := w.(http.CloseNotifier); ok { 31 | id += closeNotifier 32 | } 33 | if _, ok := w.(http.Flusher); ok { 34 | id += flusher 35 | } 36 | if _, ok := w.(http.Hijacker); ok { 37 | id += hijacker 38 | } 39 | if _, ok := w.(io.ReaderFrom); ok { 40 | id += readerFrom 41 | } 42 | 43 | return pickDelegator[id](d) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_model/NOTICE: -------------------------------------------------------------------------------- 1 | Data model artifacts for Prometheus. 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/NOTICE: -------------------------------------------------------------------------------- 1 | Common libraries shared by Prometheus Go components. 2 | Copyright 2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/expfmt/fuzz.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Build only when actually fuzzing 15 | // +build gofuzz 16 | 17 | package expfmt 18 | 19 | import "bytes" 20 | 21 | // Fuzz text metric parser with with github.com/dvyukov/go-fuzz: 22 | // 23 | // go-fuzz-build github.com/prometheus/common/expfmt 24 | // go-fuzz -bin expfmt-fuzz.zip -workdir fuzz 25 | // 26 | // Further input samples should go in the folder fuzz/corpus. 27 | func Fuzz(in []byte) int { 28 | parser := TextParser{} 29 | _, err := parser.TextToMetricFamilies(bytes.NewReader(in)) 30 | 31 | if err != nil { 32 | return 0 33 | } 34 | 35 | return 1 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/model/fnv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package model 15 | 16 | // Inline and byte-free variant of hash/fnv's fnv64a. 17 | 18 | const ( 19 | offset64 = 14695981039346656037 20 | prime64 = 1099511628211 21 | ) 22 | 23 | // hashNew initializies a new fnv64a hash value. 24 | func hashNew() uint64 { 25 | return offset64 26 | } 27 | 28 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 29 | func hashAdd(h uint64, s string) uint64 { 30 | for i := 0; i < len(s); i++ { 31 | h ^= uint64(s[i]) 32 | h *= prime64 33 | } 34 | return h 35 | } 36 | 37 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 38 | func hashAddByte(h uint64, b byte) uint64 { 39 | h ^= uint64(b) 40 | h *= prime64 41 | return h 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/model/model.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package model contains common data structures that are shared across 15 | // Prometheus components and libraries. 16 | package model 17 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Prometheus uses GitHub to manage reviews of pull requests. 4 | 5 | * If you have a trivial fix or improvement, go ahead and create a pull request, 6 | addressing (with `@...`) the maintainer of this repository (see 7 | [MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request. 8 | 9 | * If you plan to do something more involved, first discuss your ideas 10 | on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). 11 | This will avoid unnecessary work and surely give you and us a good deal 12 | of inspiration. 13 | 14 | * Relevant coding style guidelines are the [Go Code Review 15 | Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) 16 | and the _Formatting and style_ section of Peter Bourgon's [Go: Best 17 | Practices for Production 18 | Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). 19 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | * Tobias Schmidt 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/Makefile: -------------------------------------------------------------------------------- 1 | ci: 2 | ! gofmt -l *.go | read nothing 3 | go vet 4 | go test -v ./... 5 | go get github.com/golang/lint/golint 6 | golint *.go 7 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/NOTICE: -------------------------------------------------------------------------------- 1 | procfs provides functions to retrieve system, kernel and process 2 | metrics from the pseudo-filesystem proc. 3 | 4 | Copyright 2014-2015 The Prometheus Authors 5 | 6 | This product includes software developed at 7 | SoundCloud Ltd. (http://soundcloud.com/). 8 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/README.md: -------------------------------------------------------------------------------- 1 | # procfs 2 | 3 | This procfs package provides functions to retrieve system, kernel and process 4 | metrics from the pseudo-filesystem proc. 5 | 6 | *WARNING*: This package is a work in progress. Its API may still break in 7 | backwards-incompatible ways without warnings. Use it at your own risk. 8 | 9 | [![GoDoc](https://godoc.org/github.com/prometheus/procfs?status.png)](https://godoc.org/github.com/prometheus/procfs) 10 | [![Build Status](https://travis-ci.org/prometheus/procfs.svg?branch=master)](https://travis-ci.org/prometheus/procfs) 11 | [![Go Report Card](https://goreportcard.com/badge/github.com/prometheus/procfs)](https://goreportcard.com/report/github.com/prometheus/procfs) 12 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/fs.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path" 7 | 8 | "github.com/prometheus/procfs/xfs" 9 | ) 10 | 11 | // FS represents the pseudo-filesystem proc, which provides an interface to 12 | // kernel data structures. 13 | type FS string 14 | 15 | // DefaultMountPoint is the common mount point of the proc filesystem. 16 | const DefaultMountPoint = "/proc" 17 | 18 | // NewFS returns a new FS mounted under the given mountPoint. It will error 19 | // if the mount point can't be read. 20 | func NewFS(mountPoint string) (FS, error) { 21 | info, err := os.Stat(mountPoint) 22 | if err != nil { 23 | return "", fmt.Errorf("could not read %s: %s", mountPoint, err) 24 | } 25 | if !info.IsDir() { 26 | return "", fmt.Errorf("mount point %s is not a directory", mountPoint) 27 | } 28 | 29 | return FS(mountPoint), nil 30 | } 31 | 32 | // Path returns the path of the given subsystem relative to the procfs root. 33 | func (fs FS) Path(p ...string) string { 34 | return path.Join(append([]string{string(fs)}, p...)...) 35 | } 36 | 37 | // XFSStats retrieves XFS filesystem runtime statistics. 38 | func (fs FS) XFSStats() (*xfs.Stats, error) { 39 | f, err := os.Open(fs.Path("fs/xfs/stat")) 40 | if err != nil { 41 | return nil, err 42 | } 43 | defer f.Close() 44 | 45 | return xfs.ParseStats(f) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/proc_io.go: -------------------------------------------------------------------------------- 1 | package procfs 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "os" 7 | ) 8 | 9 | // ProcIO models the content of /proc//io. 10 | type ProcIO struct { 11 | // Chars read. 12 | RChar uint64 13 | // Chars written. 14 | WChar uint64 15 | // Read syscalls. 16 | SyscR uint64 17 | // Write syscalls. 18 | SyscW uint64 19 | // Bytes read. 20 | ReadBytes uint64 21 | // Bytes written. 22 | WriteBytes uint64 23 | // Bytes written, but taking into account truncation. See 24 | // Documentation/filesystems/proc.txt in the kernel sources for 25 | // detailed explanation. 26 | CancelledWriteBytes int64 27 | } 28 | 29 | // NewIO creates a new ProcIO instance from a given Proc instance. 30 | func (p Proc) NewIO() (ProcIO, error) { 31 | pio := ProcIO{} 32 | 33 | f, err := os.Open(p.path("io")) 34 | if err != nil { 35 | return pio, err 36 | } 37 | defer f.Close() 38 | 39 | data, err := ioutil.ReadAll(f) 40 | if err != nil { 41 | return pio, err 42 | } 43 | 44 | ioFormat := "rchar: %d\nwchar: %d\nsyscr: %d\nsyscw: %d\n" + 45 | "read_bytes: %d\nwrite_bytes: %d\n" + 46 | "cancelled_write_bytes: %d\n" 47 | 48 | _, err = fmt.Sscanf(string(data), ioFormat, &pio.RChar, &pio.WChar, &pio.SyscR, 49 | &pio.SyscW, &pio.ReadBytes, &pio.WriteBytes, &pio.CancelledWriteBytes) 50 | if err != nil { 51 | return pio, err 52 | } 53 | 54 | return pio, nil 55 | } 56 | -------------------------------------------------------------------------------- /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 . 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell 2 | 3 | Please consider promoting this project if you find it useful. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 21 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 22 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /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 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 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=require -template=require_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { 4 | t.FailNow() 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl 10 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/suite/interfaces.go: -------------------------------------------------------------------------------- 1 | package suite 2 | 3 | import "testing" 4 | 5 | // TestingSuite can store and return the current *testing.T context 6 | // generated by 'go test'. 7 | type TestingSuite interface { 8 | T() *testing.T 9 | SetT(*testing.T) 10 | } 11 | 12 | // SetupAllSuite has a SetupSuite method, which will run before the 13 | // tests in the suite are run. 14 | type SetupAllSuite interface { 15 | SetupSuite() 16 | } 17 | 18 | // SetupTestSuite has a SetupTest method, which will run before each 19 | // test in the suite. 20 | type SetupTestSuite interface { 21 | SetupTest() 22 | } 23 | 24 | // TearDownAllSuite has a TearDownSuite method, which will run after 25 | // all the tests in the suite have been run. 26 | type TearDownAllSuite interface { 27 | TearDownSuite() 28 | } 29 | 30 | // TearDownTestSuite has a TearDownTest method, which will run after 31 | // each test in the suite. 32 | type TearDownTestSuite interface { 33 | TearDownTest() 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/zheng-ji/goSnowFlake/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## 1.0.0 (2016-03-05) 4 | 5 | - [x] ThreadSafe unique id generator 6 | - [x] Green pluggable, without external storage like redis or mysql 7 | - [x] Suitable for distributed systems 8 | - [x] Implement Twitter SnowFlake theory 9 | 10 | ## 1.0.1 (2016-03-06) 11 | 12 | - [x] ADD HTTP Server With Gin 13 | - [x] Change Package Name from snowflake to goSnowFlake 14 | 15 | ## 1.0.2 (2016-03-08) 16 | 17 | - [x] Fix [issue](https://github.com/zheng-ji/goSnowFlake/issues/1) 18 | 19 | ## 1.1.0 (2016-09-29) 20 | 21 | - [x] Merge Pull Request,Fix algorithm bug and add ParseId 22 | 23 | ### 1.1.1 (2018-09-06) 24 | - [x] fix timeReGen[issuce](https://github.com/zheng-ji/goSnowFlake/issues/9) 25 | -------------------------------------------------------------------------------- /vendor/github.com/zheng-ji/goSnowFlake/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 zheng-ji.info 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/go.uber.org/atomic/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/go.uber.org/multierr/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2017 Uber Technologies, Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/go.uber.org/zap/time.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 Uber Technologies, Inc. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | 21 | package zap 22 | 23 | import "time" 24 | 25 | func timeToMillis(t time.Time) int64 { 26 | return t.UnixNano() / int64(time.Millisecond) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/Makefile: -------------------------------------------------------------------------------- 1 | curlimage: 2 | docker build -t gohttp2/curl . 3 | 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/README: -------------------------------------------------------------------------------- 1 | This is a work-in-progress HTTP/2 implementation for Go. 2 | 3 | It will eventually live in the Go standard library and won't require 4 | any changes to your code to use. It will just be automatic. 5 | 6 | Status: 7 | 8 | * The server support is pretty good. A few things are missing 9 | but are being worked on. 10 | * The client work has just started but shares a lot of code 11 | is coming along much quicker. 12 | 13 | Docs are at https://godoc.org/golang.org/x/net/http2 14 | 15 | Demo test server at https://http2.golang.org/ 16 | 17 | Help & bug reports welcome! 18 | 19 | Contributing: https://golang.org/doc/contribute.html 20 | Bugs: https://golang.org/issue/new?title=x/net/http2:+ 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/flow.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Flow control 6 | 7 | package http2 8 | 9 | // flow is the flow control window's size. 10 | type flow struct { 11 | // n is the number of DATA bytes we're allowed to send. 12 | // A flow is kept both on a conn and a per-stream. 13 | n int32 14 | 15 | // conn points to the shared connection-level flow that is 16 | // shared by all streams on that conn. It is nil for the flow 17 | // that's on the conn directly. 18 | conn *flow 19 | } 20 | 21 | func (f *flow) setConnFlow(cf *flow) { f.conn = cf } 22 | 23 | func (f *flow) available() int32 { 24 | n := f.n 25 | if f.conn != nil && f.conn.n < n { 26 | n = f.conn.n 27 | } 28 | return n 29 | } 30 | 31 | func (f *flow) take(n int32) { 32 | if n > f.available() { 33 | panic("internal error: took too much") 34 | } 35 | f.n -= n 36 | if f.conn != nil { 37 | f.conn.n -= n 38 | } 39 | } 40 | 41 | // add adds n bytes (positive or negative) to the flow control window. 42 | // It returns false if the sum would exceed 2^31-1. 43 | func (f *flow) add(n int32) bool { 44 | remain := (1<<31 - 1) - f.n 45 | if n > remain { 46 | return false 47 | } 48 | f.n += n 49 | return true 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 15 | return t1.ExpectContinueTimeout 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | s.RegisterOnShutdown(conf.state.startGracefulShutdown) 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func configureTransport(t1 *http.Transport) (*Transport, error) { 15 | return nil, errTransportVersion 16 | } 17 | 18 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 19 | return 0 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | func configureServer18(h1 *http.Server, h2 *Server) error { 15 | // No IdleTimeout to sync prior to Go 1.8. 16 | return nil 17 | } 18 | 19 | func shouldLogPanic(panicValue interface{}) bool { 20 | return panicValue != nil 21 | } 22 | 23 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 24 | return nil 25 | } 26 | 27 | func reqBodyIsNoBody(io.ReadCloser) bool { return false } 28 | 29 | func go18httpNoBody() io.ReadCloser { return nil } // for tests only 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | // not supported prior to go1.9 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7 6 | 7 | package trace 8 | 9 | import "golang.org/x/net/context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package trace 8 | 9 | import "context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /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-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_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_ppc64x.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 linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, 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), R3 27 | MOVD a2+16(FP), R4 28 | MOVD a3+24(FP), R5 29 | MOVD R0, R6 30 | MOVD R0, R7 31 | MOVD R0, R8 32 | MOVD trap+0(FP), R9 // syscall entry 33 | SYSCALL R9 34 | MOVD R3, r1+32(FP) 35 | MOVD R4, 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), R3 47 | MOVD a2+16(FP), R4 48 | MOVD a3+24(FP), R5 49 | MOVD R0, R6 50 | MOVD R0, R7 51 | MOVD R0, R8 52 | MOVD trap+0(FP), R9 // syscall entry 53 | SYSCALL R9 54 | MOVD R3, r1+32(FP) 55 | MOVD R4, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /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 aix 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 aix 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 aix 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/fcntl.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 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 16 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 26 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 27 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 28 | if errno == 0 { 29 | return nil 30 | } 31 | return errno 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_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_c.c: -------------------------------------------------------------------------------- 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 !aix 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret 25 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 26 | { 27 | struct ret r; 28 | 29 | errno = 0; 30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 31 | r.err = errno; 32 | return r; 33 | } 34 | 35 | uintptr_t 36 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 37 | { 38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 39 | } 40 | -------------------------------------------------------------------------------- /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/ioctl.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 darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. 12 | // 13 | // To change fd's window size, the req argument should be TIOCSWINSZ. 14 | func IoctlSetWinsize(fd int, req uint, value *Winsize) error { 15 | // TODO: if we get the chance, remove the req parameter and 16 | // hardcode TIOCSWINSZ. 17 | err := ioctlSetWinsize(fd, req, value) 18 | runtime.KeepAlive(value) 19 | return err 20 | } 21 | 22 | // IoctlSetTermios performs an ioctl on fd with a *Termios. 23 | // 24 | // The req value will usually be TCSETA or TIOCSETA. 25 | func IoctlSetTermios(fd int, req uint, value *Termios) error { 26 | // TODO: if we get the chance, remove the req parameter. 27 | err := ioctlSetTermios(fd, req, value) 28 | runtime.KeepAlive(value) 29 | return err 30 | } 31 | -------------------------------------------------------------------------------- /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+(?:NO)?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_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc64 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: sec, Nsec: nsec} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int64(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /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_gc_386.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,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.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,386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.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,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /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 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/text/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/Makefile: -------------------------------------------------------------------------------- 1 | all: vet test testrace testappengine 2 | 3 | build: deps 4 | go build google.golang.org/grpc/... 5 | 6 | clean: 7 | go clean -i google.golang.org/grpc/... 8 | 9 | deps: 10 | go get -d -v google.golang.org/grpc/... 11 | 12 | proto: 13 | @ if ! which protoc > /dev/null; then \ 14 | echo "error: protoc not installed" >&2; \ 15 | exit 1; \ 16 | fi 17 | go generate google.golang.org/grpc/... 18 | 19 | test: testdeps 20 | go test -cpu 1,4 -timeout 7m google.golang.org/grpc/... 21 | 22 | testappengine: testappenginedeps 23 | goapp test -cpu 1,4 -timeout 7m google.golang.org/grpc/... 24 | 25 | testappenginedeps: 26 | goapp get -d -v -t -tags 'appengine appenginevm' google.golang.org/grpc/... 27 | 28 | testdeps: 29 | go get -d -v -t google.golang.org/grpc/... 30 | 31 | testrace: testdeps 32 | go test -race -cpu 1,4 -timeout 7m google.golang.org/grpc/... 33 | 34 | updatedeps: 35 | go get -d -v -u -f google.golang.org/grpc/... 36 | 37 | updatetestdeps: 38 | go get -d -v -t -u -f google.golang.org/grpc/... 39 | 40 | vet: vetdeps 41 | ./vet.sh 42 | 43 | vetdeps: 44 | ./vet.sh -install 45 | 46 | .PHONY: \ 47 | all \ 48 | build \ 49 | clean \ 50 | deps \ 51 | proto \ 52 | test \ 53 | testappengine \ 54 | testappenginedeps \ 55 | testdeps \ 56 | testrace \ 57 | updatedeps \ 58 | updatetestdeps \ 59 | vet \ 60 | vetdeps 61 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/backoff.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2017 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // See internal/backoff package for the backoff implementation. This file is 20 | // kept for the exported types and API backward compatility. 21 | 22 | package grpc 23 | 24 | import ( 25 | "time" 26 | ) 27 | 28 | // DefaultBackoffConfig uses values specified for backoff in 29 | // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. 30 | var DefaultBackoffConfig = BackoffConfig{ 31 | MaxDelay: 120 * time.Second, 32 | } 33 | 34 | // BackoffConfig defines the parameters for the default gRPC backoff strategy. 35 | type BackoffConfig struct { 36 | // MaxDelay is the upper bound of backoff delay. 37 | MaxDelay time.Duration 38 | } 39 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/codegen.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script serves as an example to demonstrate how to generate the gRPC-Go 4 | # interface and the related messages from .proto file. 5 | # 6 | # It assumes the installation of i) Google proto buffer compiler at 7 | # https://github.com/google/protobuf (after v2.6.1) and ii) the Go codegen 8 | # plugin at https://github.com/golang/protobuf (after 2015-02-20). If you have 9 | # not, please install them first. 10 | # 11 | # We recommend running this script at $GOPATH/src. 12 | # 13 | # If this is not what you need, feel free to make your own scripts. Again, this 14 | # script is for demonstration purpose. 15 | # 16 | proto=$1 17 | protoc --go_out=plugins=grpc:. $proto 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/credentials/internal/syscallconn_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | /* 4 | * 5 | * Copyright 2018 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package internal 22 | 23 | import ( 24 | "net" 25 | ) 26 | 27 | // WrapSyscallConn returns newConn on appengine. 28 | func WrapSyscallConn(rawConn, newConn net.Conn) net.Conn { 29 | return newConn 30 | } 31 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | /* 20 | Package grpc implements an RPC system called gRPC. 21 | 22 | See grpc.io for more information about gRPC. 23 | */ 24 | package grpc // import "google.golang.org/grpc" 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/go.mod: -------------------------------------------------------------------------------- 1 | module google.golang.org/grpc 2 | 3 | require ( 4 | cloud.google.com/go v0.26.0 // indirect 5 | github.com/client9/misspell v0.3.4 6 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b 7 | github.com/golang/mock v1.1.1 8 | github.com/golang/protobuf v1.2.0 9 | github.com/kisielk/gotool v1.0.0 // indirect 10 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 11 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d 12 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be 13 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f // indirect 14 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522 15 | golang.org/x/text v0.3.0 // indirect 16 | golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52 17 | google.golang.org/appengine v1.1.0 // indirect 18 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 19 | honnef.co/go/tools v0.0.0-20180728063816-88497007e858 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/install_gae.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TMP=$(mktemp -d /tmp/sdk.XXX) \ 4 | && curl -o $TMP.zip "https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.68.zip" \ 5 | && unzip -q $TMP.zip -d $TMP \ 6 | && export PATH="$PATH:$TMP/go_appengine" 7 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/binarylog/regenerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2018 gRPC authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -eux -o pipefail 17 | 18 | TMP=$(mktemp -d) 19 | 20 | function finish { 21 | rm -rf "$TMP" 22 | } 23 | trap finish EXIT 24 | 25 | pushd "$TMP" 26 | mkdir -p grpc/binarylog/grpc_binarylog_v1 27 | curl https://raw.githubusercontent.com/grpc/grpc-proto/master/grpc/binlog/v1/binarylog.proto > grpc/binarylog/grpc_binarylog_v1/binarylog.proto 28 | 29 | protoc --go_out=plugins=grpc,paths=source_relative:. -I. grpc/binarylog/grpc_binarylog_v1/*.proto 30 | popd 31 | rm -f ./grpc_binarylog_v1/*.pb.go 32 | cp "$TMP"/grpc/binarylog/grpc_binarylog_v1/*.pb.go ../../binarylog/grpc_binarylog_v1/ 33 | 34 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/binarylog/util.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2018 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package binarylog 20 | 21 | import ( 22 | "errors" 23 | "strings" 24 | ) 25 | 26 | // parseMethodName splits service and method from the input. It expects format 27 | // "/service/method". 28 | // 29 | // TODO: move to internal/grpcutil. 30 | func parseMethodName(methodName string) (service, method string, _ error) { 31 | if !strings.HasPrefix(methodName, "/") { 32 | return "", "", errors.New("invalid method name: should start with /") 33 | } 34 | methodName = methodName[1:] 35 | 36 | pos := strings.LastIndex(methodName, "/") 37 | if pos < 0 { 38 | return "", "", errors.New("invalid method name: suffix /method is missing") 39 | } 40 | return methodName[:pos], methodName[pos+1:], nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/channelz/util_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux,!appengine 2 | 3 | /* 4 | * 5 | * Copyright 2018 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package channelz 22 | 23 | import ( 24 | "syscall" 25 | ) 26 | 27 | // GetSocketOption gets the socket option info of the conn. 28 | func GetSocketOption(socket interface{}) *SocketOptionData { 29 | c, ok := socket.(syscall.Conn) 30 | if !ok { 31 | return nil 32 | } 33 | data := &SocketOptionData{} 34 | if rawConn, err := c.SyscallConn(); err == nil { 35 | rawConn.Control(data.Getsockopt) 36 | return data 37 | } 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/channelz/util_nonlinux.go: -------------------------------------------------------------------------------- 1 | // +build !linux appengine 2 | 3 | /* 4 | * 5 | * Copyright 2018 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package channelz 22 | 23 | // GetSocketOption gets the socket option info of the conn. 24 | func GetSocketOption(c interface{}) *SocketOptionData { 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/transport/log.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2017 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // This file contains wrappers for grpclog functions. 20 | // The transport package only logs to verbose level 2 by default. 21 | 22 | package transport 23 | 24 | import "google.golang.org/grpc/grpclog" 25 | 26 | const logLevel = 2 27 | 28 | func infof(format string, args ...interface{}) { 29 | if grpclog.V(logLevel) { 30 | grpclog.Infof(format, args...) 31 | } 32 | } 33 | 34 | func warningf(format string, args ...interface{}) { 35 | if grpclog.V(logLevel) { 36 | grpclog.Warningf(format, args...) 37 | } 38 | } 39 | 40 | func errorf(format string, args ...interface{}) { 41 | if grpclog.V(logLevel) { 42 | grpclog.Errorf(format, args...) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/version.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2018 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package grpc 20 | 21 | // Version is the current grpc version. 22 | const Version = "1.18.0-dev" 23 | --------------------------------------------------------------------------------