├── .gitignore ├── LICENSE ├── README.md ├── client └── client.go ├── cmd ├── root.go └── server.go ├── conf └── certs │ ├── ca-config.json │ ├── ca-csr.json │ ├── ca-key.pem │ ├── ca.csr │ ├── ca.pem │ ├── server-key.pem │ ├── server.csr │ ├── server.json │ └── server.pem ├── main.go ├── pkg ├── ui │ └── data │ │ └── swagger │ │ └── datafile.go └── util │ ├── grpc.go │ └── tls.go ├── proto ├── google │ └── api │ │ ├── annotations.pb.go │ │ ├── annotations.proto │ │ ├── http.pb.go │ │ └── http.proto ├── hello.pb.go ├── hello.pb.gw.go ├── hello.proto └── hello.swagger.json ├── server ├── hello.go └── server.go ├── third_party └── swagger-ui │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── index.html │ ├── oauth2-redirect.html │ ├── swagger-ui-bundle.js │ ├── swagger-ui-bundle.js.map │ ├── swagger-ui-standalone-preset.js │ ├── swagger-ui-standalone-preset.js.map │ ├── swagger-ui.css │ ├── swagger-ui.css.map │ ├── swagger-ui.js │ └── swagger-ui.js.map └── 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 │ │ ├── admin.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_groups_request.go │ │ ├── delete_groups_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 │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── 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 ├── 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 │ │ ├── fuzz.go │ │ └── snappy.go │ └── queue │ │ ├── LICENSE │ │ ├── README.md │ │ └── queue.go ├── elazarl │ └── go-bindata-assetfs │ │ ├── LICENSE │ │ ├── README.md │ │ ├── assetfs.go │ │ └── doc.go ├── go-logfmt │ └── logfmt │ │ ├── LICENSE │ │ ├── README.md │ │ ├── decode.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── fuzz.go │ │ └── jsonstring.go ├── gogo │ └── protobuf │ │ ├── LICENSE │ │ └── proto │ │ ├── Makefile │ │ ├── clone.go │ │ ├── custom_gogo.go │ │ ├── decode.go │ │ ├── discard.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 │ │ ├── table_marshal.go │ │ ├── table_marshal_gogo.go │ │ ├── table_merge.go │ │ ├── table_unmarshal.go │ │ ├── table_unmarshal_gogo.go │ │ ├── text.go │ │ ├── text_gogo.go │ │ ├── text_parser.go │ │ ├── timestamp.go │ │ └── timestamp_gogo.go ├── golang │ ├── protobuf │ │ ├── LICENSE │ │ ├── jsonpb │ │ │ └── jsonpb.go │ │ ├── proto │ │ │ ├── Makefile │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── discard.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ │ ├── protoc-gen-go │ │ │ └── descriptor │ │ │ │ ├── Makefile │ │ │ │ ├── descriptor.pb.go │ │ │ │ └── descriptor.proto │ │ └── ptypes │ │ │ ├── any.go │ │ │ ├── any │ │ │ ├── any.pb.go │ │ │ └── any.proto │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration │ │ │ ├── duration.pb.go │ │ │ └── duration.proto │ │ │ ├── regen.sh │ │ │ ├── struct │ │ │ ├── struct.pb.go │ │ │ └── struct.proto │ │ │ ├── timestamp.go │ │ │ └── timestamp │ │ │ ├── timestamp.pb.go │ │ │ └── timestamp.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 │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── DOC.md │ │ ├── Gopkg.lock │ │ ├── Gopkg.toml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── chain.go │ │ ├── doc.go │ │ ├── makefile │ │ ├── slack.png │ │ └── wrappers.go │ ├── grpc-gateway │ │ ├── LICENSE.txt │ │ ├── runtime │ │ │ ├── context.go │ │ │ ├── convert.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── handler.go │ │ │ ├── internal │ │ │ │ ├── stream_chunk.pb.go │ │ │ │ └── stream_chunk.proto │ │ │ ├── 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 │ │ │ ├── doc.go │ │ │ ├── pattern.go │ │ │ └── trie.go │ └── grpc-opentracing │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── go │ │ └── otgrpc │ │ ├── README.md │ │ ├── client.go │ │ ├── errors.go │ │ ├── options.go │ │ ├── package.go │ │ ├── server.go │ │ └── shared.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 │ │ ├── noop.go │ │ ├── propagation.go │ │ ├── span.go │ │ └── tracer.go ├── openzipkin-contrib │ └── zipkin-go-opentracing │ │ ├── LICENSE │ │ ├── flag │ │ └── flags.go │ │ ├── thrift │ │ └── gen-go │ │ │ ├── scribe │ │ │ ├── GoUnusedProtection__.go │ │ │ ├── scribe-consts.go │ │ │ └── scribe.go │ │ │ └── zipkincore │ │ │ ├── GoUnusedProtection__.go │ │ │ ├── zipkinCore-consts.go │ │ │ └── zipkinCore.go │ │ ├── types │ │ └── traceid.go │ │ └── wire │ │ ├── carrier.go │ │ ├── gen.go │ │ ├── wire.pb.go │ │ └── wire.proto ├── openzipkin │ └── zipkin-go-opentracing │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── collector-http.go │ │ ├── collector-kafka.go │ │ ├── collector-scribe.go │ │ ├── collector.go │ │ ├── context.go │ │ ├── debug.go │ │ ├── event.go │ │ ├── log-materializers.go │ │ ├── logger.go │ │ ├── observer.go │ │ ├── propagation.go │ │ ├── propagation_ot.go │ │ ├── raw.go │ │ ├── recorder.go │ │ ├── sample.go │ │ ├── span.go │ │ ├── tracer.go │ │ ├── util.go │ │ ├── zipkin-endpoint.go │ │ └── zipkin-recorder.go ├── pierrec │ └── lz4 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── block.go │ │ ├── debug.go │ │ ├── debug_stub.go │ │ ├── internal │ │ └── xxh32 │ │ │ ├── xxh32.go │ │ │ └── xxh32zero.go │ │ ├── lz4.go │ │ ├── lz4_go1.10.go │ │ ├── lz4_notgo1.10.go │ │ ├── reader.go │ │ └── writer.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 └── spf13 │ ├── cobra │ ├── LICENSE.txt │ ├── README.md │ ├── args.go │ ├── bash_completions.go │ ├── bash_completions.md │ ├── cobra.go │ ├── command.go │ ├── command_notwin.go │ ├── command_win.go │ └── zsh_completions.go │ └── pflag │ ├── LICENSE │ ├── README.md │ ├── bool.go │ ├── bool_slice.go │ ├── count.go │ ├── duration.go │ ├── duration_slice.go │ ├── flag.go │ ├── float32.go │ ├── float64.go │ ├── golangflag.go │ ├── int.go │ ├── int16.go │ ├── int32.go │ ├── int64.go │ ├── int8.go │ ├── int_slice.go │ ├── ip.go │ ├── ip_slice.go │ ├── ipmask.go │ ├── ipnet.go │ ├── string.go │ ├── string_array.go │ ├── string_slice.go │ ├── uint.go │ ├── uint16.go │ ├── uint32.go │ ├── uint64.go │ ├── uint8.go │ └── uint_slice.go ├── golang.org └── x │ ├── net │ ├── LICENSE │ ├── PATENTS │ ├── context │ │ ├── context.go │ │ ├── go17.go │ │ ├── go19.go │ │ ├── pre_go17.go │ │ └── pre_go19.go │ ├── http │ │ └── httpguts │ │ │ ├── guts.go │ │ │ └── httplex.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 │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── fcntl.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mkpost.go │ │ ├── mksyscall.pl │ │ ├── mksyscall_solaris.pl │ │ ├── mksysctl_openbsd.pl │ │ ├── mksysnum_darwin.pl │ │ ├── mksysnum_dragonfly.pl │ │ ├── mksysnum_freebsd.pl │ │ ├── mksysnum_netbsd.pl │ │ ├── mksysnum_openbsd.pl │ │ ├── openbsd_pledge.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_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_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── timestruct.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go │ └── text │ ├── LICENSE │ ├── PATENTS │ ├── secure │ └── bidirule │ │ ├── bidirule.go │ │ ├── bidirule10.0.0.go │ │ └── bidirule9.0.0.go │ ├── transform │ └── transform.go │ └── unicode │ ├── bidi │ ├── bidi.go │ ├── bracket.go │ ├── core.go │ ├── gen.go │ ├── gen_ranges.go │ ├── gen_trieval.go │ ├── prop.go │ ├── tables10.0.0.go │ ├── tables9.0.0.go │ └── trieval.go │ └── norm │ ├── composition.go │ ├── forminfo.go │ ├── input.go │ ├── iter.go │ ├── maketables.go │ ├── normalize.go │ ├── readwriter.go │ ├── tables10.0.0.go │ ├── tables9.0.0.go │ ├── transform.go │ ├── trie.go │ └── triegen.go ├── google.golang.org ├── genproto │ ├── LICENSE │ └── googleapis │ │ └── rpc │ │ └── status │ │ └── status.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 │ ├── call.go │ ├── clientconn.go │ ├── codec.go │ ├── codegen.sh │ ├── codes │ ├── code_string.go │ └── codes.go │ ├── connectivity │ └── connectivity.go │ ├── credentials │ ├── credentials.go │ ├── credentials_util_go17.go │ ├── credentials_util_go18.go │ └── credentials_util_pre_go17.go │ ├── doc.go │ ├── encoding │ ├── encoding.go │ └── proto │ │ └── proto.go │ ├── go16.go │ ├── go17.go │ ├── grpclb.go │ ├── grpclb │ └── grpc_lb_v1 │ │ └── messages │ │ ├── messages.pb.go │ │ └── messages.proto │ ├── grpclb_picker.go │ ├── grpclb_remote_balancer.go │ ├── grpclb_util.go │ ├── grpclog │ ├── grpclog.go │ ├── logger.go │ └── loggerv2.go │ ├── interceptor.go │ ├── internal │ ├── backoff │ │ └── backoff.go │ ├── channelz │ │ ├── funcs.go │ │ ├── types.go │ │ ├── types_linux.go │ │ ├── types_nonlinux.go │ │ ├── util_linux_go19.go │ │ └── util_nonlinux_pre_go19.go │ ├── envconfig │ │ └── envconfig.go │ ├── grpcrand │ │ └── grpcrand.go │ ├── internal.go │ └── transport │ │ ├── bdp_estimator.go │ │ ├── controlbuf.go │ │ ├── defaults.go │ │ ├── flowcontrol.go │ │ ├── go16.go │ │ ├── go17.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 │ ├── go17.go │ ├── go18.go │ └── naming.go │ ├── peer │ └── peer.go │ ├── picker_wrapper.go │ ├── pickfirst.go │ ├── proxy.go │ ├── resolver │ ├── dns │ │ ├── dns_resolver.go │ │ ├── go17.go │ │ └── go18.go │ ├── passthrough │ │ └── passthrough.go │ └── resolver.go │ ├── resolver_conn_wrapper.go │ ├── rpc_util.go │ ├── server.go │ ├── service_config.go │ ├── stats │ ├── handlers.go │ └── stats.go │ ├── status │ └── status.go │ ├── stream.go │ ├── tap │ └── tap.go │ ├── trace.go │ ├── transport │ ├── bdp_estimator.go │ ├── control.go │ ├── go16.go │ ├── go17.go │ ├── handler_server.go │ ├── http2_client.go │ ├── http2_server.go │ ├── http_util.go │ ├── log.go │ └── transport.go │ └── vet.sh └── vendor.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .DS_Store 3 | 4 | *.o 5 | *.a 6 | *.so -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) The grpc-hello-world Authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Grpc Hello World 2 | 3 | 本项目提供[Grpc+Grpc Gateway实践](https://segmentfault.com/a/1190000013408485)的示例代码 4 | 5 | - [Grpc+Grpc Gateway实践一 介绍与环境安装](https://segmentfault.com/a/1190000013339403) 6 | - [Grpc+Grpc Gateway实践二 有些复杂的Hello World](https://segmentfault.com/a/1190000013408485) 7 | - [Grpc+Grpc Gateway实践三 Swagger了解一下](https://segmentfault.com/a/1190000013513469) 8 | -------------------------------------------------------------------------------- /client/client.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | 6 | "golang.org/x/net/context" 7 | "google.golang.org/grpc" 8 | "google.golang.org/grpc/credentials" 9 | 10 | pb "github.com/EDDYCJY/grpc-hello-world/proto" 11 | ) 12 | 13 | func main() { 14 | creds, err := credentials.NewClientTLSFromFile("../conf/certs/server.pem", "panther") 15 | if err != nil { 16 | log.Println("Failed to create TLS credentials %v", err) 17 | } 18 | conn, err := grpc.Dial(":50052", grpc.WithTransportCredentials(creds)) 19 | defer conn.Close() 20 | 21 | if err != nil { 22 | log.Println(err) 23 | } 24 | 25 | c := pb.NewHelloWorldClient(conn) 26 | context := context.Background() 27 | body := &pb.HelloWorldRequest{ 28 | Referer : "Grpc", 29 | } 30 | 31 | r, err := c.SayHelloWorld(context, body) 32 | if err != nil { 33 | log.Println(err) 34 | } 35 | 36 | log.Println(r.Message) 37 | } 38 | -------------------------------------------------------------------------------- /cmd/root.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | var rootCmd = &cobra.Command{ 11 | Use: "grpc", 12 | Short: "Run the gRPC hello-world server", 13 | } 14 | 15 | func Execute() { 16 | if err := rootCmd.Execute(); err != nil { 17 | fmt.Println(err) 18 | os.Exit(-1) 19 | } 20 | } -------------------------------------------------------------------------------- /cmd/server.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "log" 5 | 6 | "github.com/spf13/cobra" 7 | 8 | "github.com/EDDYCJY/grpc-hello-world/server" 9 | ) 10 | 11 | var serverCmd = &cobra.Command{ 12 | Use: "server", 13 | Short: "Run the gRPC hello-world server", 14 | Run: func(cmd *cobra.Command, args []string) { 15 | defer func() { 16 | if err := recover(); err != nil { 17 | log.Println("Recover error : %v", err) 18 | } 19 | }() 20 | 21 | server.Run() 22 | }, 23 | } 24 | 25 | func init() { 26 | serverCmd.Flags().StringVarP(&server.ServerPort, "port", "p", "50052", "server port") 27 | serverCmd.Flags().StringVarP(&server.CertPemPath, "cert-pem", "", "./conf/certs/server.pem", "cert-pem path") 28 | serverCmd.Flags().StringVarP(&server.CertKeyPath, "cert-key", "", "./conf/certs/server-key.pem", "cert-key path") 29 | serverCmd.Flags().StringVarP(&server.CertServerName, "cert-server-name", "", "127.0.0.1", "server's hostname") 30 | serverCmd.Flags().StringVarP(&server.SwaggerDir, "swagger-dir", "", "proto", "path to the directory which contains swagger definitions") 31 | 32 | rootCmd.AddCommand(serverCmd) 33 | } -------------------------------------------------------------------------------- /conf/certs/ca-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "expiry": "87600h" 5 | }, 6 | "profiles": { 7 | "server": { 8 | "expiry": "87600h", 9 | "usages": [ 10 | "signing", 11 | "key encipherment", 12 | "server auth" 13 | ] 14 | }, 15 | "client": { 16 | "expiry": "87600h", 17 | "usages": [ 18 | "signing", 19 | "key encipherment", 20 | "client auth" 21 | ] 22 | }, 23 | "peer": { 24 | "expiry": "87600h", 25 | "usages": [ 26 | "signing", 27 | "key encipherment", 28 | "server auth", 29 | "client auth" 30 | ] 31 | } 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /conf/certs/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "CN": "Self Signed Ca", 3 | "key": { 4 | "algo": "rsa", 5 | "size": 2048 6 | }, 7 | "names": [{ 8 | "C": "CN", 9 | "L": "SH", 10 | "O": "Netease", 11 | "ST": "SH", 12 | "OU": "OT" 13 | }] 14 | } -------------------------------------------------------------------------------- /conf/certs/ca.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICpDCCAYwCAQAwXzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlNIMQswCQYDVQQH 3 | EwJTSDEQMA4GA1UEChMHTmV0ZWFzZTELMAkGA1UECxMCT1QxFzAVBgNVBAMTDlNl 4 | bGYgU2lnbmVkIENhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwwJy 5 | 5zWU5iSmpw/ykv7e+nIMRwDamKG3VFkePQFfRLZ3Ug1aiHdYeMxjV06rqNHNjdC6 6 | lB3n/SJXay/qUNJ0Pk5ptWLUZwxHldgRJr5wJkAgKzCPwCEccN7EWJ62iCGxyN6r 7 | 8Yn7L1exhAI/V/4WPuhsiE7l6SZcpPEm5UwXSltpzS61PLHHPSnNraYF0jnKZ87O 8 | 6EeS9BCIQx3BmYznwga3W5WpNEB6z0wuCSDKcFWYQD8sOzixvCF6QIthbRE7wFC2 9 | RskxpwKWWad+WH8Mw80KDVe/REz29AD4vltmXttD+zPx2ZHv0VZVY2vfEiS+RDh4 10 | k1YwvSUQP8OFavKcLQIDAQABoAAwDQYJKoZIhvcNAQELBQADggEBAIReyPCcmd2W 11 | Cga+4QBdaDAi7gQlJlp/cWdMqzkzGOmJaweTMpyXi65kFuJHoM76jofqlaPVyd/C 12 | EcCEHUgtDEI3sPTJ4eRusR/4WouqC1QZt0Knv9U7Nm+QijmcKQQbL8U23Kw35AgR 13 | cfIvpAktHpO840qztd5oFrwmHthU2TxIPOluAtgMKrJ/E3EwXEjWKXC5vqcqJ1hV 14 | O0JGFXWX83vHpiSMbdrSqeHvkeJ3urdACjNzuG6hWt1eVnFl3UPfuEjBE1HYulG/ 15 | wGMVCkQMEeVDjqrMPUjQwDwcwfnIb3pvpu/ljEwiFwhAJy0UwHoepm/D2soWuBJd 16 | QhTde2lq/XY= 17 | -----END CERTIFICATE REQUEST----- 18 | -------------------------------------------------------------------------------- /conf/certs/ca.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDjjCCAnagAwIBAgIUaHXFAtNg7iEQb30rxRm9o/nTy74wDQYJKoZIhvcNAQEL 3 | BQAwXzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlNIMQswCQYDVQQHEwJTSDEQMA4G 4 | A1UEChMHTmV0ZWFzZTELMAkGA1UECxMCT1QxFzAVBgNVBAMTDlNlbGYgU2lnbmVk 5 | IENhMB4XDTE4MDgwODA3MDMwMFoXDTIzMDgwNzA3MDMwMFowXzELMAkGA1UEBhMC 6 | Q04xCzAJBgNVBAgTAlNIMQswCQYDVQQHEwJTSDEQMA4GA1UEChMHTmV0ZWFzZTEL 7 | MAkGA1UECxMCT1QxFzAVBgNVBAMTDlNlbGYgU2lnbmVkIENhMIIBIjANBgkqhkiG 8 | 9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwwJy5zWU5iSmpw/ykv7e+nIMRwDamKG3VFke 9 | PQFfRLZ3Ug1aiHdYeMxjV06rqNHNjdC6lB3n/SJXay/qUNJ0Pk5ptWLUZwxHldgR 10 | Jr5wJkAgKzCPwCEccN7EWJ62iCGxyN6r8Yn7L1exhAI/V/4WPuhsiE7l6SZcpPEm 11 | 5UwXSltpzS61PLHHPSnNraYF0jnKZ87O6EeS9BCIQx3BmYznwga3W5WpNEB6z0wu 12 | CSDKcFWYQD8sOzixvCF6QIthbRE7wFC2RskxpwKWWad+WH8Mw80KDVe/REz29AD4 13 | vltmXttD+zPx2ZHv0VZVY2vfEiS+RDh4k1YwvSUQP8OFavKcLQIDAQABo0IwQDAO 14 | BgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUeieX9F5b 15 | dSfHLDrgxQYNz6L1il4wDQYJKoZIhvcNAQELBQADggEBABoHfVq2jDF4rKwCz2oX 16 | HtLcIbPSqK2bSn0J75L0LJgE9KwVcch1yN3msKLYx2gmR3n/e6PVQAAR6yKpjH90 17 | Dc1YkfHSLYaYqsKZtlzG+m91sJiV7AkS3shKpztYyQz2kFV8BGwpKuHOKLhGI2eY 18 | wkuPUMRSYNTJIcmBebMhbxZ7bwOJwIECR+c1OtEGq3m7CFUITT0prcDgkLr5zovp 19 | zQgpGEFoWPVZCKPZpW6DB9IwjNZAV26nxHlq4LznosxWVvkepBOUT28J9WNYdL8h 20 | CKON2cy0HLTRIJNcQCQKwUg/vQeAfkH7Z7BydcMSUdLFFcohCjGu4my/vA9hz9GB 21 | 6Z8= 22 | -----END CERTIFICATE----- 23 | -------------------------------------------------------------------------------- /conf/certs/server-key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIIsCuUMY5dZ//vVzY4I0Xqu/YL5Cs31Lch5Ff13CZ0NHoAoGCCqGSM49 3 | AwEHoUQDQgAEOPxgsQWFBiNm9Qswip3BmjZ4ACdqeI5UYJH4iZK5q9dyzi0oWbQz 4 | J7alSJUlcDfXHhcNG5e+nwMZJjlYR/FpwQ== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /conf/certs/server.csr: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIIBszCCAVkCAQAwODELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlNIMQswCQYDVQQH 3 | EwJTSDEPMA0GA1UEAxMGU2VydmVyMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE 4 | OPxgsQWFBiNm9Qswip3BmjZ4ACdqeI5UYJH4iZK5q9dyzi0oWbQzJ7alSJUlcDfX 5 | HhcNG5e+nwMZJjlYR/FpwaCBvjCBuwYJKoZIhvcNAQkOMYGtMIGqMIGnBgNVHREE 6 | gZ8wgZyCC2dycGMtc2VydmVyggdwYW50aGVygg9wYW50aGVyLXByb2plY3SCDHBh 7 | bnRoZXItdXNlcoINcGFudGhlci10aGlyZIILcGFudGhlci1nZW+CEHBhbnRoZXIt 8 | bWVyY2hhbnSCD3BhbnRoZXItc2Vzc2lvboIMcGFudGhlci10YXNrghJwYW50aGVy 9 | LXN0YXRpc3RpY3OHBH8AAAEwCgYIKoZIzj0EAwIDSAAwRQIgKtApwI+tTCYaSM9F 10 | XDsimQXD1k1KQj5yQ1yfosvoJoECIQCX4opoH+0W+QsSQKXPhtkTTceNAMOT7PLG 11 | mqJZOmOq5A== 12 | -----END CERTIFICATE REQUEST----- 13 | -------------------------------------------------------------------------------- /conf/certs/server.json: -------------------------------------------------------------------------------- 1 | { 2 | "CN": "Server", 3 | "hosts": [ 4 | "127.0.0.1", 5 | "grpc-server", 6 | "panther", 7 | "panther-project", 8 | "panther-user", 9 | "panther-third", 10 | "panther-geo", 11 | "panther-merchant", 12 | "panther-session", 13 | "panther-task", 14 | "panther-statistics" 15 | ], 16 | "key": { 17 | "algo": "ecdsa", 18 | "size": 256 19 | }, 20 | "names": [ 21 | { 22 | "C": "CN", 23 | "L": "SH", 24 | "ST": "SH" 25 | } 26 | ] 27 | } 28 | 29 | -------------------------------------------------------------------------------- /conf/certs/server.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDfTCCAmWgAwIBAgIURiEc1ZywK5g0xGBtUuIDIa/AugkwDQYJKoZIhvcNAQEL 3 | BQAwXzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlNIMQswCQYDVQQHEwJTSDEQMA4G 4 | A1UEChMHTmV0ZWFzZTELMAkGA1UECxMCT1QxFzAVBgNVBAMTDlNlbGYgU2lnbmVk 5 | IENhMB4XDTE4MDgwODA4MzgwMFoXDTI4MDgwNTA4MzgwMFowODELMAkGA1UEBhMC 6 | Q04xCzAJBgNVBAgTAlNIMQswCQYDVQQHEwJTSDEPMA0GA1UEAxMGU2VydmVyMFkw 7 | EwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEOPxgsQWFBiNm9Qswip3BmjZ4ACdqeI5U 8 | YJH4iZK5q9dyzi0oWbQzJ7alSJUlcDfXHhcNG5e+nwMZJjlYR/FpwaOCASEwggEd 9 | MA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNVHRMBAf8E 10 | AjAAMB0GA1UdDgQWBBRBO8R4sUrJxmPoydrjAI5Ogoj6ujAfBgNVHSMEGDAWgBR6 11 | J5f0Xlt1J8csOuDFBg3PovWKXjCBpwYDVR0RBIGfMIGcggtncnBjLXNlcnZlcoIH 12 | cGFudGhlcoIPcGFudGhlci1wcm9qZWN0ggxwYW50aGVyLXVzZXKCDXBhbnRoZXIt 13 | dGhpcmSCC3BhbnRoZXItZ2VvghBwYW50aGVyLW1lcmNoYW50gg9wYW50aGVyLXNl 14 | c3Npb26CDHBhbnRoZXItdGFza4IScGFudGhlci1zdGF0aXN0aWNzhwR/AAABMA0G 15 | CSqGSIb3DQEBCwUAA4IBAQCOLZz/d7mng3/rACX0jlAbxJoA2CTnG4/9YfV8diQ9 16 | 3DNJp2vII/MnwVbMp+6bS7Dimu0jf2AF1+8QnC6C421EA29uVRjONpLjhj+EtcS4 17 | E27Zaok4OJfRRobTb55v4d4rauVgQsNxZ9mcmsibR4JbGlAowCbRG17pJXyAn5DT 18 | T+8wFSvKYfks0943I81QAKd1i/RMg38PEPRdC6f/3wEbyjNVv+Xoy6PxHC75viss 19 | z01MUH+ztHV7f12xRUMxvr8xJNDzSNwq0OEtMDniL5O1d92ovlyNnxqHl92pf1aS 20 | j6PiX1QTVFCkDAvHa9momhb0nsluh4v8oH4Z8THW7lA8 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/EDDYCJY/grpc-hello-world/cmd" 5 | ) 6 | 7 | func main() { 8 | cmd.Execute() 9 | } -------------------------------------------------------------------------------- /pkg/util/grpc.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "net/http" 5 | "strings" 6 | 7 | "google.golang.org/grpc" 8 | ) 9 | 10 | func GrpcHandlerFunc(grpcServer *grpc.Server, otherHandler http.Handler) http.Handler { 11 | if otherHandler == nil { 12 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 13 | grpcServer.ServeHTTP(w, r) 14 | }) 15 | } 16 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 17 | if r.ProtoMajor == 2 && strings.Contains(r.Header.Get("Content-Type"), "application/grpc") { 18 | grpcServer.ServeHTTP(w, r) 19 | } else { 20 | otherHandler.ServeHTTP(w, r) 21 | } 22 | }) 23 | } 24 | -------------------------------------------------------------------------------- /pkg/util/tls.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "crypto/tls" 5 | "io/ioutil" 6 | "log" 7 | "net" 8 | 9 | "golang.org/x/net/http2" 10 | ) 11 | 12 | func GetTLSConfig(certPemPath, certKeyPath string) *tls.Config { 13 | var certKeyPair *tls.Certificate 14 | cert, _ := ioutil.ReadFile(certPemPath) 15 | key, _ := ioutil.ReadFile(certKeyPath) 16 | 17 | pair, err := tls.X509KeyPair(cert, key) 18 | if err != nil { 19 | log.Println("TLS KeyPair err: %v\n", err) 20 | } 21 | 22 | certKeyPair = &pair 23 | 24 | return &tls.Config{ 25 | Certificates: []tls.Certificate{*certKeyPair}, 26 | NextProtos: []string{http2.NextProtoTLS}, 27 | } 28 | } 29 | 30 | func NewTLSListener(inner net.Listener, config *tls.Config) net.Listener { 31 | return tls.NewListener(inner, config) 32 | } -------------------------------------------------------------------------------- /proto/google/api/annotations.proto: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015, Google 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 | syntax = "proto3"; 16 | 17 | package google.api; 18 | 19 | import "google/api/http.proto"; 20 | import "google/protobuf/descriptor.proto"; 21 | 22 | option java_multiple_files = true; 23 | option java_outer_classname = "AnnotationsProto"; 24 | option java_package = "com.google.api"; 25 | 26 | extend google.protobuf.MethodOptions { 27 | // See `HttpRule`. 28 | HttpRule http = 72295728; 29 | } 30 | -------------------------------------------------------------------------------- /proto/hello.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package proto; 4 | 5 | import "google/api/annotations.proto"; 6 | 7 | service HelloWorld { 8 | rpc SayHelloWorld(HelloWorldRequest) returns (HelloWorldResponse) { 9 | option (google.api.http) = { 10 | post: "/hello_world" 11 | body: "*" 12 | }; 13 | } 14 | } 15 | 16 | message HelloWorldRequest { 17 | string referer = 1; 18 | } 19 | 20 | message HelloWorldResponse { 21 | string message = 1; 22 | } -------------------------------------------------------------------------------- /proto/hello.swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "swagger": "2.0", 3 | "info": { 4 | "title": "hello.proto", 5 | "version": "version not set" 6 | }, 7 | "schemes": [ 8 | "http", 9 | "https" 10 | ], 11 | "consumes": [ 12 | "application/json" 13 | ], 14 | "produces": [ 15 | "application/json" 16 | ], 17 | "paths": { 18 | "/hello_world": { 19 | "post": { 20 | "operationId": "SayHelloWorld", 21 | "responses": { 22 | "200": { 23 | "description": "", 24 | "schema": { 25 | "$ref": "#/definitions/protoHelloWorldResponse" 26 | } 27 | } 28 | }, 29 | "parameters": [ 30 | { 31 | "name": "body", 32 | "in": "body", 33 | "required": true, 34 | "schema": { 35 | "$ref": "#/definitions/protoHelloWorldRequest" 36 | } 37 | } 38 | ], 39 | "tags": [ 40 | "HelloWorld" 41 | ] 42 | } 43 | } 44 | }, 45 | "definitions": { 46 | "protoHelloWorldRequest": { 47 | "type": "object", 48 | "properties": { 49 | "referer": { 50 | "type": "string" 51 | } 52 | } 53 | }, 54 | "protoHelloWorldResponse": { 55 | "type": "object", 56 | "properties": { 57 | "message": { 58 | "type": "string" 59 | } 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /server/hello.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "golang.org/x/net/context" 5 | 6 | pb "github.com/EDDYCJY/grpc-hello-world/proto" 7 | ) 8 | 9 | type helloService struct{} 10 | 11 | func NewHelloService() *helloService { 12 | return &helloService{} 13 | } 14 | 15 | func (h helloService) SayHelloWorld(ctx context.Context, r *pb.HelloWorldRequest) (*pb.HelloWorldResponse, error) { 16 | return &pb.HelloWorldResponse{ 17 | Message : r.Referer, 18 | }, nil 19 | } -------------------------------------------------------------------------------- /third_party/swagger-ui/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eddycjy/grpc-hello-world/12331fde3797d53c238c86467d7b68c0188154c6/third_party/swagger-ui/favicon-16x16.png -------------------------------------------------------------------------------- /third_party/swagger-ui/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eddycjy/grpc-hello-world/12331fde3797d53c238c86467d7b68c0188154c6/third_party/swagger-ui/favicon-32x32.png -------------------------------------------------------------------------------- /third_party/swagger-ui/swagger-ui.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"swagger-ui.css","sourceRoot":""} -------------------------------------------------------------------------------- /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 | # See https://github.com/kisielk/errcheck/pull/141 for details on ignorepkg 18 | errcheck: 19 | errcheck -ignorepkg fmt github.com/Shopify/sarama/... 20 | 21 | fmt: 22 | @if [ -n "$$(go fmt ./...)" ]; then echo 'Please run go fmt on your code.' && exit 1; fi 23 | 24 | install_dependencies: install_errcheck get 25 | 26 | install_errcheck: 27 | go get github.com/kisielk/errcheck 28 | 29 | get: 30 | go get -t 31 | -------------------------------------------------------------------------------- /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/acl_filter.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type AclFilter struct { 4 | ResourceType AclResourceType 5 | ResourceName *string 6 | Principal *string 7 | Host *string 8 | Operation AclOperation 9 | PermissionType AclPermissionType 10 | } 11 | 12 | func (a *AclFilter) encode(pe packetEncoder) error { 13 | pe.putInt8(int8(a.ResourceType)) 14 | if err := pe.putNullableString(a.ResourceName); err != nil { 15 | return err 16 | } 17 | if err := pe.putNullableString(a.Principal); err != nil { 18 | return err 19 | } 20 | if err := pe.putNullableString(a.Host); err != nil { 21 | return err 22 | } 23 | pe.putInt8(int8(a.Operation)) 24 | pe.putInt8(int8(a.PermissionType)) 25 | 26 | return nil 27 | } 28 | 29 | func (a *AclFilter) decode(pd packetDecoder, version int16) (err error) { 30 | resourceType, err := pd.getInt8() 31 | if err != nil { 32 | return err 33 | } 34 | a.ResourceType = AclResourceType(resourceType) 35 | 36 | if a.ResourceName, err = pd.getNullableString(); err != nil { 37 | return err 38 | } 39 | 40 | if a.Principal, err = pd.getNullableString(); err != nil { 41 | return err 42 | } 43 | 44 | if a.Host, err = pd.getNullableString(); err != nil { 45 | return err 46 | } 47 | 48 | operation, err := pd.getInt8() 49 | if err != nil { 50 | return err 51 | } 52 | a.Operation = AclOperation(operation) 53 | 54 | permissionType, err := pd.getInt8() 55 | if err != nil { 56 | return err 57 | } 58 | a.PermissionType = AclPermissionType(permissionType) 59 | 60 | return nil 61 | } 62 | -------------------------------------------------------------------------------- /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_groups_request.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type DeleteGroupsRequest struct { 4 | Groups []string 5 | } 6 | 7 | func (r *DeleteGroupsRequest) encode(pe packetEncoder) error { 8 | return pe.putStringArray(r.Groups) 9 | } 10 | 11 | func (r *DeleteGroupsRequest) decode(pd packetDecoder, version int16) (err error) { 12 | r.Groups, err = pd.getStringArray() 13 | return 14 | } 15 | 16 | func (r *DeleteGroupsRequest) key() int16 { 17 | return 42 18 | } 19 | 20 | func (r *DeleteGroupsRequest) version() int16 { 21 | return 0 22 | } 23 | 24 | func (r *DeleteGroupsRequest) requiredVersion() KafkaVersion { 25 | return V1_1_0_0 26 | } 27 | 28 | func (r *DeleteGroupsRequest) AddGroup(group string) { 29 | r.Groups = append(r.Groups, group) 30 | } 31 | -------------------------------------------------------------------------------- /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/list_groups_response.go: -------------------------------------------------------------------------------- 1 | package sarama 2 | 3 | type ListGroupsResponse struct { 4 | Err KError 5 | Groups map[string]string 6 | } 7 | 8 | func (r *ListGroupsResponse) encode(pe packetEncoder) error { 9 | pe.putInt16(int16(r.Err)) 10 | 11 | if err := pe.putArrayLength(len(r.Groups)); err != nil { 12 | return err 13 | } 14 | for groupId, protocolType := range r.Groups { 15 | if err := pe.putString(groupId); err != nil { 16 | return err 17 | } 18 | if err := pe.putString(protocolType); err != nil { 19 | return err 20 | } 21 | } 22 | 23 | return nil 24 | } 25 | 26 | func (r *ListGroupsResponse) decode(pd packetDecoder, version int16) error { 27 | kerr, err := pd.getInt16() 28 | if err != nil { 29 | return err 30 | } 31 | 32 | r.Err = KError(kerr) 33 | 34 | n, err := pd.getArrayLength() 35 | if err != nil { 36 | return err 37 | } 38 | if n == 0 { 39 | return nil 40 | } 41 | 42 | r.Groups = make(map[string]string) 43 | for i := 0; i < n; i++ { 44 | groupId, err := pd.getString() 45 | if err != nil { 46 | return err 47 | } 48 | protocolType, err := pd.getString() 49 | if err != nil { 50 | return err 51 | } 52 | 53 | r.Groups[groupId] = protocolType 54 | } 55 | 56 | return nil 57 | } 58 | 59 | func (r *ListGroupsResponse) key() int16 { 60 | return 16 61 | } 62 | 63 | func (r *ListGroupsResponse) version() int16 { 64 | return 0 65 | } 66 | 67 | func (r *ListGroupsResponse) requiredVersion() KafkaVersion { 68 | return V0_9_0_0 69 | } 70 | -------------------------------------------------------------------------------- /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/NOTICE: -------------------------------------------------------------------------------- 1 | Apache Thrift 2 | Copyright 2006-2017 The Apache Software Foundation. 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /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/apache/thrift/lib/go/thrift/server.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 | type TServer interface { 23 | ProcessorFactory() TProcessorFactory 24 | ServerTransport() TServerTransport 25 | InputTransportFactory() TTransportFactory 26 | OutputTransportFactory() TTransportFactory 27 | InputProtocolFactory() TProtocolFactory 28 | OutputProtocolFactory() TProtocolFactory 29 | 30 | // Starts the server 31 | Serve() error 32 | // Stops the server. This is optional on a per-implementation basis. Not 33 | // all servers are required to be cleanly stoppable. 34 | Stop() error 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/apache/thrift/lib/go/thrift/server_transport.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 | // Server transport. Object which provides client transports. 23 | type TServerTransport interface { 24 | Listen() error 25 | Accept() (TTransport, error) 26 | Close() error 27 | 28 | // Optional method implementation. This signals to the server transport 29 | // that it should break out of any accept() or listen() that it is currently 30 | // blocked on. This method, if implemented, MUST be thread safe, as it may 31 | // be called from a different thread context than the other TServerTransport 32 | // methods. 33 | Interrupt() error 34 | } 35 | -------------------------------------------------------------------------------- /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/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package snappy 4 | 5 | func Fuzz(data []byte) int { 6 | decode, err := Decode(data) 7 | if decode == nil && err == nil { 8 | panic("nil error with nil result") 9 | } 10 | 11 | if err != nil { 12 | return 0 13 | } 14 | 15 | return 1 16 | } 17 | -------------------------------------------------------------------------------- /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/elazarl/go-bindata-assetfs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, Elazar Leibovich 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/github.com/elazarl/go-bindata-assetfs/README.md: -------------------------------------------------------------------------------- 1 | # go-bindata-assetfs 2 | 3 | Serve embedded files from [jteeuwen/go-bindata](https://github.com/jteeuwen/go-bindata) with `net/http`. 4 | 5 | [GoDoc](http://godoc.org/github.com/elazarl/go-bindata-assetfs) 6 | 7 | ### Installation 8 | 9 | Install with 10 | 11 | $ go get github.com/jteeuwen/go-bindata/... 12 | $ go get github.com/elazarl/go-bindata-assetfs/... 13 | 14 | ### Creating embedded data 15 | 16 | Usage is identical to [jteeuwen/go-bindata](https://github.com/jteeuwen/go-bindata) usage, 17 | instead of running `go-bindata` run `go-bindata-assetfs`. 18 | 19 | The tool will create a `bindata_assetfs.go` file, which contains the embedded data. 20 | 21 | A typical use case is 22 | 23 | $ go-bindata-assetfs data/... 24 | 25 | ### Using assetFS in your code 26 | 27 | The generated file provides an `assetFS()` function that returns a `http.Filesystem` 28 | wrapping the embedded files. What you usually want to do is: 29 | 30 | http.Handle("/", http.FileServer(assetFS())) 31 | 32 | This would run an HTTP server serving the embedded files. 33 | 34 | ## Without running binary tool 35 | 36 | You can always just run the `go-bindata` tool, and then 37 | 38 | use 39 | 40 | import "github.com/elazarl/go-bindata-assetfs" 41 | ... 42 | http.Handle("/", 43 | http.FileServer( 44 | &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, AssetInfo: AssetInfo, Prefix: "data"})) 45 | 46 | to serve files embedded from the `data` directory. 47 | -------------------------------------------------------------------------------- /vendor/github.com/elazarl/go-bindata-assetfs/doc.go: -------------------------------------------------------------------------------- 1 | // assetfs allows packages to serve static content embedded 2 | // with the go-bindata tool with the standard net/http package. 3 | // 4 | // See https://github.com/jteeuwen/go-bindata for more information 5 | // about embedding binary data with go-bindata. 6 | // 7 | // Usage example, after running 8 | // $ go-bindata data/... 9 | // use: 10 | // http.Handle("/", 11 | // http.FileServer( 12 | // &assetfs.AssetFS{Asset: Asset, AssetDir: AssetDir, Prefix: "data"})) 13 | package assetfs 14 | -------------------------------------------------------------------------------- /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/protobuf/ptypes/regen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | # 3 | # This script fetches and rebuilds the "well-known types" protocol buffers. 4 | # To run this you will need protoc and goprotobuf installed; 5 | # see https://github.com/golang/protobuf for instructions. 6 | # You also need Go and Git installed. 7 | 8 | PKG=github.com/golang/protobuf/ptypes 9 | UPSTREAM=https://github.com/google/protobuf 10 | UPSTREAM_SUBDIR=src/google/protobuf 11 | PROTO_FILES=(any duration empty struct timestamp wrappers) 12 | 13 | function die() { 14 | echo 1>&2 $* 15 | exit 1 16 | } 17 | 18 | # Sanity check that the right tools are accessible. 19 | for tool in go git protoc protoc-gen-go; do 20 | q=$(which $tool) || die "didn't find $tool" 21 | echo 1>&2 "$tool: $q" 22 | done 23 | 24 | tmpdir=$(mktemp -d -t regen-wkt.XXXXXX) 25 | trap 'rm -rf $tmpdir' EXIT 26 | 27 | echo -n 1>&2 "finding package dir... " 28 | pkgdir=$(go list -f '{{.Dir}}' $PKG) 29 | echo 1>&2 $pkgdir 30 | base=$(echo $pkgdir | sed "s,/$PKG\$,,") 31 | echo 1>&2 "base: $base" 32 | cd "$base" 33 | 34 | echo 1>&2 "fetching latest protos... " 35 | git clone -q $UPSTREAM $tmpdir 36 | 37 | for file in ${PROTO_FILES[@]}; do 38 | echo 1>&2 "* $file" 39 | protoc --go_out=. -I$tmpdir/src $tmpdir/src/google/protobuf/$file.proto || die 40 | cp $tmpdir/src/google/protobuf/$file.proto $PKG/$file 41 | done 42 | 43 | echo 1>&2 "All OK" 44 | -------------------------------------------------------------------------------- /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/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the official list of people who can contribute 2 | # (and typically have contributed) code to the Snappy-Go repository. 3 | # The AUTHORS file lists the copyright holders; this file 4 | # lists people. For example, Google employees are listed here 5 | # but not in AUTHORS, because Google holds the copyright. 6 | # 7 | # The submission process automatically checks to make sure 8 | # that people submitting code are listed in this file (by email address). 9 | # 10 | # Names should be added to this file only after verifying that 11 | # the individual or the individual's organization has agreed to 12 | # the appropriate Contributor License Agreement, found here: 13 | # 14 | # http://code.google.com/legal/individual-cla-v1.0.html 15 | # http://code.google.com/legal/corporate-cla-v1.0.html 16 | # 17 | # The agreement for individuals can be filled out on the web. 18 | # 19 | # When adding J Random Contributor's name to this file, 20 | # either J's name or J's organization's name should be 21 | # added to the AUTHORS file, depending on whether the 22 | # individual or corporate CLA was used. 23 | 24 | # Names should be added to this file like so: 25 | # Name 26 | 27 | # Please keep the list sorted. 28 | 29 | Damian Gryski 30 | Jan Mercl <0xjnml@gmail.com> 31 | Kai Backman 32 | Marc-Antoine Ruel 33 | Nigel Tao 34 | Rob Pike 35 | Rodolfo Carvalho 36 | Russ Cox 37 | Sebastien Binet 38 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_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/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 6 | 7 | Types of changes: 8 | - `Added` for new features. 9 | - `Changed` for changes in existing functionality. 10 | - `Deprecated` for soon-to-be removed features. 11 | - `Removed` for now removed features. 12 | - `Fixed` for any bug fixes. 13 | - `Security` in case of vulnerabilities. 14 | 15 | ## [Unreleased] 16 | ### Added 17 | - This CHANGELOG file to keep track of changes. 18 | 19 | ## 1.0.0 - 2018-05-08 20 | ### Added 21 | - grpc_auth 22 | - grpc_ctxtags 23 | - grpc_zap 24 | - grpc_logrus 25 | - grpc_opentracing 26 | - grpc_retry 27 | - grpc_validator 28 | - grpc_recovery 29 | 30 | [Unreleased]: https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.0.0...HEAD 31 | -------------------------------------------------------------------------------- /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/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/slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eddycjy/grpc-hello-world/12331fde3797d53c238c86467d7b68c0188154c6/vendor/github.com/grpc-ecosystem/go-grpc-middleware/slack.png -------------------------------------------------------------------------------- /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/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/runtime/internal/stream_chunk.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package grpc.gateway.runtime; 3 | option go_package = "internal"; 4 | 5 | // StreamError is a response type which is returned when 6 | // streaming rpc returns an error. 7 | message StreamError { 8 | int32 grpc_code = 1; 9 | int32 http_code = 2; 10 | string message = 3; 11 | string http_status = 4; 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_json.go: -------------------------------------------------------------------------------- 1 | package runtime 2 | 3 | import ( 4 | "encoding/json" 5 | "io" 6 | ) 7 | 8 | // JSONBuiltin is a Marshaler which marshals/unmarshals into/from JSON 9 | // with the standard "encoding/json" package of Golang. 10 | // Although it is generally faster for simple proto messages than JSONPb, 11 | // it does not support advanced features of protobuf, e.g. map, oneof, .... 12 | type JSONBuiltin struct{} 13 | 14 | // ContentType always Returns "application/json". 15 | func (*JSONBuiltin) ContentType() string { 16 | return "application/json" 17 | } 18 | 19 | // Marshal marshals "v" into JSON 20 | func (j *JSONBuiltin) Marshal(v interface{}) ([]byte, error) { 21 | return json.Marshal(v) 22 | } 23 | 24 | // Unmarshal unmarshals JSON data into "v". 25 | func (j *JSONBuiltin) Unmarshal(data []byte, v interface{}) error { 26 | return json.Unmarshal(data, v) 27 | } 28 | 29 | // NewDecoder returns a Decoder which reads JSON stream from "r". 30 | func (j *JSONBuiltin) NewDecoder(r io.Reader) Decoder { 31 | return json.NewDecoder(r) 32 | } 33 | 34 | // NewEncoder returns an Encoder which writes JSON stream into "w". 35 | func (j *JSONBuiltin) NewEncoder(w io.Writer) Encoder { 36 | return json.NewEncoder(w) 37 | } 38 | 39 | // Delimiter for newline encoded JSON streams. 40 | func (j *JSONBuiltin) Delimiter() []byte { 41 | return []byte("\n") 42 | } 43 | -------------------------------------------------------------------------------- /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 postive invalid opcode. 21 | OpEnd 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-opentracing/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the GRPC 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 GRPC, 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 GRPC. 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 GRPC or any code incorporated within this 19 | implementation of GRPC 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 GRPC 22 | shall terminate as of the date such litigation is filed. 23 | Status API Training Shop Blog About 24 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc/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 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc/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/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-contrib/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-contrib/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-contrib/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-contrib/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-contrib/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-contrib/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-contrib/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-contrib/zipkin-go-opentracing/wire/wire.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package zipkintracer_go.wire; 3 | option go_package = "github.com/openzipkin-contrib/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/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/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/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/pierrec/lz4/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Pierre Curto 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of xxHash nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/README.md: -------------------------------------------------------------------------------- 1 | [![godoc](https://godoc.org/github.com/pierrec/lz4?status.png)](https://godoc.org/github.com/pierrec/lz4) 2 | 3 | # lz4 4 | LZ4 compression and decompression in pure Go. 5 | 6 | ## Usage 7 | 8 | ```go 9 | import "github.com/pierrec/lz4" 10 | ``` 11 | 12 | ## Description 13 | Package lz4 implements reading and writing lz4 compressed data (a frame), 14 | as specified in http://fastcompression.blogspot.fr/2013/04/lz4-streaming-format-final.html. 15 | Although the block level compression and decompression functions are exposed and are fully compatible 16 | with the lz4 block format definition, they are low level and should not be used directly. 17 | 18 | For a complete description of an lz4 compressed block, see: 19 | http://fastcompression.blogspot.fr/2011/05/lz4-explained.html 20 | 21 | See https://github.com/Cyan4973/lz4 for the reference C implementation. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/debug.go: -------------------------------------------------------------------------------- 1 | // +build lz4debug 2 | 3 | package lz4 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "path/filepath" 9 | "runtime" 10 | ) 11 | 12 | func debug(args ...interface{}) { 13 | _, file, line, _ := runtime.Caller(1) 14 | file = filepath.Base(file) 15 | 16 | f := fmt.Sprintf("LZ4: %s:%d %s", file, line, args[0]) 17 | if f[len(f)-1] != '\n' { 18 | f += "\n" 19 | } 20 | fmt.Fprintf(os.Stderr, f, args[1:]...) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/debug_stub.go: -------------------------------------------------------------------------------- 1 | // +build !lz4debug 2 | 3 | package lz4 4 | 5 | func debug(args ...interface{}) {} 6 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/lz4_go1.10.go: -------------------------------------------------------------------------------- 1 | //+build go1.10 2 | 3 | package lz4 4 | 5 | import ( 6 | "fmt" 7 | "strings" 8 | ) 9 | 10 | func (h Header) String() string { 11 | var s strings.Builder 12 | 13 | s.WriteString(fmt.Sprintf("%T{", h)) 14 | if h.BlockChecksum { 15 | s.WriteString("BlockChecksum: true ") 16 | } 17 | if h.NoChecksum { 18 | s.WriteString("NoChecksum: true ") 19 | } 20 | if bs := h.BlockMaxSize; bs != 0 && bs != 4<<20 { 21 | s.WriteString(fmt.Sprintf("BlockMaxSize: %d ", bs)) 22 | } 23 | if l := h.CompressionLevel; l != 0 { 24 | s.WriteString(fmt.Sprintf("CompressionLevel: %d ", l)) 25 | } 26 | s.WriteByte('}') 27 | 28 | return s.String() 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/pierrec/lz4/lz4_notgo1.10.go: -------------------------------------------------------------------------------- 1 | //+build !go1.10 2 | 3 | package lz4 4 | 5 | import ( 6 | "bytes" 7 | "fmt" 8 | ) 9 | 10 | func (h Header) String() string { 11 | var s bytes.Buffer 12 | 13 | s.WriteString(fmt.Sprintf("%T{", h)) 14 | if h.BlockChecksum { 15 | s.WriteString("BlockChecksum: true ") 16 | } 17 | if h.NoChecksum { 18 | s.WriteString("NoChecksum: true ") 19 | } 20 | if bs := h.BlockMaxSize; bs != 0 && bs != 4<<20 { 21 | s.WriteString(fmt.Sprintf("BlockMaxSize: %d ", bs)) 22 | } 23 | if l := h.CompressionLevel; l != 0 { 24 | s.WriteString(fmt.Sprintf("CompressionLevel: %d ", l)) 25 | } 26 | s.WriteByte('}') 27 | 28 | return s.String() 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/json.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "encoding/json" 5 | "io" 6 | "time" 7 | ) 8 | 9 | // MarshalJSON returns a byte slice containing a JSON representation of all 10 | // the metrics in the Registry. 11 | func (r *StandardRegistry) MarshalJSON() ([]byte, error) { 12 | return json.Marshal(r.GetAll()) 13 | } 14 | 15 | // WriteJSON writes metrics from the given registry periodically to the 16 | // specified io.Writer as JSON. 17 | func WriteJSON(r Registry, d time.Duration, w io.Writer) { 18 | for _ = range time.Tick(d) { 19 | WriteJSONOnce(r, w) 20 | } 21 | } 22 | 23 | // WriteJSONOnce writes metrics from the given registry to the specified 24 | // io.Writer as JSON. 25 | func WriteJSONOnce(r Registry, w io.Writer) { 26 | json.NewEncoder(w).Encode(r) 27 | } 28 | 29 | func (p *PrefixedRegistry) MarshalJSON() ([]byte, error) { 30 | return json.Marshal(p.GetAll()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/metrics.go: -------------------------------------------------------------------------------- 1 | // Go port of Coda Hale's Metrics library 2 | // 3 | // 4 | // 5 | // Coda Hale's original work: 6 | package metrics 7 | 8 | // UseNilMetrics is checked by the constructor functions for all of the 9 | // standard metrics. If it is true, the metric returned is a stub. 10 | // 11 | // This global kill-switch helps quantify the observer effect and makes 12 | // for less cluttered pprof profiles. 13 | var UseNilMetrics bool = false 14 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_cgo.go: -------------------------------------------------------------------------------- 1 | // +build cgo 2 | // +build !appengine 3 | 4 | package metrics 5 | 6 | import "runtime" 7 | 8 | func numCgoCall() int64 { 9 | return runtime.NumCgoCall() 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return memStats.GCCPUFraction 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_no_cgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo appengine 2 | 3 | package metrics 4 | 5 | func numCgoCall() int64 { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_no_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return 0 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/validate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # check there are no formatting issues 6 | GOFMT_LINES=`gofmt -l . | wc -l | xargs` 7 | test $GOFMT_LINES -eq 0 || echo "gofmt needs to be run, ${GOFMT_LINES} files have issues" 8 | 9 | # run the tests for the root package 10 | go test -race . 11 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_notwin.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package cobra 4 | 5 | var preExecHookFn func(*Command) 6 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package cobra 4 | 5 | import ( 6 | "os" 7 | "time" 8 | 9 | "github.com/inconshreveable/mousetrap" 10 | ) 11 | 12 | var preExecHookFn = preExecHook 13 | 14 | func preExecHook(c *Command) { 15 | if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { 16 | c.Print(MousetrapHelpText) 17 | time.Sleep(5 * time.Second) 18 | os.Exit(1) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /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/go17_not18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7,!go1.8 6 | 7 | package http2 8 | 9 | import "crypto/tls" 10 | 11 | // temporary copy of Go 1.7's private tls.Config.clone: 12 | func cloneTLSConfig(c *tls.Config) *tls.Config { 13 | return &tls.Config{ 14 | Rand: c.Rand, 15 | Time: c.Time, 16 | Certificates: c.Certificates, 17 | NameToCertificate: c.NameToCertificate, 18 | GetCertificate: c.GetCertificate, 19 | RootCAs: c.RootCAs, 20 | NextProtos: c.NextProtos, 21 | ServerName: c.ServerName, 22 | ClientAuth: c.ClientAuth, 23 | ClientCAs: c.ClientCAs, 24 | InsecureSkipVerify: c.InsecureSkipVerify, 25 | CipherSuites: c.CipherSuites, 26 | PreferServerCipherSuites: c.PreferServerCipherSuites, 27 | SessionTicketsDisabled: c.SessionTicketsDisabled, 28 | SessionTicketKey: c.SessionTicketKey, 29 | ClientSessionCache: c.ClientSessionCache, 30 | MinVersion: c.MinVersion, 31 | MaxVersion: c.MaxVersion, 32 | CurvePreferences: c.CurvePreferences, 33 | DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, 34 | Renegotiation: c.Renegotiation, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "crypto/tls" 11 | "io" 12 | "net/http" 13 | ) 14 | 15 | func cloneTLSConfig(c *tls.Config) *tls.Config { 16 | c2 := c.Clone() 17 | c2.GetClientCertificate = c.GetClientCertificate // golang.org/issue/19264 18 | return c2 19 | } 20 | 21 | var _ http.Pusher = (*responseWriter)(nil) 22 | 23 | // Push implements http.Pusher. 24 | func (w *responseWriter) Push(target string, opts *http.PushOptions) error { 25 | internalOpts := pushOptions{} 26 | if opts != nil { 27 | internalOpts.Method = opts.Method 28 | internalOpts.Header = opts.Header 29 | } 30 | return w.push(target, internalOpts) 31 | } 32 | 33 | func configureServer18(h1 *http.Server, h2 *Server) error { 34 | if h2.IdleTimeout == 0 { 35 | if h1.IdleTimeout != 0 { 36 | h2.IdleTimeout = h1.IdleTimeout 37 | } else { 38 | h2.IdleTimeout = h1.ReadTimeout 39 | } 40 | } 41 | return nil 42 | } 43 | 44 | func shouldLogPanic(panicValue interface{}) bool { 45 | return panicValue != nil && panicValue != http.ErrAbortHandler 46 | } 47 | 48 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 49 | return req.GetBody 50 | } 51 | 52 | func reqBodyIsNoBody(body io.ReadCloser) bool { 53 | return body == http.NoBody 54 | } 55 | 56 | func go18httpNoBody() io.ReadCloser { return http.NoBody } // for tests only 57 | -------------------------------------------------------------------------------- /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/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/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/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_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 calls for AMD64, 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-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | CALL runtime·entersyscall(SB) 24 | MOVQ a1+8(FP), DI 25 | MOVQ a2+16(FP), SI 26 | MOVQ a3+24(FP), DX 27 | MOVQ $0, R10 28 | MOVQ $0, R8 29 | MOVQ $0, R9 30 | MOVQ trap+0(FP), AX // syscall entry 31 | SYSCALL 32 | MOVQ AX, r1+32(FP) 33 | MOVQ DX, r2+40(FP) 34 | CALL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVQ a1+8(FP), DI 45 | MOVQ a2+16(FP), SI 46 | MOVQ a3+24(FP), DX 47 | MOVQ $0, R10 48 | MOVQ $0, R8 49 | MOVQ $0, R9 50 | MOVQ trap+0(FP), AX // syscall entry 51 | SYSCALL 52 | MOVQ AX, r1+32(FP) 53 | MOVQ DX, r2+40(FP) 54 | RET 55 | 56 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 57 | JMP syscall·gettimeofday(SB) 58 | -------------------------------------------------------------------------------- /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 darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | 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) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | uintptr_t 35 | 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) 36 | { 37 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 31 | if($line =~ /^(.*)\\$/) { 32 | # Handle continuation 33 | $line = $1; 34 | $_ =~ s/^\s+//; 35 | $line .= $_; 36 | } else { 37 | # New line 38 | $line = $_; 39 | } 40 | next if $line =~ /\\$/; 41 | if($line =~ /^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$/) { 42 | my $num = $1; 43 | my $proto = $6; 44 | my $compat = $8; 45 | my $name = "$7_$9"; 46 | 47 | $name = "$7_$11" if $11 ne ''; 48 | $name =~ y/a-z/A-Z/; 49 | 50 | if($compat eq '' || $compat eq '13' || $compat eq '30' || $compat eq '50') { 51 | print " $name = $num; // $proto\n"; 52 | } 53 | } 54 | } 55 | 56 | 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_dragonfly_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,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_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,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_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,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /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/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/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/golang.org/x/text/secure/bidirule/bidirule10.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | if !t.isRTL() { 11 | return true 12 | } 13 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/norm/trie.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package norm 6 | 7 | type valueRange struct { 8 | value uint16 // header: value:stride 9 | lo, hi byte // header: lo:n 10 | } 11 | 12 | type sparseBlocks struct { 13 | values []valueRange 14 | offset []uint16 15 | } 16 | 17 | var nfcSparse = sparseBlocks{ 18 | values: nfcSparseValues[:], 19 | offset: nfcSparseOffset[:], 20 | } 21 | 22 | var nfkcSparse = sparseBlocks{ 23 | values: nfkcSparseValues[:], 24 | offset: nfkcSparseOffset[:], 25 | } 26 | 27 | var ( 28 | nfcData = newNfcTrie(0) 29 | nfkcData = newNfkcTrie(0) 30 | ) 31 | 32 | // lookupValue determines the type of block n and looks up the value for b. 33 | // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block 34 | // is a list of ranges with an accompanying value. Given a matching range r, 35 | // the value for b is by r.value + (b - r.lo) * stride. 36 | func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { 37 | offset := t.offset[n] 38 | header := t.values[offset] 39 | lo := offset + 1 40 | hi := lo + uint16(header.lo) 41 | for lo < hi { 42 | m := lo + (hi-lo)/2 43 | r := t.values[m] 44 | if r.lo <= b && b <= r.hi { 45 | return r.value + uint16(b-r.lo)*header.value 46 | } 47 | if b < r.lo { 48 | hi = m 49 | } else { 50 | lo = m + 1 51 | } 52 | } 53 | return 0 54 | } 55 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/Makefile: -------------------------------------------------------------------------------- 1 | all: test testrace 2 | 3 | deps: 4 | go get -d -v google.golang.org/grpc/... 5 | 6 | updatedeps: 7 | go get -d -v -u -f google.golang.org/grpc/... 8 | 9 | testdeps: 10 | go get -d -v -t google.golang.org/grpc/... 11 | 12 | updatetestdeps: 13 | go get -d -v -t -u -f google.golang.org/grpc/... 14 | 15 | build: deps 16 | go build google.golang.org/grpc/... 17 | 18 | proto: 19 | @ if ! which protoc > /dev/null; then \ 20 | echo "error: protoc not installed" >&2; \ 21 | exit 1; \ 22 | fi 23 | go generate google.golang.org/grpc/... 24 | 25 | test: testdeps 26 | go test -cpu 1,4 -timeout 5m google.golang.org/grpc/... 27 | 28 | testrace: testdeps 29 | go test -race -cpu 1,4 -timeout 7m google.golang.org/grpc/... 30 | 31 | clean: 32 | go clean -i google.golang.org/grpc/... 33 | 34 | .PHONY: \ 35 | all \ 36 | deps \ 37 | updatedeps \ 38 | testdeps \ 39 | updatetestdeps \ 40 | build \ 41 | proto \ 42 | test \ 43 | testrace \ 44 | clean \ 45 | coverage 46 | -------------------------------------------------------------------------------- /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/credentials_util_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package credentials 22 | 23 | import ( 24 | "crypto/tls" 25 | ) 26 | 27 | // cloneTLSConfig returns a shallow clone of the exported 28 | // fields of cfg, ignoring the unexported sync.Once, which 29 | // contains a mutex and must not be copied. 30 | // 31 | // If cfg is nil, a new zero tls.Config is returned. 32 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 33 | if cfg == nil { 34 | return &tls.Config{} 35 | } 36 | 37 | return cfg.Clone() 38 | } 39 | -------------------------------------------------------------------------------- /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/internal/channelz/types_nonlinux.go: -------------------------------------------------------------------------------- 1 | // +build !linux appengine !go1.7 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 "google.golang.org/grpc/grpclog" 24 | 25 | func init() { 26 | grpclog.Infof("Channelz: socket options are not supported on non-linux os and appengine.") 27 | } 28 | 29 | // SocketOptionData defines the struct to hold socket option data, and related 30 | // getter function to obtain info from fd. 31 | // Windows OS doesn't support Socket Option 32 | type SocketOptionData struct { 33 | } 34 | 35 | // Getsockopt defines the function to get socket options requested by channelz. 36 | // It is to be passed to syscall.RawConn.Control(). 37 | // Windows OS doesn't support Socket Option 38 | func (s *SocketOptionData) Getsockopt(fd uintptr) {} 39 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/channelz/util_linux_go19.go: -------------------------------------------------------------------------------- 1 | // +build linux,go1.9,!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_pre_go19.go: -------------------------------------------------------------------------------- 1 | // +build !linux !go1.9 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/envconfig/envconfig.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 envconfig contains grpc settings configured by environment variables. 20 | package envconfig 21 | 22 | import ( 23 | "os" 24 | "strings" 25 | ) 26 | 27 | const ( 28 | prefix = "GRPC_GO_" 29 | retryStr = prefix + "RETRY" 30 | ) 31 | 32 | var ( 33 | // Retry is set if retry is explicitly enabled via "GRPC_GO_RETRY=on". 34 | Retry = strings.EqualFold(os.Getenv(retryStr), "on") 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/internal.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 gRPC authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | // Package internal contains gRPC-internal code for testing, to avoid polluting 19 | // the godoc of the top-level grpc package. 20 | package internal 21 | 22 | // TestingUseHandlerImpl enables the http.Handler-based server implementation. 23 | // It must be called before Serve and requires TLS credentials. 24 | // 25 | // The provided grpcServer must be of type *grpc.Server. It is untyped 26 | // for circular dependency reasons. 27 | var TestingUseHandlerImpl func(grpcServer interface{}) 28 | -------------------------------------------------------------------------------- /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 | 46 | func fatalf(format string, args ...interface{}) { 47 | if grpclog.V(logLevel) { 48 | grpclog.Fatalf(format, args...) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6,!go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6, !go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | lookupTXT = func(ctx context.Context, name string) ([]string, error) { return net.LookupTXT(name) } 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | lookupTXT = net.DefaultResolver.LookupTXT 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/transport/log.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2017 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // This file contains wrappers for grpclog functions. 20 | // The transport package only logs to verbose level 2 by default. 21 | 22 | package transport 23 | 24 | import "google.golang.org/grpc/grpclog" 25 | 26 | const logLevel = 2 27 | 28 | func infof(format string, args ...interface{}) { 29 | if grpclog.V(logLevel) { 30 | grpclog.Infof(format, args...) 31 | } 32 | } 33 | 34 | func warningf(format string, args ...interface{}) { 35 | if grpclog.V(logLevel) { 36 | grpclog.Warningf(format, args...) 37 | } 38 | } 39 | 40 | func errorf(format string, args ...interface{}) { 41 | if grpclog.V(logLevel) { 42 | grpclog.Errorf(format, args...) 43 | } 44 | } 45 | 46 | func fatalf(format string, args ...interface{}) { 47 | if grpclog.V(logLevel) { 48 | grpclog.Fatalf(format, args...) 49 | } 50 | } 51 | --------------------------------------------------------------------------------