├── .circleci └── config.yml ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .golangci.yml ├── CHANGELOG.md ├── CODEOWNERS ├── CONTRIBUTING.md ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE.txt ├── Makefile ├── README.md ├── azure-pipelines.yml ├── evaluation_detail.go ├── evaluation_detail_test.go ├── event_processor.go ├── event_processor_test.go ├── event_summarizer.go ├── event_summarizer_test.go ├── events.go ├── events_output.go ├── feature_store.go ├── feature_store_test.go ├── flag.go ├── flag_test.go ├── flags_state.go ├── flags_state_test.go ├── ldclient.go ├── ldclient_evaluation_test.go ├── ldclient_offline_test.go ├── ldclient_test.go ├── ldconsul ├── consul.go └── consul_test.go ├── lddynamodb ├── dynamodb.go └── dynamodb_test.go ├── ldfiledata ├── file_data_source.go └── file_data_source_test.go ├── ldfilewatch ├── watched_file_data_source.go └── watched_file_data_source_test.go ├── legacy_feature.go ├── lru_cache.go ├── lru_cache_test.go ├── operators.go ├── operators_test.go ├── polling.go ├── polling_test.go ├── redis ├── redis.go └── redis_test.go ├── requestor.go ├── scripts └── release.sh ├── segment.go ├── segment_test.go ├── shared_test └── feature_store.go ├── streaming.go ├── streaming_test.go ├── user.go ├── user_filter.go ├── user_filter_test.go ├── user_test.go ├── util.go ├── util_test.go ├── utils ├── dependency_ordering.go ├── feature_store_wrapper.go └── feature_store_wrapper_test.go ├── vendor ├── github.com │ ├── aws │ │ └── aws-sdk-go │ │ │ ├── LICENSE.txt │ │ │ ├── NOTICE.txt │ │ │ ├── aws │ │ │ ├── awserr │ │ │ │ ├── error.go │ │ │ │ └── types.go │ │ │ ├── awsutil │ │ │ │ ├── copy.go │ │ │ │ ├── equal.go │ │ │ │ ├── path_value.go │ │ │ │ ├── prettify.go │ │ │ │ └── string_value.go │ │ │ ├── client │ │ │ │ ├── client.go │ │ │ │ ├── default_retryer.go │ │ │ │ ├── logger.go │ │ │ │ └── metadata │ │ │ │ │ └── client_info.go │ │ │ ├── config.go │ │ │ ├── context.go │ │ │ ├── context_1_6.go │ │ │ ├── context_1_7.go │ │ │ ├── convert_types.go │ │ │ ├── corehandlers │ │ │ │ ├── handlers.go │ │ │ │ ├── param_validator.go │ │ │ │ └── user_agent.go │ │ │ ├── credentials │ │ │ │ ├── chain_provider.go │ │ │ │ ├── credentials.go │ │ │ │ ├── ec2rolecreds │ │ │ │ │ └── ec2_role_provider.go │ │ │ │ ├── endpointcreds │ │ │ │ │ └── provider.go │ │ │ │ ├── env_provider.go │ │ │ │ ├── shared_credentials_provider.go │ │ │ │ ├── static_provider.go │ │ │ │ └── stscreds │ │ │ │ │ └── assume_role_provider.go │ │ │ ├── csm │ │ │ │ ├── doc.go │ │ │ │ ├── enable.go │ │ │ │ ├── metric.go │ │ │ │ ├── metric_chan.go │ │ │ │ └── reporter.go │ │ │ ├── defaults │ │ │ │ ├── defaults.go │ │ │ │ └── shared_config.go │ │ │ ├── doc.go │ │ │ ├── ec2metadata │ │ │ │ ├── api.go │ │ │ │ └── service.go │ │ │ ├── endpoints │ │ │ │ ├── decode.go │ │ │ │ ├── defaults.go │ │ │ │ ├── doc.go │ │ │ │ ├── endpoints.go │ │ │ │ ├── v3model.go │ │ │ │ └── v3model_codegen.go │ │ │ ├── errors.go │ │ │ ├── jsonvalue.go │ │ │ ├── logger.go │ │ │ ├── request │ │ │ │ ├── connection_reset_error.go │ │ │ │ ├── connection_reset_error_other.go │ │ │ │ ├── handlers.go │ │ │ │ ├── http_request.go │ │ │ │ ├── offset_reader.go │ │ │ │ ├── request.go │ │ │ │ ├── request_1_7.go │ │ │ │ ├── request_1_8.go │ │ │ │ ├── request_context.go │ │ │ │ ├── request_context_1_6.go │ │ │ │ ├── request_pagination.go │ │ │ │ ├── retryer.go │ │ │ │ ├── timeout_read_closer.go │ │ │ │ ├── validation.go │ │ │ │ └── waiter.go │ │ │ ├── session │ │ │ │ ├── doc.go │ │ │ │ ├── env_config.go │ │ │ │ ├── session.go │ │ │ │ └── shared_config.go │ │ │ ├── signer │ │ │ │ └── v4 │ │ │ │ │ ├── header_rules.go │ │ │ │ │ ├── options.go │ │ │ │ │ ├── uri_path.go │ │ │ │ │ └── v4.go │ │ │ ├── types.go │ │ │ ├── url.go │ │ │ ├── url_1_7.go │ │ │ └── version.go │ │ │ ├── internal │ │ │ ├── ini │ │ │ │ ├── ast.go │ │ │ │ ├── comma_token.go │ │ │ │ ├── comment_token.go │ │ │ │ ├── doc.go │ │ │ │ ├── empty_token.go │ │ │ │ ├── expression.go │ │ │ │ ├── fuzz.go │ │ │ │ ├── ini.go │ │ │ │ ├── ini_lexer.go │ │ │ │ ├── ini_parser.go │ │ │ │ ├── literal_tokens.go │ │ │ │ ├── newline_token.go │ │ │ │ ├── number_helper.go │ │ │ │ ├── op_tokens.go │ │ │ │ ├── parse_error.go │ │ │ │ ├── parse_stack.go │ │ │ │ ├── sep_tokens.go │ │ │ │ ├── skipper.go │ │ │ │ ├── statement.go │ │ │ │ ├── value_util.go │ │ │ │ ├── visitor.go │ │ │ │ ├── walker.go │ │ │ │ └── ws_token.go │ │ │ ├── sdkio │ │ │ │ ├── io_go1.6.go │ │ │ │ └── io_go1.7.go │ │ │ ├── sdkrand │ │ │ │ └── locked_source.go │ │ │ ├── sdkuri │ │ │ │ └── path.go │ │ │ └── shareddefaults │ │ │ │ ├── ecs_container.go │ │ │ │ └── shared_config.go │ │ │ ├── private │ │ │ └── protocol │ │ │ │ ├── host.go │ │ │ │ ├── idempotency.go │ │ │ │ ├── json │ │ │ │ └── jsonutil │ │ │ │ │ ├── build.go │ │ │ │ │ └── unmarshal.go │ │ │ │ ├── jsonrpc │ │ │ │ └── jsonrpc.go │ │ │ │ ├── jsonvalue.go │ │ │ │ ├── payload.go │ │ │ │ ├── query │ │ │ │ ├── build.go │ │ │ │ ├── queryutil │ │ │ │ │ └── queryutil.go │ │ │ │ ├── unmarshal.go │ │ │ │ └── unmarshal_error.go │ │ │ │ ├── rest │ │ │ │ ├── build.go │ │ │ │ ├── payload.go │ │ │ │ └── unmarshal.go │ │ │ │ ├── timestamp.go │ │ │ │ ├── unmarshal.go │ │ │ │ └── xml │ │ │ │ └── xmlutil │ │ │ │ ├── build.go │ │ │ │ ├── unmarshal.go │ │ │ │ └── xml_to_struct.go │ │ │ └── service │ │ │ ├── dynamodb │ │ │ ├── api.go │ │ │ ├── customizations.go │ │ │ ├── doc.go │ │ │ ├── doc_custom.go │ │ │ ├── dynamodbiface │ │ │ │ └── interface.go │ │ │ ├── errors.go │ │ │ ├── service.go │ │ │ └── waiters.go │ │ │ └── sts │ │ │ ├── api.go │ │ │ ├── customizations.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ └── service.go │ ├── blang │ │ └── semver │ │ │ ├── LICENSE │ │ │ ├── json.go │ │ │ ├── range.go │ │ │ ├── semver.go │ │ │ ├── sort.go │ │ │ └── sql.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── facebookgo │ │ └── httpcontrol │ │ │ ├── httpcontrol.go │ │ │ ├── license │ │ │ └── patents │ ├── fsnotify │ │ └── fsnotify │ │ │ ├── AUTHORS │ │ │ ├── LICENSE │ │ │ ├── fen.go │ │ │ ├── fsnotify.go │ │ │ ├── inotify.go │ │ │ ├── inotify_poller.go │ │ │ ├── kqueue.go │ │ │ ├── open_mode_bsd.go │ │ │ ├── open_mode_darwin.go │ │ │ └── windows.go │ ├── garyburd │ │ └── redigo │ │ │ ├── LICENSE │ │ │ ├── internal │ │ │ └── commandinfo.go │ │ │ └── redis │ │ │ ├── conn.go │ │ │ ├── doc.go │ │ │ ├── go16.go │ │ │ ├── go17.go │ │ │ ├── go18.go │ │ │ ├── log.go │ │ │ ├── pool.go │ │ │ ├── pubsub.go │ │ │ ├── redis.go │ │ │ ├── reply.go │ │ │ ├── scan.go │ │ │ └── script.go │ ├── gregjones │ │ └── httpcache │ │ │ ├── LICENSE.txt │ │ │ └── httpcache.go │ ├── hashicorp │ │ ├── consul │ │ │ ├── LICENSE │ │ │ ├── NOTICE.md │ │ │ ├── api │ │ │ │ ├── acl.go │ │ │ │ ├── agent.go │ │ │ │ ├── api.go │ │ │ │ ├── catalog.go │ │ │ │ ├── connect.go │ │ │ │ ├── connect_ca.go │ │ │ │ ├── connect_intention.go │ │ │ │ ├── coordinate.go │ │ │ │ ├── event.go │ │ │ │ ├── health.go │ │ │ │ ├── kv.go │ │ │ │ ├── lock.go │ │ │ │ ├── operator.go │ │ │ │ ├── operator_area.go │ │ │ │ ├── operator_autopilot.go │ │ │ │ ├── operator_keyring.go │ │ │ │ ├── operator_raft.go │ │ │ │ ├── operator_segment.go │ │ │ │ ├── prepared_query.go │ │ │ │ ├── raw.go │ │ │ │ ├── semaphore.go │ │ │ │ ├── session.go │ │ │ │ ├── snapshot.go │ │ │ │ └── status.go │ │ │ ├── ui-v2 │ │ │ │ └── app │ │ │ │ │ └── styles │ │ │ │ │ └── components │ │ │ │ │ └── notice.scss │ │ │ └── website │ │ │ │ ├── LICENSE.md │ │ │ │ └── source │ │ │ │ ├── api │ │ │ │ └── operator │ │ │ │ │ └── license.html.md │ │ │ │ └── docs │ │ │ │ └── commands │ │ │ │ └── license.html.markdown.erb │ │ ├── go-cleanhttp │ │ │ ├── LICENSE │ │ │ ├── cleanhttp.go │ │ │ ├── doc.go │ │ │ └── handlers.go │ │ ├── go-rootcerts │ │ │ ├── LICENSE │ │ │ ├── doc.go │ │ │ ├── rootcerts.go │ │ │ ├── rootcerts_base.go │ │ │ ├── rootcerts_darwin.go │ │ │ └── test-fixtures │ │ │ │ └── capath-with-symlinks │ │ │ │ ├── securetrust.pem │ │ │ │ └── thawte.pem │ │ └── serf │ │ │ ├── LICENSE │ │ │ ├── coordinate │ │ │ ├── client.go │ │ │ ├── config.go │ │ │ ├── coordinate.go │ │ │ └── phantom.go │ │ │ ├── ops-misc │ │ │ └── debian │ │ │ │ └── copyright │ │ │ └── website │ │ │ └── source │ │ │ └── LICENSE │ ├── jmespath │ │ └── go-jmespath │ │ │ ├── LICENSE │ │ │ ├── api.go │ │ │ ├── astnodetype_string.go │ │ │ ├── functions.go │ │ │ ├── interpreter.go │ │ │ ├── lexer.go │ │ │ ├── parser.go │ │ │ ├── toktype_string.go │ │ │ └── util.go │ ├── launchdarkly │ │ └── eventsource │ │ │ ├── check_redirect.go │ │ │ ├── check_redirect_go1.8.go │ │ │ ├── decoder.go │ │ │ ├── encoder.go │ │ │ ├── interface.go │ │ │ ├── normalise.go │ │ │ ├── repository.go │ │ │ ├── server.go │ │ │ └── stream.go │ ├── mitchellh │ │ ├── go-homedir │ │ │ ├── LICENSE │ │ │ └── homedir.go │ │ └── mapstructure │ │ │ ├── LICENSE │ │ │ ├── decode_hooks.go │ │ │ ├── error.go │ │ │ └── mapstructure.go │ ├── patrickmn │ │ └── go-cache │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── cache.go │ │ │ └── sharded.go │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ └── difflib │ │ │ └── difflib.go │ └── stretchr │ │ └── testify │ │ ├── LICENSE │ │ ├── assert │ │ ├── assertion_format.go │ │ ├── assertion_forward.go │ │ ├── assertions.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ └── http_assertions.go │ │ └── require │ │ ├── doc.go │ │ ├── forward_requirements.go │ │ ├── require.go │ │ ├── require_forward.go │ │ └── requirements.go ├── golang.org │ └── x │ │ └── sys │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── unix │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── fcntl.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ioctl.go │ │ ├── mkpost.go │ │ ├── openbsd_pledge.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── timestruct.go │ │ ├── types_aix.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go └── gopkg.in │ ├── ghodss │ └── yaml.v1 │ │ ├── LICENSE │ │ ├── fields.go │ │ └── yaml.go │ └── yaml.v2 │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── NOTICE │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── versioned_data.go /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Important note** 11 | As mentioned in the [repository changelog](https://github.com/launchdarkly/go-client/blob/v4/CHANGELOG.md#note-on-future-releases), the `go-client` project has been renamed to `go-server-sdk`. All future releases will be made from the [new repository](https://github.com/launchdarkly/go-server-sdk). Please consider updating your import paths and filing potential requests in that repository's [issue tracker](https://github.com/launchdarkly/go-server-sdk/issues). 12 | 13 | **Is your feature request related to a problem? Please describe.** 14 | A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...] 15 | 16 | **Describe the solution you'd like** 17 | A clear and concise description of what you want to happen. 18 | 19 | **Describe alternatives you've considered** 20 | A clear and concise description of any alternative solutions or features you've considered. 21 | 22 | **Additional context** 23 | Add any other context about the feature request here. 24 | -------------------------------------------------------------------------------- /.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | deadline: 120s 3 | tests: false 4 | 5 | linters: 6 | enable-all: true 7 | disable: 8 | - gocyclo 9 | - gofmt 10 | - maligned 11 | - unparam 12 | - lll 13 | fast: false 14 | 15 | linter-settings: 16 | gofmt: 17 | simplify: false 18 | 19 | issues: 20 | exclude: 21 | - "(func|method|struct field|type|var) .* should be " # golint errors about variable names (don't want to fix them because they're in a public interface) 22 | - "G104: Errors unhandled." # Let errcheck handle these 23 | exclude-use-default: false 24 | max-same-issues: 1000 25 | max-per-linter: 1000 26 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing to the LaunchDarkly SDK for Go 2 | ================================================ 3 | 4 | We encourage pull-requests and other contributions from the community. We've also published an [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. 5 | 6 | Note that in order to run unit tests for the `redis`, `ldconsul`, and `lddynamodb` packages, you will need to have a local instance of the corresponding database running on its default port. 7 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | 2 | # Gopkg.toml example 3 | # 4 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 5 | # for detailed Gopkg.toml documentation. 6 | # 7 | # required = ["github.com/user/thing/cmd/thing"] 8 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 9 | # 10 | # [[constraint]] 11 | # name = "github.com/user/project" 12 | # version = "1.0.0" 13 | # 14 | # [[constraint]] 15 | # name = "github.com/user/project2" 16 | # branch = "dev" 17 | # source = "github.com/myfork/project2" 18 | # 19 | # [[override]] 20 | # name = "github.com/x/y" 21 | # version = "2.4.0" 22 | 23 | [prune] 24 | unused-packages = true 25 | non-go = true 26 | go-tests = true 27 | 28 | [[constraint]] 29 | name = "github.com/blang/semver" 30 | version = "3.5.1" 31 | 32 | [[constraint]] 33 | branch = "master" 34 | name = "github.com/facebookgo/httpcontrol" 35 | 36 | [[constraint]] 37 | name = "github.com/garyburd/redigo" 38 | version = "1.4.0" 39 | 40 | [[constraint]] 41 | branch = "master" 42 | name = "github.com/gregjones/httpcache" 43 | 44 | [[constraint]] 45 | name = "github.com/launchdarkly/eventsource" 46 | version = "1.0.0" 47 | 48 | [[constraint]] 49 | name = "github.com/patrickmn/go-cache" 50 | version = "2.1.0" 51 | 52 | [[constraint]] 53 | name = "github.com/stretchr/testify" 54 | version = "1.2.1" 55 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2016 Catamorphic, Co. 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. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | test: lint 2 | go test ./... 3 | 4 | lint: 5 | golangci-lint run ./... 6 | 7 | 8 | -------------------------------------------------------------------------------- /feature_store_test.go: -------------------------------------------------------------------------------- 1 | package ldclient_test 2 | 3 | import ( 4 | "testing" 5 | 6 | ld "gopkg.in/launchdarkly/go-client.v4" 7 | ldtest "gopkg.in/launchdarkly/go-client.v4/shared_test" 8 | ) 9 | 10 | func makeInMemoryStore() (ld.FeatureStore, error) { 11 | return ld.NewInMemoryFeatureStore(nil), nil 12 | } 13 | 14 | func TestInMemoryFeatureStore(t *testing.T) { 15 | ldtest.RunFeatureStoreTests(t, makeInMemoryStore, nil, false) 16 | } 17 | -------------------------------------------------------------------------------- /ldconsul/consul_test.go: -------------------------------------------------------------------------------- 1 | package ldconsul 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | 7 | c "github.com/hashicorp/consul/api" 8 | "github.com/stretchr/testify/require" 9 | ld "gopkg.in/launchdarkly/go-client.v4" 10 | ldtest "gopkg.in/launchdarkly/go-client.v4/shared_test" 11 | "gopkg.in/launchdarkly/go-client.v4/utils" 12 | ) 13 | 14 | func TestConsulFeatureStoreUncached(t *testing.T) { 15 | ldtest.RunFeatureStoreTests(t, makeConsulStoreWithCacheTTL(0), clearExistingData, false) 16 | } 17 | 18 | func TestConsulFeatureStoreCached(t *testing.T) { 19 | ldtest.RunFeatureStoreTests(t, makeConsulStoreWithCacheTTL(30*time.Second), clearExistingData, true) 20 | } 21 | 22 | func TestConsulFeatureStorePrefixes(t *testing.T) { 23 | ldtest.RunFeatureStorePrefixIndependenceTests(t, 24 | func(prefix string) (ld.FeatureStore, error) { 25 | return NewConsulFeatureStore(Prefix(prefix), CacheTTL(0)) 26 | }, clearExistingData) 27 | } 28 | 29 | func TestConsulFeatureStoreConcurrentModification(t *testing.T) { 30 | store1Core, err := newConsulFeatureStoreInternal() // we need the underlying implementation object so we can set testTxHook 31 | require.NoError(t, err) 32 | store1 := utils.NewNonAtomicFeatureStoreWrapper(store1Core) 33 | store2, err := NewConsulFeatureStore() 34 | require.NoError(t, err) 35 | 36 | ldtest.RunFeatureStoreConcurrentModificationTests(t, store1, store2, func(hook func()) { 37 | store1Core.testTxHook = hook 38 | }) 39 | } 40 | 41 | func makeConsulStoreWithCacheTTL(ttl time.Duration) func() (ld.FeatureStore, error) { 42 | return func() (ld.FeatureStore, error) { 43 | return NewConsulFeatureStore(CacheTTL(ttl)) 44 | } 45 | } 46 | 47 | func clearExistingData() error { 48 | client, err := c.NewClient(c.DefaultConfig()) 49 | if err != nil { 50 | return err 51 | } 52 | kv := client.KV() 53 | _, err = kv.DeleteTree("", nil) 54 | return err 55 | } 56 | -------------------------------------------------------------------------------- /lru_cache.go: -------------------------------------------------------------------------------- 1 | package ldclient 2 | 3 | import ( 4 | "container/list" 5 | ) 6 | 7 | type lruCache struct { 8 | values map[interface{}]*list.Element 9 | lruList *list.List 10 | capacity int 11 | } 12 | 13 | func newLruCache(capacity int) lruCache { 14 | return lruCache{ 15 | values: make(map[interface{}]*list.Element), 16 | lruList: list.New(), 17 | capacity: capacity, 18 | } 19 | } 20 | 21 | func (c *lruCache) clear() { 22 | c.values = make(map[interface{}]*list.Element) 23 | c.lruList.Init() 24 | } 25 | 26 | // Stores a value in the cache, returning true (and marking it as recently used) if it was 27 | // already there, or false if it was newly added. 28 | func (c *lruCache) add(value interface{}) bool { 29 | if c.capacity == 0 { 30 | return false 31 | } 32 | if e, ok := c.values[value]; ok { 33 | c.lruList.MoveToFront(e) 34 | return true 35 | } 36 | for len(c.values) >= c.capacity { 37 | oldest := c.lruList.Back() 38 | delete(c.values, oldest.Value) 39 | c.lruList.Remove(oldest) 40 | } 41 | e := c.lruList.PushFront(value) 42 | c.values[value] = e 43 | return false 44 | } 45 | -------------------------------------------------------------------------------- /lru_cache_test.go: -------------------------------------------------------------------------------- 1 | package ldclient 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestLRUCache(t *testing.T) { 10 | t.Run("add returns false for never-seen value", func(t *testing.T) { 11 | cache := newLruCache(10) 12 | assert.False(t, cache.add("a")) 13 | }) 14 | 15 | t.Run("add returns true for already-seen value", func(t *testing.T) { 16 | cache := newLruCache(10) 17 | cache.add("a") 18 | assert.True(t, cache.add("a")) 19 | }) 20 | 21 | t.Run("oldest value is discarded when capacity is exceeded", func(t *testing.T) { 22 | cache := newLruCache(2) 23 | cache.add("a") 24 | cache.add("b") 25 | cache.add("c") 26 | assert.True(t, cache.add("c")) 27 | assert.True(t, cache.add("b")) 28 | assert.False(t, cache.add("a")) 29 | }) 30 | 31 | t.Run("re-adding an existing value makes it new again", func(t *testing.T) { 32 | cache := newLruCache(2) 33 | cache.add("a") 34 | cache.add("b") 35 | cache.add("a") 36 | cache.add("c") 37 | assert.True(t, cache.add("c")) 38 | assert.True(t, cache.add("a")) 39 | assert.False(t, cache.add("b")) 40 | }) 41 | 42 | t.Run("zero-length cache treats values as new", func(t *testing.T) { 43 | cache := newLruCache(0) 44 | assert.False(t, cache.add("a")) 45 | assert.False(t, cache.add("a")) 46 | }) 47 | } 48 | -------------------------------------------------------------------------------- /scripts/release.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # This script updates the version for the ldclient.go 3 | 4 | set -uxe 5 | echo "Starting go-client release." 6 | 7 | VERSION=$1 8 | 9 | #Update version in ldclient.go 10 | LDCLIENT_GO_TEMP=./ldclient.go.tmp 11 | sed "s/const Version =.*/const Version = \"${VERSION}\"/g" ldclient.go > ${LDCLIENT_GO_TEMP} 12 | mv ${LDCLIENT_GO_TEMP} ldclient.go 13 | 14 | echo "Done with go-client release" 15 | 16 | -------------------------------------------------------------------------------- /user_test.go: -------------------------------------------------------------------------------- 1 | package ldclient 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestNewUser(t *testing.T) { 10 | user := NewUser("some-key") 11 | k, _ := user.valueOf("key") 12 | assert.Equal(t, "some-key", k) 13 | } 14 | 15 | func TestNewAnonymousUser(t *testing.T) { 16 | user := NewAnonymousUser("some-key") 17 | 18 | k, _ := user.valueOf("key") 19 | assert.Equal(t, "some-key", k) 20 | 21 | anonymous, _ := user.valueOf("anonymous") 22 | assert.Equal(t, true, anonymous) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/NOTICE.txt: -------------------------------------------------------------------------------- 1 | AWS SDK for Go 2 | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | Copyright 2014-2015 Stripe, Inc. 4 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go: -------------------------------------------------------------------------------- 1 | package awsutil 2 | 3 | import ( 4 | "reflect" 5 | ) 6 | 7 | // DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. 8 | // In addition to this, this method will also dereference the input values if 9 | // possible so the DeepEqual performed will not fail if one parameter is a 10 | // pointer and the other is not. 11 | // 12 | // DeepEqual will not perform indirection of nested values of the input parameters. 13 | func DeepEqual(a, b interface{}) bool { 14 | ra := reflect.Indirect(reflect.ValueOf(a)) 15 | rb := reflect.Indirect(reflect.ValueOf(b)) 16 | 17 | if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { 18 | // If the elements are both nil, and of the same type the are equal 19 | // If they are of different types they are not equal 20 | return reflect.TypeOf(a) == reflect.TypeOf(b) 21 | } else if raValid != rbValid { 22 | // Both values must be valid to be equal 23 | return false 24 | } 25 | 26 | return reflect.DeepEqual(ra.Interface(), rb.Interface()) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go: -------------------------------------------------------------------------------- 1 | package metadata 2 | 3 | // ClientInfo wraps immutable data from the client.Client structure. 4 | type ClientInfo struct { 5 | ServiceName string 6 | ServiceID string 7 | APIVersion string 8 | Endpoint string 9 | SigningName string 10 | SigningRegion string 11 | JSONVersion string 12 | TargetPrefix string 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package aws 4 | 5 | import "time" 6 | 7 | // An emptyCtx is a copy of the Go 1.7 context.emptyCtx type. This is copied to 8 | // provide a 1.6 and 1.5 safe version of context that is compatible with Go 9 | // 1.7's Context. 10 | // 11 | // An emptyCtx is never canceled, has no values, and has no deadline. It is not 12 | // struct{}, since vars of this type must have distinct addresses. 13 | type emptyCtx int 14 | 15 | func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { 16 | return 17 | } 18 | 19 | func (*emptyCtx) Done() <-chan struct{} { 20 | return nil 21 | } 22 | 23 | func (*emptyCtx) Err() error { 24 | return nil 25 | } 26 | 27 | func (*emptyCtx) Value(key interface{}) interface{} { 28 | return nil 29 | } 30 | 31 | func (e *emptyCtx) String() string { 32 | switch e { 33 | case backgroundCtx: 34 | return "aws.BackgroundContext" 35 | } 36 | return "unknown empty Context" 37 | } 38 | 39 | var ( 40 | backgroundCtx = new(emptyCtx) 41 | ) 42 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package aws 4 | 5 | import "context" 6 | 7 | var ( 8 | backgroundCtx = context.Background() 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go: -------------------------------------------------------------------------------- 1 | package corehandlers 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | // ValidateParametersHandler is a request handler to validate the input parameters. 6 | // Validating parameters only has meaning if done prior to the request being sent. 7 | var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) { 8 | if !r.ParamsFilled() { 9 | return 10 | } 11 | 12 | if v, ok := r.Params.(request.Validator); ok { 13 | if err := v.Validate(); err != nil { 14 | r.Error = err 15 | } 16 | } 17 | }} 18 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go: -------------------------------------------------------------------------------- 1 | package corehandlers 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | 7 | "github.com/aws/aws-sdk-go/aws" 8 | "github.com/aws/aws-sdk-go/aws/request" 9 | ) 10 | 11 | // SDKVersionUserAgentHandler is a request handler for adding the SDK Version 12 | // to the user agent. 13 | var SDKVersionUserAgentHandler = request.NamedHandler{ 14 | Name: "core.SDKVersionUserAgentHandler", 15 | Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion, 16 | runtime.Version(), runtime.GOOS, runtime.GOARCH), 17 | } 18 | 19 | const execEnvVar = `AWS_EXECUTION_ENV` 20 | const execEnvUAKey = `exec_env` 21 | 22 | // AddHostExecEnvUserAgentHander is a request handler appending the SDK's 23 | // execution environment to the user agent. 24 | // 25 | // If the environment variable AWS_EXECUTION_ENV is set, its value will be 26 | // appended to the user agent string. 27 | var AddHostExecEnvUserAgentHander = request.NamedHandler{ 28 | Name: "core.AddHostExecEnvUserAgentHander", 29 | Fn: func(r *request.Request) { 30 | v := os.Getenv(execEnvVar) 31 | if len(v) == 0 { 32 | return 33 | } 34 | 35 | request.AddToUserAgent(r, execEnvUAKey+"/"+v) 36 | }, 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go: -------------------------------------------------------------------------------- 1 | package credentials 2 | 3 | import ( 4 | "github.com/aws/aws-sdk-go/aws/awserr" 5 | ) 6 | 7 | // StaticProviderName provides a name of Static provider 8 | const StaticProviderName = "StaticProvider" 9 | 10 | var ( 11 | // ErrStaticCredentialsEmpty is emitted when static credentials are empty. 12 | ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil) 13 | ) 14 | 15 | // A StaticProvider is a set of credentials which are set programmatically, 16 | // and will never expire. 17 | type StaticProvider struct { 18 | Value 19 | } 20 | 21 | // NewStaticCredentials returns a pointer to a new Credentials object 22 | // wrapping a static credentials value provider. 23 | func NewStaticCredentials(id, secret, token string) *Credentials { 24 | return NewCredentials(&StaticProvider{Value: Value{ 25 | AccessKeyID: id, 26 | SecretAccessKey: secret, 27 | SessionToken: token, 28 | }}) 29 | } 30 | 31 | // NewStaticCredentialsFromCreds returns a pointer to a new Credentials object 32 | // wrapping the static credentials value provide. Same as NewStaticCredentials 33 | // but takes the creds Value instead of individual fields 34 | func NewStaticCredentialsFromCreds(creds Value) *Credentials { 35 | return NewCredentials(&StaticProvider{Value: creds}) 36 | } 37 | 38 | // Retrieve returns the credentials or error if the credentials are invalid. 39 | func (s *StaticProvider) Retrieve() (Value, error) { 40 | if s.AccessKeyID == "" || s.SecretAccessKey == "" { 41 | return Value{ProviderName: StaticProviderName}, ErrStaticCredentialsEmpty 42 | } 43 | 44 | if len(s.Value.ProviderName) == 0 { 45 | s.Value.ProviderName = StaticProviderName 46 | } 47 | return s.Value, nil 48 | } 49 | 50 | // IsExpired returns if the credentials are expired. 51 | // 52 | // For StaticProvider, the credentials never expired. 53 | func (s *StaticProvider) IsExpired() bool { 54 | return false 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/csm/doc.go: -------------------------------------------------------------------------------- 1 | // Package csm provides Client Side Monitoring (CSM) which enables sending metrics 2 | // via UDP connection. Using the Start function will enable the reporting of 3 | // metrics on a given port. If Start is called, with different parameters, again, 4 | // a panic will occur. 5 | // 6 | // Pause can be called to pause any metrics publishing on a given port. Sessions 7 | // that have had their handlers modified via InjectHandlers may still be used. 8 | // However, the handlers will act as a no-op meaning no metrics will be published. 9 | // 10 | // Example: 11 | // r, err := csm.Start("clientID", ":31000") 12 | // if err != nil { 13 | // panic(fmt.Errorf("failed starting CSM: %v", err)) 14 | // } 15 | // 16 | // sess, err := session.NewSession(&aws.Config{}) 17 | // if err != nil { 18 | // panic(fmt.Errorf("failed loading session: %v", err)) 19 | // } 20 | // 21 | // r.InjectHandlers(&sess.Handlers) 22 | // 23 | // client := s3.New(sess) 24 | // resp, err := client.GetObject(&s3.GetObjectInput{ 25 | // Bucket: aws.String("bucket"), 26 | // Key: aws.String("key"), 27 | // }) 28 | // 29 | // // Will pause monitoring 30 | // r.Pause() 31 | // resp, err = client.GetObject(&s3.GetObjectInput{ 32 | // Bucket: aws.String("bucket"), 33 | // Key: aws.String("key"), 34 | // }) 35 | // 36 | // // Resume monitoring 37 | // r.Continue() 38 | // 39 | // Start returns a Reporter that is used to enable or disable monitoring. If 40 | // access to the Reporter is required later, calling Get will return the Reporter 41 | // singleton. 42 | // 43 | // Example: 44 | // r := csm.Get() 45 | // r.Continue() 46 | package csm 47 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/csm/enable.go: -------------------------------------------------------------------------------- 1 | package csm 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | ) 7 | 8 | var ( 9 | lock sync.Mutex 10 | ) 11 | 12 | // Client side metric handler names 13 | const ( 14 | APICallMetricHandlerName = "awscsm.SendAPICallMetric" 15 | APICallAttemptMetricHandlerName = "awscsm.SendAPICallAttemptMetric" 16 | ) 17 | 18 | // Start will start the a long running go routine to capture 19 | // client side metrics. Calling start multiple time will only 20 | // start the metric listener once and will panic if a different 21 | // client ID or port is passed in. 22 | // 23 | // Example: 24 | // r, err := csm.Start("clientID", "127.0.0.1:8094") 25 | // if err != nil { 26 | // panic(fmt.Errorf("expected no error, but received %v", err)) 27 | // } 28 | // sess := session.NewSession() 29 | // r.InjectHandlers(sess.Handlers) 30 | // 31 | // svc := s3.New(sess) 32 | // out, err := svc.GetObject(&s3.GetObjectInput{ 33 | // Bucket: aws.String("bucket"), 34 | // Key: aws.String("key"), 35 | // }) 36 | func Start(clientID string, url string) (*Reporter, error) { 37 | lock.Lock() 38 | defer lock.Unlock() 39 | 40 | if sender == nil { 41 | sender = newReporter(clientID, url) 42 | } else { 43 | if sender.clientID != clientID { 44 | panic(fmt.Errorf("inconsistent client IDs. %q was expected, but received %q", sender.clientID, clientID)) 45 | } 46 | 47 | if sender.url != url { 48 | panic(fmt.Errorf("inconsistent URLs. %q was expected, but received %q", sender.url, url)) 49 | } 50 | } 51 | 52 | if err := connect(url); err != nil { 53 | sender = nil 54 | return nil, err 55 | } 56 | 57 | return sender, nil 58 | } 59 | 60 | // Get will return a reporter if one exists, if one does not exist, nil will 61 | // be returned. 62 | func Get() *Reporter { 63 | lock.Lock() 64 | defer lock.Unlock() 65 | 66 | return sender 67 | } 68 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go: -------------------------------------------------------------------------------- 1 | package csm 2 | 3 | import ( 4 | "sync/atomic" 5 | ) 6 | 7 | const ( 8 | runningEnum = iota 9 | pausedEnum 10 | ) 11 | 12 | var ( 13 | // MetricsChannelSize of metrics to hold in the channel 14 | MetricsChannelSize = 100 15 | ) 16 | 17 | type metricChan struct { 18 | ch chan metric 19 | paused int64 20 | } 21 | 22 | func newMetricChan(size int) metricChan { 23 | return metricChan{ 24 | ch: make(chan metric, size), 25 | } 26 | } 27 | 28 | func (ch *metricChan) Pause() { 29 | atomic.StoreInt64(&ch.paused, pausedEnum) 30 | } 31 | 32 | func (ch *metricChan) Continue() { 33 | atomic.StoreInt64(&ch.paused, runningEnum) 34 | } 35 | 36 | func (ch *metricChan) IsPaused() bool { 37 | v := atomic.LoadInt64(&ch.paused) 38 | return v == pausedEnum 39 | } 40 | 41 | // Push will push metrics to the metric channel if the channel 42 | // is not paused 43 | func (ch *metricChan) Push(m metric) bool { 44 | if ch.IsPaused() { 45 | return false 46 | } 47 | 48 | select { 49 | case ch.ch <- m: 50 | return true 51 | default: 52 | return false 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go: -------------------------------------------------------------------------------- 1 | package defaults 2 | 3 | import ( 4 | "github.com/aws/aws-sdk-go/internal/shareddefaults" 5 | ) 6 | 7 | // SharedCredentialsFilename returns the SDK's default file path 8 | // for the shared credentials file. 9 | // 10 | // Builds the shared config file path based on the OS's platform. 11 | // 12 | // - Linux/Unix: $HOME/.aws/credentials 13 | // - Windows: %USERPROFILE%\.aws\credentials 14 | func SharedCredentialsFilename() string { 15 | return shareddefaults.SharedCredentialsFilename() 16 | } 17 | 18 | // SharedConfigFilename returns the SDK's default file path for 19 | // the shared config file. 20 | // 21 | // Builds the shared config file path based on the OS's platform. 22 | // 23 | // - Linux/Unix: $HOME/.aws/config 24 | // - Windows: %USERPROFILE%\.aws\config 25 | func SharedConfigFilename() string { 26 | return shareddefaults.SharedConfigFilename() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/errors.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | import "github.com/aws/aws-sdk-go/aws/awserr" 4 | 5 | var ( 6 | // ErrMissingRegion is an error that is returned if region configuration is 7 | // not found. 8 | ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) 9 | 10 | // ErrMissingEndpoint is an error that is returned if an endpoint cannot be 11 | // resolved for a service. 12 | ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | // JSONValue is a representation of a grab bag type that will be marshaled 4 | // into a json string. This type can be used just like any other map. 5 | // 6 | // Example: 7 | // 8 | // values := aws.JSONValue{ 9 | // "Foo": "Bar", 10 | // } 11 | // values["Baz"] = "Qux" 12 | type JSONValue map[string]interface{} 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!plan9 2 | 3 | package request 4 | 5 | import ( 6 | "net" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | func isErrConnectionReset(err error) bool { 12 | if opErr, ok := err.(*net.OpError); ok { 13 | if sysErr, ok := opErr.Err.(*os.SyscallError); ok { 14 | return sysErr.Err == syscall.ECONNRESET 15 | } 16 | } 17 | 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go: -------------------------------------------------------------------------------- 1 | // +build appengine plan9 2 | 3 | package request 4 | 5 | import ( 6 | "strings" 7 | ) 8 | 9 | func isErrConnectionReset(err error) bool { 10 | return strings.Contains(err.Error(), "connection reset") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "net/url" 7 | ) 8 | 9 | func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request { 10 | req := new(http.Request) 11 | *req = *r 12 | req.URL = &url.URL{} 13 | *req.URL = *r.URL 14 | req.Body = body 15 | 16 | req.Header = http.Header{} 17 | for k, v := range r.Header { 18 | for _, vv := range v { 19 | req.Header.Add(k, vv) 20 | } 21 | } 22 | 23 | return req 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/offset_reader.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "io" 5 | "sync" 6 | 7 | "github.com/aws/aws-sdk-go/internal/sdkio" 8 | ) 9 | 10 | // offsetReader is a thread-safe io.ReadCloser to prevent racing 11 | // with retrying requests 12 | type offsetReader struct { 13 | buf io.ReadSeeker 14 | lock sync.Mutex 15 | closed bool 16 | } 17 | 18 | func newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader { 19 | reader := &offsetReader{} 20 | buf.Seek(offset, sdkio.SeekStart) 21 | 22 | reader.buf = buf 23 | return reader 24 | } 25 | 26 | // Close will close the instance of the offset reader's access to 27 | // the underlying io.ReadSeeker. 28 | func (o *offsetReader) Close() error { 29 | o.lock.Lock() 30 | defer o.lock.Unlock() 31 | o.closed = true 32 | return nil 33 | } 34 | 35 | // Read is a thread-safe read of the underlying io.ReadSeeker 36 | func (o *offsetReader) Read(p []byte) (int, error) { 37 | o.lock.Lock() 38 | defer o.lock.Unlock() 39 | 40 | if o.closed { 41 | return 0, io.EOF 42 | } 43 | 44 | return o.buf.Read(p) 45 | } 46 | 47 | // Seek is a thread-safe seeking operation. 48 | func (o *offsetReader) Seek(offset int64, whence int) (int64, error) { 49 | o.lock.Lock() 50 | defer o.lock.Unlock() 51 | 52 | return o.buf.Seek(offset, whence) 53 | } 54 | 55 | // CloseAndCopy will return a new offsetReader with a copy of the old buffer 56 | // and close the old buffer. 57 | func (o *offsetReader) CloseAndCopy(offset int64) *offsetReader { 58 | o.Close() 59 | return newOffsetReader(o.buf, offset) 60 | } 61 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_1_7.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package request 4 | 5 | import "io" 6 | 7 | // NoBody is an io.ReadCloser with no bytes. Read always returns EOF 8 | // and Close always returns nil. It can be used in an outgoing client 9 | // request to explicitly signal that a request has zero bytes. 10 | // An alternative, however, is to simply set Request.Body to nil. 11 | // 12 | // Copy of Go 1.8 NoBody type from net/http/http.go 13 | type noBody struct{} 14 | 15 | func (noBody) Read([]byte) (int, error) { return 0, io.EOF } 16 | func (noBody) Close() error { return nil } 17 | func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil } 18 | 19 | // NoBody is an empty reader that will trigger the Go HTTP client to not include 20 | // and body in the HTTP request. 21 | var NoBody = noBody{} 22 | 23 | // ResetBody rewinds the request body back to its starting position, and 24 | // sets the HTTP Request body reference. When the body is read prior 25 | // to being sent in the HTTP request it will need to be rewound. 26 | // 27 | // ResetBody will automatically be called by the SDK's build handler, but if 28 | // the request is being used directly ResetBody must be called before the request 29 | // is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically 30 | // call ResetBody. 31 | func (r *Request) ResetBody() { 32 | body, err := r.getNextRequestBody() 33 | if err != nil { 34 | r.Error = err 35 | return 36 | } 37 | 38 | r.HTTPRequest.Body = body 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package request 4 | 5 | import ( 6 | "net/http" 7 | ) 8 | 9 | // NoBody is a http.NoBody reader instructing Go HTTP client to not include 10 | // and body in the HTTP request. 11 | var NoBody = http.NoBody 12 | 13 | // ResetBody rewinds the request body back to its starting position, and 14 | // sets the HTTP Request body reference. When the body is read prior 15 | // to being sent in the HTTP request it will need to be rewound. 16 | // 17 | // ResetBody will automatically be called by the SDK's build handler, but if 18 | // the request is being used directly ResetBody must be called before the request 19 | // is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically 20 | // call ResetBody. 21 | // 22 | // Will also set the Go 1.8's http.Request.GetBody member to allow retrying 23 | // PUT/POST redirects. 24 | func (r *Request) ResetBody() { 25 | body, err := r.getNextRequestBody() 26 | if err != nil { 27 | r.Error = err 28 | return 29 | } 30 | 31 | r.HTTPRequest.Body = body 32 | r.HTTPRequest.GetBody = r.getNextRequestBody 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package request 4 | 5 | import "github.com/aws/aws-sdk-go/aws" 6 | 7 | // setContext updates the Request to use the passed in context for cancellation. 8 | // Context will also be used for request retry delay. 9 | // 10 | // Creates shallow copy of the http.Request with the WithContext method. 11 | func setRequestContext(r *Request, ctx aws.Context) { 12 | r.context = ctx 13 | r.HTTPRequest = r.HTTPRequest.WithContext(ctx) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package request 4 | 5 | import "github.com/aws/aws-sdk-go/aws" 6 | 7 | // setContext updates the Request to use the passed in context for cancellation. 8 | // Context will also be used for request retry delay. 9 | // 10 | // Creates shallow copy of the http.Request with the WithContext method. 11 | func setRequestContext(r *Request, ctx aws.Context) { 12 | r.context = ctx 13 | r.HTTPRequest.Cancel = ctx.Done() 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go: -------------------------------------------------------------------------------- 1 | package v4 2 | 3 | // WithUnsignedPayload will enable and set the UnsignedPayload field to 4 | // true of the signer. 5 | func WithUnsignedPayload(v4 *Signer) { 6 | v4.UnsignedPayload = true 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package v4 4 | 5 | import ( 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | func getURIPath(u *url.URL) string { 11 | var uri string 12 | 13 | if len(u.Opaque) > 0 { 14 | uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") 15 | } else { 16 | uri = u.EscapedPath() 17 | } 18 | 19 | if len(uri) == 0 { 20 | uri = "/" 21 | } 22 | 23 | return uri 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/url.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package aws 4 | 5 | import "net/url" 6 | 7 | // URLHostname will extract the Hostname without port from the URL value. 8 | // 9 | // Wrapper of net/url#URL.Hostname for backwards Go version compatibility. 10 | func URLHostname(url *url.URL) string { 11 | return url.Hostname() 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package aws 4 | 5 | import ( 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | // URLHostname will extract the Hostname without port from the URL value. 11 | // 12 | // Copy of Go 1.8's net/url#URL.Hostname functionality. 13 | func URLHostname(url *url.URL) string { 14 | return stripPort(url.Host) 15 | 16 | } 17 | 18 | // stripPort is copy of Go 1.8 url#URL.Hostname functionality. 19 | // https://golang.org/src/net/url/url.go 20 | func stripPort(hostport string) string { 21 | colon := strings.IndexByte(hostport, ':') 22 | if colon == -1 { 23 | return hostport 24 | } 25 | if i := strings.IndexByte(hostport, ']'); i != -1 { 26 | return strings.TrimPrefix(hostport[:i], "[") 27 | } 28 | return hostport[:colon] 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/version.go: -------------------------------------------------------------------------------- 1 | // Package aws provides core functionality for making requests to AWS services. 2 | package aws 3 | 4 | // SDKName is the name of this AWS SDK 5 | const SDKName = "aws-sdk-go" 6 | 7 | // SDKVersion is the version of this SDK 8 | const SDKVersion = "1.15.69" 9 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/comma_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | var commaRunes = []rune(",") 4 | 5 | func isComma(b rune) bool { 6 | return b == ',' 7 | } 8 | 9 | func newCommaToken() Token { 10 | return newToken(TokenComma, commaRunes, NoneType) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // isComment will return whether or not the next byte(s) is a 4 | // comment. 5 | func isComment(b []rune) bool { 6 | if len(b) == 0 { 7 | return false 8 | } 9 | 10 | switch b[0] { 11 | case ';': 12 | return true 13 | case '#': 14 | return true 15 | } 16 | 17 | return false 18 | } 19 | 20 | // newCommentToken will create a comment token and 21 | // return how many bytes were read. 22 | func newCommentToken(b []rune) (Token, int, error) { 23 | i := 0 24 | for ; i < len(b); i++ { 25 | if b[i] == '\n' { 26 | break 27 | } 28 | 29 | if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' { 30 | break 31 | } 32 | } 33 | 34 | return newToken(TokenComment, b[:i], NoneType), i, nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/doc.go: -------------------------------------------------------------------------------- 1 | // Package ini is an LL(1) parser for configuration files. 2 | // 3 | // Example: 4 | // sections, err := ini.OpenFile("/path/to/file") 5 | // if err != nil { 6 | // panic(err) 7 | // } 8 | // 9 | // profile := "foo" 10 | // section, ok := sections.GetSection(profile) 11 | // if !ok { 12 | // fmt.Printf("section %q could not be found", profile) 13 | // } 14 | // 15 | // Below is the BNF that describes this parser 16 | // Grammar: 17 | // stmt -> value stmt' 18 | // stmt' -> epsilon | op stmt 19 | // value -> number | string | boolean | quoted_string 20 | // 21 | // section -> [ section' 22 | // section' -> value section_close 23 | // section_close -> ] 24 | // 25 | // SkipState will skip (NL WS)+ 26 | // 27 | // comment -> # comment' | ; comment' 28 | // comment' -> epsilon | value 29 | package ini 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/empty_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // emptyToken is used to satisfy the Token interface 4 | var emptyToken = newToken(TokenNone, []rune{}, NoneType) 5 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/expression.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // newExpression will return an expression AST. 4 | // Expr represents an expression 5 | // 6 | // grammar: 7 | // expr -> string | number 8 | func newExpression(tok Token) AST { 9 | return newASTWithRootToken(ASTKindExpr, tok) 10 | } 11 | 12 | func newEqualExpr(left AST, tok Token) AST { 13 | return newASTWithRootToken(ASTKindEqualExpr, tok, left) 14 | } 15 | 16 | // EqualExprKey will return a LHS value in the equal expr 17 | func EqualExprKey(ast AST) string { 18 | children := ast.GetChildren() 19 | if len(children) == 0 || ast.Kind != ASTKindEqualExpr { 20 | return "" 21 | } 22 | 23 | return string(children[0].Root.Raw()) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package ini 4 | 5 | import ( 6 | "bytes" 7 | ) 8 | 9 | func Fuzz(data []byte) int { 10 | b := bytes.NewReader(data) 11 | 12 | if _, err := Parse(b); err != nil { 13 | return 0 14 | } 15 | 16 | return 1 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/ini.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "io" 5 | "os" 6 | 7 | "github.com/aws/aws-sdk-go/aws/awserr" 8 | ) 9 | 10 | // OpenFile takes a path to a given file, and will open and parse 11 | // that file. 12 | func OpenFile(path string) (Sections, error) { 13 | f, err := os.Open(path) 14 | if err != nil { 15 | return Sections{}, awserr.New(ErrCodeUnableToReadFile, "unable to open file", err) 16 | } 17 | defer f.Close() 18 | 19 | return Parse(f) 20 | } 21 | 22 | // Parse will parse the given file using the shared config 23 | // visitor. 24 | func Parse(f io.Reader) (Sections, error) { 25 | tree, err := ParseAST(f) 26 | if err != nil { 27 | return Sections{}, err 28 | } 29 | 30 | v := NewDefaultVisitor() 31 | if err = Walk(tree, v); err != nil { 32 | return Sections{}, err 33 | } 34 | 35 | return v.Sections, nil 36 | } 37 | 38 | // ParseBytes will parse the given bytes and return the parsed sections. 39 | func ParseBytes(b []byte) (Sections, error) { 40 | tree, err := ParseASTBytes(b) 41 | if err != nil { 42 | return Sections{}, err 43 | } 44 | 45 | v := NewDefaultVisitor() 46 | if err = Walk(tree, v); err != nil { 47 | return Sections{}, err 48 | } 49 | 50 | return v.Sections, nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/newline_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | func isNewline(b []rune) bool { 4 | if len(b) == 0 { 5 | return false 6 | } 7 | 8 | if b[0] == '\n' { 9 | return true 10 | } 11 | 12 | if len(b) < 2 { 13 | return false 14 | } 15 | 16 | return b[0] == '\r' && b[1] == '\n' 17 | } 18 | 19 | func newNewlineToken(b []rune) (Token, int, error) { 20 | i := 1 21 | if b[0] == '\r' && isNewline(b[1:]) { 22 | i++ 23 | } 24 | 25 | if !isNewline([]rune(b[:i])) { 26 | return emptyToken, 0, NewParseError("invalid new line token") 27 | } 28 | 29 | return newToken(TokenNL, b[:i], NoneType), i, nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/op_tokens.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | var ( 8 | equalOp = []rune("=") 9 | equalColonOp = []rune(":") 10 | ) 11 | 12 | func isOp(b []rune) bool { 13 | if len(b) == 0 { 14 | return false 15 | } 16 | 17 | switch b[0] { 18 | case '=': 19 | return true 20 | case ':': 21 | return true 22 | default: 23 | return false 24 | } 25 | } 26 | 27 | func newOpToken(b []rune) (Token, int, error) { 28 | tok := Token{} 29 | 30 | switch b[0] { 31 | case '=': 32 | tok = newToken(TokenOp, equalOp, NoneType) 33 | case ':': 34 | tok = newToken(TokenOp, equalColonOp, NoneType) 35 | default: 36 | return tok, 0, NewParseError(fmt.Sprintf("unexpected op type, %v", b[0])) 37 | } 38 | return tok, 1, nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/parse_error.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import "fmt" 4 | 5 | const ( 6 | // ErrCodeParseError is returned when a parsing error 7 | // has occurred. 8 | ErrCodeParseError = "INIParseError" 9 | ) 10 | 11 | // ParseError is an error which is returned during any part of 12 | // the parsing process. 13 | type ParseError struct { 14 | msg string 15 | } 16 | 17 | // NewParseError will return a new ParseError where message 18 | // is the description of the error. 19 | func NewParseError(message string) *ParseError { 20 | return &ParseError{ 21 | msg: message, 22 | } 23 | } 24 | 25 | // Code will return the ErrCodeParseError 26 | func (err *ParseError) Code() string { 27 | return ErrCodeParseError 28 | } 29 | 30 | // Message returns the error's message 31 | func (err *ParseError) Message() string { 32 | return err.msg 33 | } 34 | 35 | // OrigError return nothing since there will never be any 36 | // original error. 37 | func (err *ParseError) OrigError() error { 38 | return nil 39 | } 40 | 41 | func (err *ParseError) Error() string { 42 | return fmt.Sprintf("%s: %s", err.Code(), err.Message()) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/parse_stack.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | ) 7 | 8 | // ParseStack is a stack that contains a container, the stack portion, 9 | // and the list which is the list of ASTs that have been successfully 10 | // parsed. 11 | type ParseStack struct { 12 | top int 13 | container []AST 14 | list []AST 15 | index int 16 | } 17 | 18 | func newParseStack(sizeContainer, sizeList int) ParseStack { 19 | return ParseStack{ 20 | container: make([]AST, sizeContainer), 21 | list: make([]AST, sizeList), 22 | } 23 | } 24 | 25 | // Pop will return and truncate the last container element. 26 | func (s *ParseStack) Pop() AST { 27 | s.top-- 28 | return s.container[s.top] 29 | } 30 | 31 | // Push will add the new AST to the container 32 | func (s *ParseStack) Push(ast AST) { 33 | s.container[s.top] = ast 34 | s.top++ 35 | } 36 | 37 | // MarkComplete will append the AST to the list of completed statements 38 | func (s *ParseStack) MarkComplete(ast AST) { 39 | s.list[s.index] = ast 40 | s.index++ 41 | } 42 | 43 | // List will return the completed statements 44 | func (s ParseStack) List() []AST { 45 | return s.list[:s.index] 46 | } 47 | 48 | // Len will return the length of the container 49 | func (s *ParseStack) Len() int { 50 | return s.top 51 | } 52 | 53 | func (s ParseStack) String() string { 54 | buf := bytes.Buffer{} 55 | for i, node := range s.list { 56 | buf.WriteString(fmt.Sprintf("%d: %v\n", i+1, node)) 57 | } 58 | 59 | return buf.String() 60 | } 61 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/sep_tokens.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | var ( 8 | emptyRunes = []rune{} 9 | ) 10 | 11 | func isSep(b []rune) bool { 12 | if len(b) == 0 { 13 | return false 14 | } 15 | 16 | switch b[0] { 17 | case '[', ']': 18 | return true 19 | default: 20 | return false 21 | } 22 | } 23 | 24 | var ( 25 | openBrace = []rune("[") 26 | closeBrace = []rune("]") 27 | ) 28 | 29 | func newSepToken(b []rune) (Token, int, error) { 30 | tok := Token{} 31 | 32 | switch b[0] { 33 | case '[': 34 | tok = newToken(TokenSep, openBrace, NoneType) 35 | case ']': 36 | tok = newToken(TokenSep, closeBrace, NoneType) 37 | default: 38 | return tok, 0, NewParseError(fmt.Sprintf("unexpected sep type, %v", b[0])) 39 | } 40 | return tok, 1, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/skipper.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // skipper is used to skip certain blocks of an ini file. 4 | // Currently skipper is used to skip nested blocks of ini 5 | // files. See example below 6 | // 7 | // [ foo ] 8 | // nested = ; this section will be skipped 9 | // a=b 10 | // c=d 11 | // bar=baz ; this will be included 12 | type skipper struct { 13 | shouldSkip bool 14 | TokenSet bool 15 | prevTok Token 16 | } 17 | 18 | func newSkipper() skipper { 19 | return skipper{ 20 | prevTok: emptyToken, 21 | } 22 | } 23 | 24 | func (s *skipper) ShouldSkip(tok Token) bool { 25 | if s.shouldSkip && 26 | s.prevTok.Type() == TokenNL && 27 | tok.Type() != TokenWS { 28 | 29 | s.Continue() 30 | return false 31 | } 32 | s.prevTok = tok 33 | 34 | return s.shouldSkip 35 | } 36 | 37 | func (s *skipper) Skip() { 38 | s.shouldSkip = true 39 | s.prevTok = emptyToken 40 | } 41 | 42 | func (s *skipper) Continue() { 43 | s.shouldSkip = false 44 | s.prevTok = emptyToken 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/statement.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // Statement is an empty AST mostly used for transitioning states. 4 | func newStatement() AST { 5 | return newAST(ASTKindStatement, AST{}) 6 | } 7 | 8 | // SectionStatement represents a section AST 9 | func newSectionStatement(tok Token) AST { 10 | return newASTWithRootToken(ASTKindSectionStatement, tok) 11 | } 12 | 13 | // ExprStatement represents a completed expression AST 14 | func newExprStatement(ast AST) AST { 15 | return newAST(ASTKindExprStatement, ast) 16 | } 17 | 18 | // CommentStatement represents a comment in the ini defintion. 19 | // 20 | // grammar: 21 | // comment -> #comment' | ;comment' 22 | // comment' -> epsilon | value 23 | func newCommentStatement(tok Token) AST { 24 | return newAST(ASTKindCommentStatement, newExpression(tok)) 25 | } 26 | 27 | // CompletedSectionStatement represents a completed section 28 | func newCompletedSectionStatement(ast AST) AST { 29 | return newAST(ASTKindCompletedSectionStatement, ast) 30 | } 31 | 32 | // SkipStatement is used to skip whole statements 33 | func newSkipStatement(ast AST) AST { 34 | return newAST(ASTKindSkipStatement, ast) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/walker.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | // Walk will traverse the AST using the v, the Visitor. 4 | func Walk(tree []AST, v Visitor) error { 5 | for _, node := range tree { 6 | switch node.Kind { 7 | case ASTKindExpr, 8 | ASTKindExprStatement: 9 | 10 | if err := v.VisitExpr(node); err != nil { 11 | return err 12 | } 13 | case ASTKindStatement, 14 | ASTKindCompletedSectionStatement, 15 | ASTKindNestedSectionStatement, 16 | ASTKindCompletedNestedSectionStatement: 17 | 18 | if err := v.VisitStatement(node); err != nil { 19 | return err 20 | } 21 | } 22 | } 23 | 24 | return nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/ini/ws_token.go: -------------------------------------------------------------------------------- 1 | package ini 2 | 3 | import ( 4 | "unicode" 5 | ) 6 | 7 | // isWhitespace will return whether or not the character is 8 | // a whitespace character. 9 | // 10 | // Whitespace is defined as a space or tab. 11 | func isWhitespace(c rune) bool { 12 | return unicode.IsSpace(c) && c != '\n' && c != '\r' 13 | } 14 | 15 | func newWSToken(b []rune) (Token, int, error) { 16 | i := 0 17 | for ; i < len(b); i++ { 18 | if !isWhitespace(b[i]) { 19 | break 20 | } 21 | } 22 | 23 | return newToken(TokenWS, b[:i], NoneType), i, nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package sdkio 4 | 5 | // Copy of Go 1.7 io package's Seeker constants. 6 | const ( 7 | SeekStart = 0 // seek relative to the origin of the file 8 | SeekCurrent = 1 // seek relative to the current offset 9 | SeekEnd = 2 // seek relative to the end 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package sdkio 4 | 5 | import "io" 6 | 7 | // Alias for Go 1.7 io package Seeker constants 8 | const ( 9 | SeekStart = io.SeekStart // seek relative to the origin of the file 10 | SeekCurrent = io.SeekCurrent // seek relative to the current offset 11 | SeekEnd = io.SeekEnd // seek relative to the end 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go: -------------------------------------------------------------------------------- 1 | package sdkrand 2 | 3 | import ( 4 | "math/rand" 5 | "sync" 6 | "time" 7 | ) 8 | 9 | // lockedSource is a thread-safe implementation of rand.Source 10 | type lockedSource struct { 11 | lk sync.Mutex 12 | src rand.Source 13 | } 14 | 15 | func (r *lockedSource) Int63() (n int64) { 16 | r.lk.Lock() 17 | n = r.src.Int63() 18 | r.lk.Unlock() 19 | return 20 | } 21 | 22 | func (r *lockedSource) Seed(seed int64) { 23 | r.lk.Lock() 24 | r.src.Seed(seed) 25 | r.lk.Unlock() 26 | } 27 | 28 | // SeededRand is a new RNG using a thread safe implementation of rand.Source 29 | var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go: -------------------------------------------------------------------------------- 1 | package sdkuri 2 | 3 | import ( 4 | "path" 5 | "strings" 6 | ) 7 | 8 | // PathJoin will join the elements of the path delimited by the "/" 9 | // character. Similar to path.Join with the exception the trailing "/" 10 | // character is preserved if present. 11 | func PathJoin(elems ...string) string { 12 | if len(elems) == 0 { 13 | return "" 14 | } 15 | 16 | hasTrailing := strings.HasSuffix(elems[len(elems)-1], "/") 17 | str := path.Join(elems...) 18 | if hasTrailing && str != "/" { 19 | str += "/" 20 | } 21 | 22 | return str 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/ecs_container.go: -------------------------------------------------------------------------------- 1 | package shareddefaults 2 | 3 | const ( 4 | // ECSCredsProviderEnvVar is an environmental variable key used to 5 | // determine which path needs to be hit. 6 | ECSCredsProviderEnvVar = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" 7 | ) 8 | 9 | // ECSContainerCredentialsURI is the endpoint to retrieve container 10 | // credentials. This can be overriden to test to ensure the credential process 11 | // is behaving correctly. 12 | var ECSContainerCredentialsURI = "http://169.254.170.2" 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go: -------------------------------------------------------------------------------- 1 | package shareddefaults 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | "runtime" 7 | ) 8 | 9 | // SharedCredentialsFilename returns the SDK's default file path 10 | // for the shared credentials file. 11 | // 12 | // Builds the shared config file path based on the OS's platform. 13 | // 14 | // - Linux/Unix: $HOME/.aws/credentials 15 | // - Windows: %USERPROFILE%\.aws\credentials 16 | func SharedCredentialsFilename() string { 17 | return filepath.Join(UserHomeDir(), ".aws", "credentials") 18 | } 19 | 20 | // SharedConfigFilename returns the SDK's default file path for 21 | // the shared config file. 22 | // 23 | // Builds the shared config file path based on the OS's platform. 24 | // 25 | // - Linux/Unix: $HOME/.aws/config 26 | // - Windows: %USERPROFILE%\.aws\config 27 | func SharedConfigFilename() string { 28 | return filepath.Join(UserHomeDir(), ".aws", "config") 29 | } 30 | 31 | // UserHomeDir returns the home directory for the user the process is 32 | // running under. 33 | func UserHomeDir() string { 34 | if runtime.GOOS == "windows" { // Windows 35 | return os.Getenv("USERPROFILE") 36 | } 37 | 38 | // *nix 39 | return os.Getenv("HOME") 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/host.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | // ValidHostLabel returns if the label is a valid RFC 1123 Section 2.1 domain 4 | // host label name. 5 | func ValidHostLabel(label string) bool { 6 | if l := len(label); l == 0 || l > 63 { 7 | return false 8 | } 9 | for _, r := range label { 10 | switch { 11 | case r >= '0' && r <= '9': 12 | case r >= 'A' && r <= 'Z': 13 | case r >= 'a' && r <= 'z': 14 | case r == '-': 15 | default: 16 | return false 17 | } 18 | } 19 | 20 | return true 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/jsonvalue.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | import ( 4 | "encoding/base64" 5 | "encoding/json" 6 | "fmt" 7 | "strconv" 8 | 9 | "github.com/aws/aws-sdk-go/aws" 10 | ) 11 | 12 | // EscapeMode is the mode that should be use for escaping a value 13 | type EscapeMode uint 14 | 15 | // The modes for escaping a value before it is marshaled, and unmarshaled. 16 | const ( 17 | NoEscape EscapeMode = iota 18 | Base64Escape 19 | QuotedEscape 20 | ) 21 | 22 | // EncodeJSONValue marshals the value into a JSON string, and optionally base64 23 | // encodes the string before returning it. 24 | // 25 | // Will panic if the escape mode is unknown. 26 | func EncodeJSONValue(v aws.JSONValue, escape EscapeMode) (string, error) { 27 | b, err := json.Marshal(v) 28 | if err != nil { 29 | return "", err 30 | } 31 | 32 | switch escape { 33 | case NoEscape: 34 | return string(b), nil 35 | case Base64Escape: 36 | return base64.StdEncoding.EncodeToString(b), nil 37 | case QuotedEscape: 38 | return strconv.Quote(string(b)), nil 39 | } 40 | 41 | panic(fmt.Sprintf("EncodeJSONValue called with unknown EscapeMode, %v", escape)) 42 | } 43 | 44 | // DecodeJSONValue will attempt to decode the string input as a JSONValue. 45 | // Optionally decoding base64 the value first before JSON unmarshaling. 46 | // 47 | // Will panic if the escape mode is unknown. 48 | func DecodeJSONValue(v string, escape EscapeMode) (aws.JSONValue, error) { 49 | var b []byte 50 | var err error 51 | 52 | switch escape { 53 | case NoEscape: 54 | b = []byte(v) 55 | case Base64Escape: 56 | b, err = base64.StdEncoding.DecodeString(v) 57 | case QuotedEscape: 58 | var u string 59 | u, err = strconv.Unquote(v) 60 | b = []byte(u) 61 | default: 62 | panic(fmt.Sprintf("DecodeJSONValue called with unknown EscapeMode, %v", escape)) 63 | } 64 | 65 | if err != nil { 66 | return nil, err 67 | } 68 | 69 | m := aws.JSONValue{} 70 | err = json.Unmarshal(b, &m) 71 | if err != nil { 72 | return nil, err 73 | } 74 | 75 | return m, nil 76 | } 77 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go: -------------------------------------------------------------------------------- 1 | // Package query provides serialization of AWS query requests, and responses. 2 | package query 3 | 4 | //go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/query.json build_test.go 5 | 6 | import ( 7 | "net/url" 8 | 9 | "github.com/aws/aws-sdk-go/aws/awserr" 10 | "github.com/aws/aws-sdk-go/aws/request" 11 | "github.com/aws/aws-sdk-go/private/protocol/query/queryutil" 12 | ) 13 | 14 | // BuildHandler is a named request handler for building query protocol requests 15 | var BuildHandler = request.NamedHandler{Name: "awssdk.query.Build", Fn: Build} 16 | 17 | // Build builds a request for an AWS Query service. 18 | func Build(r *request.Request) { 19 | body := url.Values{ 20 | "Action": {r.Operation.Name}, 21 | "Version": {r.ClientInfo.APIVersion}, 22 | } 23 | if err := queryutil.Parse(body, r.Params, false); err != nil { 24 | r.Error = awserr.New("SerializationError", "failed encoding Query request", err) 25 | return 26 | } 27 | 28 | if !r.IsPresigned() { 29 | r.HTTPRequest.Method = "POST" 30 | r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8") 31 | r.SetBufferBody([]byte(body.Encode())) 32 | } else { // This is a pre-signed request 33 | r.HTTPRequest.Method = "GET" 34 | r.HTTPRequest.URL.RawQuery = body.Encode() 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go: -------------------------------------------------------------------------------- 1 | package query 2 | 3 | //go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/query.json unmarshal_test.go 4 | 5 | import ( 6 | "encoding/xml" 7 | 8 | "github.com/aws/aws-sdk-go/aws/awserr" 9 | "github.com/aws/aws-sdk-go/aws/request" 10 | "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" 11 | ) 12 | 13 | // UnmarshalHandler is a named request handler for unmarshaling query protocol requests 14 | var UnmarshalHandler = request.NamedHandler{Name: "awssdk.query.Unmarshal", Fn: Unmarshal} 15 | 16 | // UnmarshalMetaHandler is a named request handler for unmarshaling query protocol request metadata 17 | var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalMeta", Fn: UnmarshalMeta} 18 | 19 | // Unmarshal unmarshals a response for an AWS Query service. 20 | func Unmarshal(r *request.Request) { 21 | defer r.HTTPResponse.Body.Close() 22 | if r.DataFilled() { 23 | decoder := xml.NewDecoder(r.HTTPResponse.Body) 24 | err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result") 25 | if err != nil { 26 | r.Error = awserr.NewRequestFailure( 27 | awserr.New("SerializationError", "failed decoding Query response", err), 28 | r.HTTPResponse.StatusCode, 29 | r.RequestID, 30 | ) 31 | return 32 | } 33 | } 34 | } 35 | 36 | // UnmarshalMeta unmarshals header response values for an AWS Query service. 37 | func UnmarshalMeta(r *request.Request) { 38 | r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid") 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import "reflect" 4 | 5 | // PayloadMember returns the payload field member of i if there is one, or nil. 6 | func PayloadMember(i interface{}) interface{} { 7 | if i == nil { 8 | return nil 9 | } 10 | 11 | v := reflect.ValueOf(i).Elem() 12 | if !v.IsValid() { 13 | return nil 14 | } 15 | if field, ok := v.Type().FieldByName("_"); ok { 16 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 17 | field, _ := v.Type().FieldByName(payloadName) 18 | if field.Tag.Get("type") != "structure" { 19 | return nil 20 | } 21 | 22 | payload := v.FieldByName(payloadName) 23 | if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) { 24 | return payload.Interface() 25 | } 26 | } 27 | } 28 | return nil 29 | } 30 | 31 | // PayloadType returns the type of a payload field member of i if there is one, or "". 32 | func PayloadType(i interface{}) string { 33 | v := reflect.Indirect(reflect.ValueOf(i)) 34 | if !v.IsValid() { 35 | return "" 36 | } 37 | if field, ok := v.Type().FieldByName("_"); ok { 38 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 39 | if member, ok := v.Type().FieldByName(payloadName); ok { 40 | return member.Tag.Get("type") 41 | } 42 | } 43 | } 44 | return "" 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/timestamp.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | import ( 4 | "strconv" 5 | "time" 6 | ) 7 | 8 | // Names of time formats supported by the SDK 9 | const ( 10 | RFC822TimeFormatName = "rfc822" 11 | ISO8601TimeFormatName = "iso8601" 12 | UnixTimeFormatName = "unixTimestamp" 13 | ) 14 | 15 | // Time formats supported by the SDK 16 | const ( 17 | // RFC 7231#section-7.1.1.1 timetamp format. e.g Tue, 29 Apr 2014 18:30:38 GMT 18 | RFC822TimeFormat = "Mon, 2 Jan 2006 15:04:05 GMT" 19 | 20 | // RFC3339 a subset of the ISO8601 timestamp format. e.g 2014-04-29T18:30:38Z 21 | ISO8601TimeFormat = "2006-01-02T15:04:05Z" 22 | ) 23 | 24 | // IsKnownTimestampFormat returns if the timestamp format name 25 | // is know to the SDK's protocols. 26 | func IsKnownTimestampFormat(name string) bool { 27 | switch name { 28 | case RFC822TimeFormatName: 29 | fallthrough 30 | case ISO8601TimeFormatName: 31 | fallthrough 32 | case UnixTimeFormatName: 33 | return true 34 | default: 35 | return false 36 | } 37 | } 38 | 39 | // FormatTime returns a string value of the time. 40 | func FormatTime(name string, t time.Time) string { 41 | t = t.UTC() 42 | 43 | switch name { 44 | case RFC822TimeFormatName: 45 | return t.Format(RFC822TimeFormat) 46 | case ISO8601TimeFormatName: 47 | return t.Format(ISO8601TimeFormat) 48 | case UnixTimeFormatName: 49 | return strconv.FormatInt(t.Unix(), 10) 50 | default: 51 | panic("unknown timestamp format name, " + name) 52 | } 53 | } 54 | 55 | // ParseTime attempts to parse the time given the format. Returns 56 | // the time if it was able to be parsed, and fails otherwise. 57 | func ParseTime(formatName, value string) (time.Time, error) { 58 | switch formatName { 59 | case RFC822TimeFormatName: 60 | return time.Parse(RFC822TimeFormat, value) 61 | case ISO8601TimeFormatName: 62 | return time.Parse(ISO8601TimeFormat, value) 63 | case UnixTimeFormatName: 64 | v, err := strconv.ParseFloat(value, 64) 65 | if err != nil { 66 | return time.Time{}, err 67 | } 68 | return time.Unix(int64(v), 0), nil 69 | default: 70 | panic("unknown timestamp format name, " + formatName) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | import ( 4 | "io" 5 | "io/ioutil" 6 | 7 | "github.com/aws/aws-sdk-go/aws/request" 8 | ) 9 | 10 | // UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body 11 | var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "awssdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody} 12 | 13 | // UnmarshalDiscardBody is a request handler to empty a response's body and closing it. 14 | func UnmarshalDiscardBody(r *request.Request) { 15 | if r.HTTPResponse == nil || r.HTTPResponse.Body == nil { 16 | return 17 | } 18 | 19 | io.Copy(ioutil.Discard, r.HTTPResponse.Body) 20 | r.HTTPResponse.Body.Close() 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/dynamodb/doc_custom.go: -------------------------------------------------------------------------------- 1 | /* 2 | AttributeValue Marshaling and Unmarshaling Helpers 3 | 4 | Utility helpers to marshal and unmarshal AttributeValue to and 5 | from Go types can be found in the dynamodbattribute sub package. This package 6 | provides has specialized functions for the common ways of working with 7 | AttributeValues. Such as map[string]*AttributeValue, []*AttributeValue, and 8 | directly with *AttributeValue. This is helpful for marshaling Go types for API 9 | operations such as PutItem, and unmarshaling Query and Scan APIs' responses. 10 | 11 | See the dynamodbattribute package documentation for more information. 12 | https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/dynamodbattribute/ 13 | 14 | Expression Builders 15 | 16 | The expression package provides utility types and functions to build DynamoDB 17 | expression for type safe construction of API ExpressionAttributeNames, and 18 | ExpressionAttribute Values. 19 | 20 | The package represents the various DynamoDB Expressions as structs named 21 | accordingly. For example, ConditionBuilder represents a DynamoDB Condition 22 | Expression, an UpdateBuilder represents a DynamoDB Update Expression, and so on. 23 | 24 | See the expression package documentation for more information. 25 | https://docs.aws.amazon.com/sdk-for-go/api/service/dynamodb/expression/ 26 | */ 27 | package dynamodb 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go: -------------------------------------------------------------------------------- 1 | package sts 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | func init() { 6 | initRequest = func(r *request.Request) { 7 | switch r.Operation.Name { 8 | case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity: 9 | r.Handlers.Sign.Clear() // these operations are unsigned 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2014 Benedikt Lang 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 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/json.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | // MarshalJSON implements the encoding/json.Marshaler interface. 8 | func (v Version) MarshalJSON() ([]byte, error) { 9 | return json.Marshal(v.String()) 10 | } 11 | 12 | // UnmarshalJSON implements the encoding/json.Unmarshaler interface. 13 | func (v *Version) UnmarshalJSON(data []byte) (err error) { 14 | var versionString string 15 | 16 | if err = json.Unmarshal(data, &versionString); err != nil { 17 | return 18 | } 19 | 20 | *v, err = Parse(versionString) 21 | 22 | return 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/sort.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "sort" 5 | ) 6 | 7 | // Versions represents multiple versions. 8 | type Versions []Version 9 | 10 | // Len returns length of version collection 11 | func (s Versions) Len() int { 12 | return len(s) 13 | } 14 | 15 | // Swap swaps two versions inside the collection by its indices 16 | func (s Versions) Swap(i, j int) { 17 | s[i], s[j] = s[j], s[i] 18 | } 19 | 20 | // Less checks if version at index i is less than version at index j 21 | func (s Versions) Less(i, j int) bool { 22 | return s[i].LT(s[j]) 23 | } 24 | 25 | // Sort sorts a slice of versions 26 | func Sort(versions []Version) { 27 | sort.Sort(Versions(versions)) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/blang/semver/sql.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "database/sql/driver" 5 | "fmt" 6 | ) 7 | 8 | // Scan implements the database/sql.Scanner interface. 9 | func (v *Version) Scan(src interface{}) (err error) { 10 | var str string 11 | switch src := src.(type) { 12 | case string: 13 | str = src 14 | case []byte: 15 | str = string(src) 16 | default: 17 | return fmt.Errorf("Version.Scan: cannot convert %T to string.", src) 18 | } 19 | 20 | if t, err := Parse(str); err == nil { 21 | *v = t 22 | } 23 | 24 | return 25 | } 26 | 27 | // Value implements the database/sql/driver.Valuer interface. 28 | func (v Version) Value() (driver.Value, error) { 29 | return v.String(), nil 30 | } 31 | -------------------------------------------------------------------------------- /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 distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/spew/bypasssafe.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015-2016 Dave Collins 2 | // 3 | // Permission to use, copy, modify, and distribute this software for any 4 | // purpose with or without fee is hereby granted, provided that the above 5 | // copyright notice and this permission notice appear in all copies. 6 | // 7 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | 15 | // NOTE: Due to the following build constraints, this file will only be compiled 16 | // when the code is running on Google App Engine, compiled by GopherJS, or 17 | // "-tags safe" is added to the go build command line. The "disableunsafe" 18 | // tag is deprecated and thus should not be used. 19 | // +build js appengine safe disableunsafe 20 | 21 | package spew 22 | 23 | import "reflect" 24 | 25 | const ( 26 | // UnsafeDisabled is a build-time constant which specifies whether or 27 | // not access to the unsafe package is available. 28 | UnsafeDisabled = true 29 | ) 30 | 31 | // unsafeReflectValue typically converts the passed reflect.Value into a one 32 | // that bypasses the typical safety restrictions preventing access to 33 | // unaddressable and unexported data. However, doing this relies on access to 34 | // the unsafe package. This is a stub version which simply returns the passed 35 | // reflect.Value when the unsafe package is not available. 36 | func unsafeReflectValue(v reflect.Value) reflect.Value { 37 | return v 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/facebookgo/httpcontrol/license: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For httpcontrol software 4 | 5 | Copyright (c) 2015, Facebook, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | * Neither the name Facebook nor the names of its contributors may be used to 18 | endorse or promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /vendor/github.com/facebookgo/httpcontrol/patents: -------------------------------------------------------------------------------- 1 | Additional Grant of Patent Rights Version 2 2 | 3 | "Software" means the httpcontrol software distributed by Facebook, Inc. 4 | 5 | Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software 6 | ("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable 7 | (subject to the termination provision below) license under any Necessary 8 | Claims, to make, have made, use, sell, offer to sell, import, and otherwise 9 | transfer the Software. For avoidance of doubt, no license is granted under 10 | Facebook’s rights in any patent claims that are infringed by (i) modifications 11 | to the Software made by you or any third party or (ii) the Software in 12 | combination with any software or other technology. 13 | 14 | The license granted hereunder will terminate, automatically and without notice, 15 | if you (or any of your subsidiaries, corporate affiliates or agents) initiate 16 | directly or indirectly, or take a direct financial interest in, any Patent 17 | Assertion: (i) against Facebook or any of its subsidiaries or corporate 18 | affiliates, (ii) against any party if such Patent Assertion arises in whole or 19 | in part from any software, technology, product or service of Facebook or any of 20 | its subsidiaries or corporate affiliates, or (iii) against any party relating 21 | to the Software. Notwithstanding the foregoing, if Facebook or any of its 22 | subsidiaries or corporate affiliates files a lawsuit alleging patent 23 | infringement against you in the first instance, and you respond by filing a 24 | patent infringement counterclaim in that lawsuit against that party that is 25 | unrelated to the Software, the license granted hereunder will not terminate 26 | under section (i) of this paragraph due to such counterclaim. 27 | 28 | A "Necessary Claim" is a claim of a patent owned by Facebook that is 29 | necessarily infringed by the Software standing alone. 30 | 31 | A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, 32 | or contributory infringement or inducement to infringe any patent, including a 33 | cross-claim or counterclaim. 34 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file as 2 | # Name or Organization 3 | # The email address is not required for organizations. 4 | 5 | # You can update this list using the following command: 6 | # 7 | # $ git shortlog -se | awk '{print $2 " " $3 " " $4}' 8 | 9 | # Please keep the list sorted. 10 | 11 | Aaron L 12 | Adrien Bustany 13 | Amit Krishnan 14 | Anmol Sethi 15 | Bjørn Erik Pedersen 16 | Bruno Bigras 17 | Caleb Spare 18 | Case Nelson 19 | Chris Howey 20 | Christoffer Buchholz 21 | Daniel Wagner-Hall 22 | Dave Cheney 23 | Evan Phoenix 24 | Francisco Souza 25 | Hari haran 26 | John C Barstow 27 | Kelvin Fo 28 | Ken-ichirou MATSUZAWA 29 | Matt Layher 30 | Nathan Youngman 31 | Nickolai Zeldovich 32 | Patrick 33 | Paul Hammond 34 | Pawel Knap 35 | Pieter Droogendijk 36 | Pursuit92 37 | Riku Voipio 38 | Rob Figueiredo 39 | Rodrigo Chiossi 40 | Slawek Ligus 41 | Soge Zhang 42 | Tiffany Jernigan 43 | Tilak Sharma 44 | Tom Payne 45 | Travis Cline 46 | Tudor Golubenco 47 | Vahe Khachikyan 48 | Yukang 49 | bronze1man 50 | debrando 51 | henrikedwards 52 | 铁哥 53 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 The Go Authors. All rights reserved. 2 | Copyright (c) 2012 fsnotify Authors. All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. 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 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/fen.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 solaris 6 | 7 | package fsnotify 8 | 9 | import ( 10 | "errors" 11 | ) 12 | 13 | // Watcher watches a set of files, delivering events to a channel. 14 | type Watcher struct { 15 | Events chan Event 16 | Errors chan error 17 | } 18 | 19 | // NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. 20 | func NewWatcher() (*Watcher, error) { 21 | return nil, errors.New("FEN based watcher not yet supported for fsnotify\n") 22 | } 23 | 24 | // Close removes all watches and closes the events channel. 25 | func (w *Watcher) Close() error { 26 | return nil 27 | } 28 | 29 | // Add starts watching the named file or directory (non-recursively). 30 | func (w *Watcher) Add(name string) error { 31 | return nil 32 | } 33 | 34 | // Remove stops watching the the named file or directory (non-recursively). 35 | func (w *Watcher) Remove(name string) error { 36 | return nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/fsnotify.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 !plan9 6 | 7 | // Package fsnotify provides a platform-independent interface for file system notifications. 8 | package fsnotify 9 | 10 | import ( 11 | "bytes" 12 | "errors" 13 | "fmt" 14 | ) 15 | 16 | // Event represents a single file system notification. 17 | type Event struct { 18 | Name string // Relative path to the file or directory. 19 | Op Op // File operation that triggered the event. 20 | } 21 | 22 | // Op describes a set of file operations. 23 | type Op uint32 24 | 25 | // These are the generalized file operations that can trigger a notification. 26 | const ( 27 | Create Op = 1 << iota 28 | Write 29 | Remove 30 | Rename 31 | Chmod 32 | ) 33 | 34 | func (op Op) String() string { 35 | // Use a buffer for efficient string concatenation 36 | var buffer bytes.Buffer 37 | 38 | if op&Create == Create { 39 | buffer.WriteString("|CREATE") 40 | } 41 | if op&Remove == Remove { 42 | buffer.WriteString("|REMOVE") 43 | } 44 | if op&Write == Write { 45 | buffer.WriteString("|WRITE") 46 | } 47 | if op&Rename == Rename { 48 | buffer.WriteString("|RENAME") 49 | } 50 | if op&Chmod == Chmod { 51 | buffer.WriteString("|CHMOD") 52 | } 53 | if buffer.Len() == 0 { 54 | return "" 55 | } 56 | return buffer.String()[1:] // Strip leading pipe 57 | } 58 | 59 | // String returns a string representation of the event in the form 60 | // "file: REMOVE|WRITE|..." 61 | func (e Event) String() string { 62 | return fmt.Sprintf("%q: %s", e.Name, e.Op.String()) 63 | } 64 | 65 | // Common errors that can be reported by a watcher 66 | var ErrEventOverflow = errors.New("fsnotify queue overflow") 67 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/open_mode_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd openbsd netbsd dragonfly 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const openMode = unix.O_NONBLOCK | unix.O_RDONLY 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsnotify/fsnotify/open_mode_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | // note: this constant is not defined on BSD 12 | const openMode = unix.O_EVTONLY 13 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/internal/commandinfo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Gary Burd 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package internal // import "github.com/garyburd/redigo/internal" 16 | 17 | import ( 18 | "strings" 19 | ) 20 | 21 | const ( 22 | WatchState = 1 << iota 23 | MultiState 24 | SubscribeState 25 | MonitorState 26 | ) 27 | 28 | type CommandInfo struct { 29 | Set, Clear int 30 | } 31 | 32 | var commandInfos = map[string]CommandInfo{ 33 | "WATCH": {Set: WatchState}, 34 | "UNWATCH": {Clear: WatchState}, 35 | "MULTI": {Set: MultiState}, 36 | "EXEC": {Clear: WatchState | MultiState}, 37 | "DISCARD": {Clear: WatchState | MultiState}, 38 | "PSUBSCRIBE": {Set: SubscribeState}, 39 | "SUBSCRIBE": {Set: SubscribeState}, 40 | "MONITOR": {Set: MonitorState}, 41 | } 42 | 43 | func init() { 44 | for n, ci := range commandInfos { 45 | commandInfos[strings.ToLower(n)] = ci 46 | } 47 | } 48 | 49 | func LookupCommandInfo(commandName string) CommandInfo { 50 | if ci, ok := commandInfos[commandName]; ok { 51 | return ci 52 | } 53 | return commandInfos[strings.ToUpper(commandName)] 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/redis/go16.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return &tls.Config{ 9 | Rand: cfg.Rand, 10 | Time: cfg.Time, 11 | Certificates: cfg.Certificates, 12 | NameToCertificate: cfg.NameToCertificate, 13 | GetCertificate: cfg.GetCertificate, 14 | RootCAs: cfg.RootCAs, 15 | NextProtos: cfg.NextProtos, 16 | ServerName: cfg.ServerName, 17 | ClientAuth: cfg.ClientAuth, 18 | ClientCAs: cfg.ClientCAs, 19 | InsecureSkipVerify: cfg.InsecureSkipVerify, 20 | CipherSuites: cfg.CipherSuites, 21 | PreferServerCipherSuites: cfg.PreferServerCipherSuites, 22 | ClientSessionCache: cfg.ClientSessionCache, 23 | MinVersion: cfg.MinVersion, 24 | MaxVersion: cfg.MaxVersion, 25 | CurvePreferences: cfg.CurvePreferences, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/redis/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.7,!go1.8 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return &tls.Config{ 9 | Rand: cfg.Rand, 10 | Time: cfg.Time, 11 | Certificates: cfg.Certificates, 12 | NameToCertificate: cfg.NameToCertificate, 13 | GetCertificate: cfg.GetCertificate, 14 | RootCAs: cfg.RootCAs, 15 | NextProtos: cfg.NextProtos, 16 | ServerName: cfg.ServerName, 17 | ClientAuth: cfg.ClientAuth, 18 | ClientCAs: cfg.ClientCAs, 19 | InsecureSkipVerify: cfg.InsecureSkipVerify, 20 | CipherSuites: cfg.CipherSuites, 21 | PreferServerCipherSuites: cfg.PreferServerCipherSuites, 22 | ClientSessionCache: cfg.ClientSessionCache, 23 | MinVersion: cfg.MinVersion, 24 | MaxVersion: cfg.MaxVersion, 25 | CurvePreferences: cfg.CurvePreferences, 26 | DynamicRecordSizingDisabled: cfg.DynamicRecordSizingDisabled, 27 | Renegotiation: cfg.Renegotiation, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/garyburd/redigo/redis/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package redis 4 | 5 | import "crypto/tls" 6 | 7 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 8 | return cfg.Clone() 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/gregjones/httpcache/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2012 Greg Jones (greg.jones@gmail.com) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/NOTICE.md: -------------------------------------------------------------------------------- 1 | Copyright © 2014-2018 HashiCorp, Inc. 2 | 3 | This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this project, you can obtain one at http://mozilla.org/MPL/2.0/. 4 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/api/connect.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // Connect can be used to work with endpoints related to Connect, the 4 | // feature for securely connecting services within Consul. 5 | type Connect struct { 6 | c *Client 7 | } 8 | 9 | // Connect returns a handle to the connect-related endpoints 10 | func (c *Client) Connect() *Connect { 11 | return &Connect{c} 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/api/operator.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // Operator can be used to perform low-level operator tasks for Consul. 4 | type Operator struct { 5 | c *Client 6 | } 7 | 8 | // Operator returns a handle to the operator endpoints. 9 | func (c *Client) Operator() *Operator { 10 | return &Operator{c} 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/api/operator_segment.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // SegmentList returns all the available LAN segments. 4 | func (op *Operator) SegmentList(q *QueryOptions) ([]string, *QueryMeta, error) { 5 | var out []string 6 | qm, err := op.c.query("/v1/operator/segment", &out, q) 7 | if err != nil { 8 | return nil, nil, err 9 | } 10 | return out, qm, nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/api/raw.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // Raw can be used to do raw queries against custom endpoints 4 | type Raw struct { 5 | c *Client 6 | } 7 | 8 | // Raw returns a handle to query endpoints 9 | func (c *Client) Raw() *Raw { 10 | return &Raw{c} 11 | } 12 | 13 | // Query is used to do a GET request against an endpoint 14 | // and deserialize the response into an interface using 15 | // standard Consul conventions. 16 | func (raw *Raw) Query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) { 17 | return raw.c.query(endpoint, out, q) 18 | } 19 | 20 | // Write is used to do a PUT request against an endpoint 21 | // and serialize/deserialized using the standard Consul conventions. 22 | func (raw *Raw) Write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) { 23 | return raw.c.write(endpoint, in, out, q) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/api/snapshot.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "io" 5 | ) 6 | 7 | // Snapshot can be used to query the /v1/snapshot endpoint to take snapshots of 8 | // Consul's internal state and restore snapshots for disaster recovery. 9 | type Snapshot struct { 10 | c *Client 11 | } 12 | 13 | // Snapshot returns a handle that exposes the snapshot endpoints. 14 | func (c *Client) Snapshot() *Snapshot { 15 | return &Snapshot{c} 16 | } 17 | 18 | // Save requests a new snapshot and provides an io.ReadCloser with the snapshot 19 | // data to save. If this doesn't return an error, then it's the responsibility 20 | // of the caller to close it. Only a subset of the QueryOptions are supported: 21 | // Datacenter, AllowStale, and Token. 22 | func (s *Snapshot) Save(q *QueryOptions) (io.ReadCloser, *QueryMeta, error) { 23 | r := s.c.newRequest("GET", "/v1/snapshot") 24 | r.setQueryOptions(q) 25 | 26 | rtt, resp, err := requireOK(s.c.doRequest(r)) 27 | if err != nil { 28 | return nil, nil, err 29 | } 30 | 31 | qm := &QueryMeta{} 32 | parseQueryMeta(resp, qm) 33 | qm.RequestTime = rtt 34 | return resp.Body, qm, nil 35 | } 36 | 37 | // Restore streams in an existing snapshot and attempts to restore it. 38 | func (s *Snapshot) Restore(q *WriteOptions, in io.Reader) error { 39 | r := s.c.newRequest("PUT", "/v1/snapshot") 40 | r.body = in 41 | r.setWriteOptions(q) 42 | _, _, err := requireOK(s.c.doRequest(r)) 43 | if err != nil { 44 | return err 45 | } 46 | return nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/api/status.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // Status can be used to query the Status endpoints 4 | type Status struct { 5 | c *Client 6 | } 7 | 8 | // Status returns a handle to the status endpoints 9 | func (c *Client) Status() *Status { 10 | return &Status{c} 11 | } 12 | 13 | // Leader is used to query for a known leader 14 | func (s *Status) Leader() (string, error) { 15 | r := s.c.newRequest("GET", "/v1/status/leader") 16 | _, resp, err := requireOK(s.c.doRequest(r)) 17 | if err != nil { 18 | return "", err 19 | } 20 | defer resp.Body.Close() 21 | 22 | var leader string 23 | if err := decodeBody(resp, &leader); err != nil { 24 | return "", err 25 | } 26 | return leader, nil 27 | } 28 | 29 | // Peers is used to query for a known raft peers 30 | func (s *Status) Peers() ([]string, error) { 31 | r := s.c.newRequest("GET", "/v1/status/peers") 32 | _, resp, err := requireOK(s.c.doRequest(r)) 33 | if err != nil { 34 | return nil, err 35 | } 36 | defer resp.Body.Close() 37 | 38 | var peers []string 39 | if err := decodeBody(resp, &peers); err != nil { 40 | return nil, err 41 | } 42 | return peers, nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/ui-v2/app/styles/components/notice.scss: -------------------------------------------------------------------------------- 1 | @import './notice/index'; 2 | .notice.warning { 3 | @extend %notice-warning; 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/website/LICENSE.md: -------------------------------------------------------------------------------- 1 | # Proprietary License 2 | 3 | This license is temporary while a more official one is drafted. However, 4 | this should make it clear: 5 | 6 | The text contents of this website are MPL 2.0 licensed. 7 | 8 | The design contents of this website are proprietary and may not be reproduced 9 | or reused in any way other than to run the website locally. The license for 10 | the design is owned solely by HashiCorp, Inc. 11 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go: -------------------------------------------------------------------------------- 1 | package cleanhttp 2 | 3 | import ( 4 | "net" 5 | "net/http" 6 | "runtime" 7 | "time" 8 | ) 9 | 10 | // DefaultTransport returns a new http.Transport with similar default values to 11 | // http.DefaultTransport, but with idle connections and keepalives disabled. 12 | func DefaultTransport() *http.Transport { 13 | transport := DefaultPooledTransport() 14 | transport.DisableKeepAlives = true 15 | transport.MaxIdleConnsPerHost = -1 16 | return transport 17 | } 18 | 19 | // DefaultPooledTransport returns a new http.Transport with similar default 20 | // values to http.DefaultTransport. Do not use this for transient transports as 21 | // it can leak file descriptors over time. Only use this for transports that 22 | // will be re-used for the same host(s). 23 | func DefaultPooledTransport() *http.Transport { 24 | transport := &http.Transport{ 25 | Proxy: http.ProxyFromEnvironment, 26 | DialContext: (&net.Dialer{ 27 | Timeout: 30 * time.Second, 28 | KeepAlive: 30 * time.Second, 29 | DualStack: true, 30 | }).DialContext, 31 | MaxIdleConns: 100, 32 | IdleConnTimeout: 90 * time.Second, 33 | TLSHandshakeTimeout: 10 * time.Second, 34 | ExpectContinueTimeout: 1 * time.Second, 35 | MaxIdleConnsPerHost: runtime.GOMAXPROCS(0) + 1, 36 | } 37 | return transport 38 | } 39 | 40 | // DefaultClient returns a new http.Client with similar default values to 41 | // http.Client, but with a non-shared Transport, idle connections disabled, and 42 | // keepalives disabled. 43 | func DefaultClient() *http.Client { 44 | return &http.Client{ 45 | Transport: DefaultTransport(), 46 | } 47 | } 48 | 49 | // DefaultPooledClient returns a new http.Client with similar default values to 50 | // http.Client, but with a shared Transport. Do not use this function for 51 | // transient clients as it can leak file descriptors over time. Only use this 52 | // for clients that will be re-used for the same host(s). 53 | func DefaultPooledClient() *http.Client { 54 | return &http.Client{ 55 | Transport: DefaultPooledTransport(), 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/doc.go: -------------------------------------------------------------------------------- 1 | // Package cleanhttp offers convenience utilities for acquiring "clean" 2 | // http.Transport and http.Client structs. 3 | // 4 | // Values set on http.DefaultClient and http.DefaultTransport affect all 5 | // callers. This can have detrimental effects, esepcially in TLS contexts, 6 | // where client or root certificates set to talk to multiple endpoints can end 7 | // up displacing each other, leading to hard-to-debug issues. This package 8 | // provides non-shared http.Client and http.Transport structs to ensure that 9 | // the configuration will not be overwritten by other parts of the application 10 | // or dependencies. 11 | // 12 | // The DefaultClient and DefaultTransport functions disable idle connections 13 | // and keepalives. Without ensuring that idle connections are closed before 14 | // garbage collection, short-term clients/transports can leak file descriptors, 15 | // eventually leading to "too many open files" errors. If you will be 16 | // connecting to the same hosts repeatedly from the same client, you can use 17 | // DefaultPooledClient to receive a client that has connection pooling 18 | // semantics similar to http.DefaultClient. 19 | // 20 | package cleanhttp 21 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/handlers.go: -------------------------------------------------------------------------------- 1 | package cleanhttp 2 | 3 | import ( 4 | "net/http" 5 | "strings" 6 | "unicode" 7 | ) 8 | 9 | // HandlerInput provides input options to cleanhttp's handlers 10 | type HandlerInput struct { 11 | ErrStatus int 12 | } 13 | 14 | // PrintablePathCheckHandler is a middleware that ensures the request path 15 | // contains only printable runes. 16 | func PrintablePathCheckHandler(next http.Handler, input *HandlerInput) http.Handler { 17 | // Nil-check on input to make it optional 18 | if input == nil { 19 | input = &HandlerInput{ 20 | ErrStatus: http.StatusBadRequest, 21 | } 22 | } 23 | 24 | // Default to http.StatusBadRequest on error 25 | if input.ErrStatus == 0 { 26 | input.ErrStatus = http.StatusBadRequest 27 | } 28 | 29 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 30 | // Check URL path for non-printable characters 31 | idx := strings.IndexFunc(r.URL.Path, func(c rune) bool { 32 | return !unicode.IsPrint(c) 33 | }) 34 | 35 | if idx != -1 { 36 | w.WriteHeader(input.ErrStatus) 37 | return 38 | } 39 | 40 | next.ServeHTTP(w, r) 41 | return 42 | }) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-rootcerts/doc.go: -------------------------------------------------------------------------------- 1 | // Package rootcerts contains functions to aid in loading CA certificates for 2 | // TLS connections. 3 | // 4 | // In addition, its default behavior on Darwin works around an open issue [1] 5 | // in Go's crypto/x509 that prevents certicates from being loaded from the 6 | // System or Login keychains. 7 | // 8 | // [1] https://github.com/golang/go/issues/14514 9 | package rootcerts 10 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-rootcerts/rootcerts_base.go: -------------------------------------------------------------------------------- 1 | // +build !darwin 2 | 3 | package rootcerts 4 | 5 | import "crypto/x509" 6 | 7 | // LoadSystemCAs does nothing on non-Darwin systems. We return nil so that 8 | // default behavior of standard TLS config libraries is triggered, which is to 9 | // load system certs. 10 | func LoadSystemCAs() (*x509.CertPool, error) { 11 | return nil, nil 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-rootcerts/rootcerts_darwin.go: -------------------------------------------------------------------------------- 1 | package rootcerts 2 | 3 | import ( 4 | "crypto/x509" 5 | "os/exec" 6 | "path" 7 | 8 | "github.com/mitchellh/go-homedir" 9 | ) 10 | 11 | // LoadSystemCAs has special behavior on Darwin systems to work around 12 | func LoadSystemCAs() (*x509.CertPool, error) { 13 | pool := x509.NewCertPool() 14 | 15 | for _, keychain := range certKeychains() { 16 | err := addCertsFromKeychain(pool, keychain) 17 | if err != nil { 18 | return nil, err 19 | } 20 | } 21 | 22 | return pool, nil 23 | } 24 | 25 | func addCertsFromKeychain(pool *x509.CertPool, keychain string) error { 26 | cmd := exec.Command("/usr/bin/security", "find-certificate", "-a", "-p", keychain) 27 | data, err := cmd.Output() 28 | if err != nil { 29 | return err 30 | } 31 | 32 | pool.AppendCertsFromPEM(data) 33 | 34 | return nil 35 | } 36 | 37 | func certKeychains() []string { 38 | keychains := []string{ 39 | "/System/Library/Keychains/SystemRootCertificates.keychain", 40 | "/Library/Keychains/System.keychain", 41 | } 42 | home, err := homedir.Dir() 43 | if err == nil { 44 | loginKeychain := path.Join(home, "Library", "Keychains", "login.keychain") 45 | keychains = append(keychains, loginKeychain) 46 | } 47 | return keychains 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-rootcerts/test-fixtures/capath-with-symlinks/securetrust.pem: -------------------------------------------------------------------------------- 1 | ../capath/securetrust.pem -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-rootcerts/test-fixtures/capath-with-symlinks/thawte.pem: -------------------------------------------------------------------------------- 1 | ../capath/thawte.pem -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/serf/ops-misc/debian/copyright: -------------------------------------------------------------------------------- 1 | Name: serf 2 | Copyright: Hashicorp 2013 3 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/serf/website/source/LICENSE: -------------------------------------------------------------------------------- 1 | # Proprietary License 2 | 3 | This license is temporary while a more official one is drafted. However, 4 | this should make it clear: 5 | 6 | * The text contents of this website are MPL 2.0 licensed. 7 | 8 | * The design contents of this website are proprietary and may not be reproduced 9 | or reused in any way other than to run the Serf website locally. The license 10 | for the design is owned solely by HashiCorp, Inc. 11 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 James Saryerwinnie 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 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/api.go: -------------------------------------------------------------------------------- 1 | package jmespath 2 | 3 | import "strconv" 4 | 5 | // JmesPath is the epresentation of a compiled JMES path query. A JmesPath is 6 | // safe for concurrent use by multiple goroutines. 7 | type JMESPath struct { 8 | ast ASTNode 9 | intr *treeInterpreter 10 | } 11 | 12 | // Compile parses a JMESPath expression and returns, if successful, a JMESPath 13 | // object that can be used to match against data. 14 | func Compile(expression string) (*JMESPath, error) { 15 | parser := NewParser() 16 | ast, err := parser.Parse(expression) 17 | if err != nil { 18 | return nil, err 19 | } 20 | jmespath := &JMESPath{ast: ast, intr: newInterpreter()} 21 | return jmespath, nil 22 | } 23 | 24 | // MustCompile is like Compile but panics if the expression cannot be parsed. 25 | // It simplifies safe initialization of global variables holding compiled 26 | // JMESPaths. 27 | func MustCompile(expression string) *JMESPath { 28 | jmespath, err := Compile(expression) 29 | if err != nil { 30 | panic(`jmespath: Compile(` + strconv.Quote(expression) + `): ` + err.Error()) 31 | } 32 | return jmespath 33 | } 34 | 35 | // Search evaluates a JMESPath expression against input data and returns the result. 36 | func (jp *JMESPath) Search(data interface{}) (interface{}, error) { 37 | return jp.intr.Execute(jp.ast, data) 38 | } 39 | 40 | // Search evaluates a JMESPath expression against input data and returns the result. 41 | func Search(expression string, data interface{}) (interface{}, error) { 42 | intr := newInterpreter() 43 | parser := NewParser() 44 | ast, err := parser.Parse(expression) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return intr.Execute(ast, data) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/astnodetype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type astNodeType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _astNodeType_name = "ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection" 8 | 9 | var _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307} 10 | 11 | func (i astNodeType) String() string { 12 | if i < 0 || i >= astNodeType(len(_astNodeType_index)-1) { 13 | return fmt.Sprintf("astNodeType(%d)", i) 14 | } 15 | return _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/toktype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=tokType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF" 8 | 9 | var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214} 10 | 11 | func (i tokType) String() string { 12 | if i < 0 || i >= tokType(len(_tokType_index)-1) { 13 | return fmt.Sprintf("tokType(%d)", i) 14 | } 15 | return _tokType_name[_tokType_index[i]:_tokType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/launchdarkly/eventsource/check_redirect.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package eventsource 4 | 5 | import ( 6 | "errors" 7 | "net/http" 8 | ) 9 | 10 | func setCheckRedirect(c *http.Client) { 11 | c.CheckRedirect = checkRedirect 12 | } 13 | 14 | // Go's http package doesn't copy headers across when it encounters 15 | // redirects so we need to do that manually. 16 | func checkRedirect(req *http.Request, via []*http.Request) error { 17 | if len(via) >= 10 { 18 | return errors.New("stopped after 10 redirects") 19 | } 20 | for k, vv := range via[0].Header { 21 | for _, v := range vv { 22 | req.Header.Add(k, v) 23 | } 24 | } 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/launchdarkly/eventsource/check_redirect_go1.8.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package eventsource 4 | 5 | import "net/http" 6 | 7 | // On go1.8 we don't need to do anything because it will copy headers on redirects 8 | func setCheckRedirect(c *http.Client) { 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/launchdarkly/eventsource/encoder.go: -------------------------------------------------------------------------------- 1 | package eventsource 2 | 3 | import ( 4 | "compress/gzip" 5 | "fmt" 6 | "io" 7 | "strings" 8 | ) 9 | 10 | var ( 11 | encFields = []struct { 12 | prefix string 13 | value func(Event) string 14 | }{ 15 | {"id: ", Event.Id}, 16 | {"event: ", Event.Event}, 17 | {"data: ", Event.Data}, 18 | } 19 | ) 20 | 21 | // An Encoder is capable of writing Events to a stream. Optionally 22 | // Events can be gzip compressed in this process. 23 | type Encoder struct { 24 | w io.Writer 25 | compressed bool 26 | } 27 | 28 | // NewEncoder returns an Encoder for a given io.Writer. 29 | // When compressed is set to true, a gzip writer will be 30 | // created. 31 | func NewEncoder(w io.Writer, compressed bool) *Encoder { 32 | if compressed { 33 | return &Encoder{w: gzip.NewWriter(w), compressed: true} 34 | } 35 | return &Encoder{w: w} 36 | } 37 | 38 | // Encode writes an event or comment in the format specified by the 39 | // server-sent events protocol. 40 | func (enc *Encoder) Encode(ec eventOrComment) error { 41 | switch item := ec.(type) { 42 | case Event: 43 | for _, field := range encFields { 44 | prefix, value := field.prefix, field.value(item) 45 | if len(value) == 0 { 46 | continue 47 | } 48 | value = strings.Replace(value, "\n", "\n"+prefix, -1) 49 | if _, err := io.WriteString(enc.w, prefix+value+"\n"); err != nil { 50 | return fmt.Errorf("eventsource encode: %v", err) 51 | } 52 | } 53 | if _, err := io.WriteString(enc.w, "\n"); err != nil { 54 | return fmt.Errorf("eventsource encode: %v", err) 55 | } 56 | case comment: 57 | line := ":" + item.value + "\n" 58 | if _, err := io.WriteString(enc.w, line); err != nil { 59 | return fmt.Errorf("eventsource encode: %v", err) 60 | } 61 | default: 62 | return fmt.Errorf("unexpected parameter to Encode: %v", ec) 63 | } 64 | if enc.compressed { 65 | return enc.w.(*gzip.Writer).Flush() 66 | } 67 | return nil 68 | } 69 | -------------------------------------------------------------------------------- /vendor/github.com/launchdarkly/eventsource/interface.go: -------------------------------------------------------------------------------- 1 | // Package eventsource implements a client and server to allow streaming data one-way over a HTTP connection 2 | // using the Server-Sent Events API http://dev.w3.org/html5/eventsource/ 3 | // 4 | // The client and server respect the Last-Event-ID header. 5 | // If the Repository interface is implemented on the server, events can be replayed in case of a network disconnection. 6 | package eventsource 7 | 8 | // Any event received by the client or sent by the server will implement this interface 9 | type Event interface { 10 | // Id is an identifier that can be used to allow a client to replay 11 | // missed Events by returning the Last-Event-Id header. 12 | // Return empty string if not required. 13 | Id() string 14 | // The name of the event. Return empty string if not required. 15 | Event() string 16 | // The payload of the event. 17 | Data() string 18 | } 19 | 20 | // If history is required, this interface will allow clients to reply previous events through the server. 21 | // Both methods can be called from different goroutines concurrently, so you must make sure they are go-routine safe. 22 | type Repository interface { 23 | // Gets the Events which should follow on from the specified channel and event id. 24 | Replay(channel, id string) chan Event 25 | } 26 | 27 | type Logger interface { 28 | Println(...interface{}) 29 | Printf(string, ...interface{}) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/launchdarkly/eventsource/normalise.go: -------------------------------------------------------------------------------- 1 | package eventsource 2 | 3 | import ( 4 | "io" 5 | ) 6 | 7 | // A reader which normalises line endings 8 | // "/r" and "/r/n" are converted to "/n" 9 | type normaliser struct { 10 | r io.Reader 11 | lastChar byte 12 | } 13 | 14 | func newNormaliser(r io.Reader) *normaliser { 15 | return &normaliser{r: r} 16 | } 17 | 18 | func (norm *normaliser) Read(p []byte) (n int, err error) { 19 | n, err = norm.r.Read(p) 20 | for i := 0; i < n; i++ { 21 | switch { 22 | case p[i] == '\n' && norm.lastChar == '\r': 23 | copy(p[i:n], p[i+1:]) 24 | norm.lastChar = p[i] 25 | n-- 26 | i-- 27 | case p[i] == '\r': 28 | norm.lastChar = p[i] 29 | p[i] = '\n' 30 | default: 31 | norm.lastChar = p[i] 32 | } 33 | } 34 | return 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/launchdarkly/eventsource/repository.go: -------------------------------------------------------------------------------- 1 | package eventsource 2 | 3 | import ( 4 | "sort" 5 | "sync" 6 | ) 7 | 8 | // Example repository that uses a slice as storage for past events. 9 | type SliceRepository struct { 10 | events map[string][]Event 11 | lock *sync.RWMutex 12 | } 13 | 14 | func NewSliceRepository() *SliceRepository { 15 | return &SliceRepository{ 16 | events: make(map[string][]Event), 17 | lock: &sync.RWMutex{}, 18 | } 19 | } 20 | 21 | func (repo SliceRepository) indexOfEvent(channel, id string) int { 22 | return sort.Search(len(repo.events[channel]), func(i int) bool { 23 | return repo.events[channel][i].Id() >= id 24 | }) 25 | } 26 | 27 | func (repo SliceRepository) Replay(channel, id string) (out chan Event) { 28 | out = make(chan Event) 29 | go func() { 30 | defer close(out) 31 | repo.lock.RLock() 32 | defer repo.lock.RUnlock() 33 | events := repo.events[channel][repo.indexOfEvent(channel, id):] 34 | for i := range events { 35 | out <- events[i] 36 | } 37 | }() 38 | return 39 | } 40 | 41 | func (repo *SliceRepository) Add(channel string, event Event) { 42 | repo.lock.Lock() 43 | defer repo.lock.Unlock() 44 | i := repo.indexOfEvent(channel, event.Id()) 45 | if i < len(repo.events[channel]) && repo.events[channel][i].Id() == event.Id() { 46 | repo.events[channel][i] = event 47 | } else { 48 | repo.events[channel] = append(repo.events[channel][:i], append([]Event{event}, repo.events[channel][i:]...)...) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/go-homedir/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 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 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 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 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/error.go: -------------------------------------------------------------------------------- 1 | package mapstructure 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "sort" 7 | "strings" 8 | ) 9 | 10 | // Error implements the error interface and can represents multiple 11 | // errors that occur in the course of a single decode. 12 | type Error struct { 13 | Errors []string 14 | } 15 | 16 | func (e *Error) Error() string { 17 | points := make([]string, len(e.Errors)) 18 | for i, err := range e.Errors { 19 | points[i] = fmt.Sprintf("* %s", err) 20 | } 21 | 22 | sort.Strings(points) 23 | return fmt.Sprintf( 24 | "%d error(s) decoding:\n\n%s", 25 | len(e.Errors), strings.Join(points, "\n")) 26 | } 27 | 28 | // WrappedErrors implements the errwrap.Wrapper interface to make this 29 | // return value more useful with the errwrap and go-multierror libraries. 30 | func (e *Error) WrappedErrors() []error { 31 | if e == nil { 32 | return nil 33 | } 34 | 35 | result := make([]error, len(e.Errors)) 36 | for i, e := range e.Errors { 37 | result[i] = errors.New(e) 38 | } 39 | 40 | return result 41 | } 42 | 43 | func appendErrors(errors []string, err error) []string { 44 | switch e := err.(type) { 45 | case *Error: 46 | return append(errors, e.Errors...) 47 | default: 48 | return append(errors, e.Error()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/patrickmn/go-cache/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | This is a list of people who have contributed code to go-cache. They, or their 2 | employers, are the copyright holders of the contributed code. Contributed code 3 | is subject to the license restrictions listed in LICENSE (as they were when the 4 | code was contributed.) 5 | 6 | Dustin Sallings 7 | Jason Mooberry 8 | Sergey Shepelev 9 | Alex Edwards 10 | -------------------------------------------------------------------------------- /vendor/github.com/patrickmn/go-cache/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2017 Patrick Mylund Nielsen and the go-cache contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/pmezard/go-difflib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Patrick Mezard 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | The names of its contributors may not be used to endorse or promote 14 | products derived from this software without specific prior written 15 | permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 18 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell 2 | 3 | Please consider promoting this project if you find it useful. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 21 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 22 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/doc.go: -------------------------------------------------------------------------------- 1 | // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. 2 | // 3 | // Example Usage 4 | // 5 | // The following is a complete example using assert in a standard test function: 6 | // import ( 7 | // "testing" 8 | // "github.com/stretchr/testify/assert" 9 | // ) 10 | // 11 | // func TestSomething(t *testing.T) { 12 | // 13 | // var a string = "Hello" 14 | // var b string = "Hello" 15 | // 16 | // assert.Equal(t, a, b, "The two words should be the same.") 17 | // 18 | // } 19 | // 20 | // if you assert many times, use the format below: 21 | // 22 | // import ( 23 | // "testing" 24 | // "github.com/stretchr/testify/assert" 25 | // ) 26 | // 27 | // func TestSomething(t *testing.T) { 28 | // assert := assert.New(t) 29 | // 30 | // var a string = "Hello" 31 | // var b string = "Hello" 32 | // 33 | // assert.Equal(a, b, "The two words should be the same.") 34 | // } 35 | // 36 | // Assertions 37 | // 38 | // Assertions allow you to easily write test code, and are global funcs in the `assert` package. 39 | // All assertion functions take, as the first argument, the `*testing.T` object provided by the 40 | // testing framework. This allows the assertion funcs to write the failings and other details to 41 | // the correct place. 42 | // 43 | // Every assertion function also takes an optional string message as the final argument, 44 | // allowing custom error messages to be appended to the message the assertion method outputs. 45 | package assert 46 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | type tHelper interface { 10 | Helper() 11 | } 12 | 13 | // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful 14 | // for table driven tests. 15 | type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) 16 | 17 | // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful 18 | // for table driven tests. 19 | type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) 20 | 21 | // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful 22 | // for table driven tests. 23 | type BoolAssertionFunc func(TestingT, bool, ...interface{}) 24 | 25 | // ValuesAssertionFunc is a common function prototype when validating an error value. Can be useful 26 | // for table driven tests. 27 | type ErrorAssertionFunc func(TestingT, error, ...interface{}) 28 | 29 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl -include-format-funcs 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /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/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /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_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 calls for 386, Linux 11 | // 12 | 13 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 14 | // instead of the glibc-specific "CALL 0x10(GS)". 15 | #define INVOKE_SYSCALL INT $0x80 16 | 17 | // Just jump to package syscall's implementation for all these functions. 18 | // The runtime may know about them. 19 | 20 | TEXT ·Syscall(SB),NOSPLIT,$0-28 21 | JMP syscall·Syscall(SB) 22 | 23 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 24 | JMP syscall·Syscall6(SB) 25 | 26 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 27 | CALL runtime·entersyscall(SB) 28 | MOVL trap+0(FP), AX // syscall entry 29 | MOVL a1+4(FP), BX 30 | MOVL a2+8(FP), CX 31 | MOVL a3+12(FP), DX 32 | MOVL $0, SI 33 | MOVL $0, DI 34 | INVOKE_SYSCALL 35 | MOVL AX, r1+16(FP) 36 | MOVL DX, r2+20(FP) 37 | CALL 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 | MOVL trap+0(FP), AX // syscall entry 48 | MOVL a1+4(FP), BX 49 | MOVL a2+8(FP), CX 50 | MOVL a3+12(FP), DX 51 | MOVL $0, SI 52 | MOVL $0, DI 53 | INVOKE_SYSCALL 54 | MOVL AX, r1+16(FP) 55 | MOVL DX, r2+20(FP) 56 | RET 57 | 58 | TEXT ·socketcall(SB),NOSPLIT,$0-36 59 | JMP syscall·socketcall(SB) 60 | 61 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 62 | JMP syscall·rawsocketcall(SB) 63 | 64 | TEXT ·seek(SB),NOSPLIT,$0-28 65 | JMP syscall·seek(SB) 66 | -------------------------------------------------------------------------------- /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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /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_linux.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 by the Linux kernel and glibc. 7 | // 8 | // The information below is extracted and adapted from bits/sysmacros.h in the 9 | // glibc sources: 10 | // 11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's 12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major 13 | // number and m is a hex digit of the minor number. This is backward compatible 14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also 15 | // backward compatible with the Linux kernel, which for some architectures uses 16 | // 32-bit dev_t, encoded as mmmM MMmm. 17 | 18 | package unix 19 | 20 | // Major returns the major component of a Linux device number. 21 | func Major(dev uint64) uint32 { 22 | major := uint32((dev & 0x00000000000fff00) >> 8) 23 | major |= uint32((dev & 0xfffff00000000000) >> 32) 24 | return major 25 | } 26 | 27 | // Minor returns the minor component of a Linux device number. 28 | func Minor(dev uint64) uint32 { 29 | minor := uint32((dev & 0x00000000000000ff) >> 0) 30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12) 31 | return minor 32 | } 33 | 34 | // Mkdev returns a Linux device number generated from the given major and minor 35 | // components. 36 | func Mkdev(major, minor uint32) uint64 { 37 | dev := (uint64(major) & 0x00000fff) << 8 38 | dev |= (uint64(major) & 0xfffff000) << 32 39 | dev |= (uint64(minor) & 0x000000ff) << 0 40 | dev |= (uint64(minor) & 0xffffff00) << 12 41 | return dev 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 16 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 26 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 27 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 28 | if errno == 0 { 29 | return nil 30 | } 31 | return errno 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | // +build !aix 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret 25 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 26 | { 27 | struct ret r; 28 | 29 | errno = 0; 30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 31 | r.err = errno; 32 | return r; 33 | } 34 | 35 | uintptr_t 36 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 37 | { 38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ioctl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. 12 | // 13 | // To change fd's window size, the req argument should be TIOCSWINSZ. 14 | func IoctlSetWinsize(fd int, req uint, value *Winsize) error { 15 | // TODO: if we get the chance, remove the req parameter and 16 | // hardcode TIOCSWINSZ. 17 | err := ioctlSetWinsize(fd, req, value) 18 | runtime.KeepAlive(value) 19 | return err 20 | } 21 | 22 | // IoctlSetTermios performs an ioctl on fd with a *Termios. 23 | // 24 | // The req value will usually be TCSETA or TIOCSETA. 25 | func IoctlSetTermios(fd int, req uint, value *Termios) error { 26 | // TODO: if we get the chance, remove the req parameter. 27 | err := ioctlSetTermios(fd, req, value) 28 | runtime.KeepAlive(value) 29 | return err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.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 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc64 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: sec, Nsec: nsec} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int64(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_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,darwin 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 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) 23 | func Gettimeofday(tv *Timeval) (err error) { 24 | // The tv passed to gettimeofday must be non-nil 25 | // but is otherwise unused. The answers come back 26 | // in the two registers. 27 | sec, usec, err := gettimeofday(tv) 28 | tv.Sec = int32(sec) 29 | tv.Usec = int32(usec) 30 | return err 31 | } 32 | 33 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 34 | k.Ident = uint32(fd) 35 | k.Filter = int16(mode) 36 | k.Flags = uint16(flags) 37 | } 38 | 39 | func (iov *Iovec) SetLen(length int) { 40 | iov.Len = uint32(length) 41 | } 42 | 43 | func (msghdr *Msghdr) SetControllen(length int) { 44 | msghdr.Controllen = uint32(length) 45 | } 46 | 47 | func (cmsg *Cmsghdr) SetLen(length int) { 48 | cmsg.Len = uint32(length) 49 | } 50 | 51 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 52 | var length = uint64(count) 53 | 54 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 55 | 56 | written = int(length) 57 | 58 | if e1 != 0 { 59 | err = e1 60 | } 61 | return 62 | } 63 | 64 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 65 | 66 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 67 | // of darwin/386 the syscall is called sysctl instead of __sysctl. 68 | const SYS___SYSCTL = SYS_SYSCTL 69 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_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,darwin 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: int32(usec)} 20 | } 21 | 22 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 23 | func Gettimeofday(tv *Timeval) (err error) { 24 | // The tv passed to gettimeofday must be non-nil 25 | // but is otherwise unused. The answers come back 26 | // in the two registers. 27 | sec, usec, err := gettimeofday(tv) 28 | tv.Sec = sec 29 | tv.Usec = usec 30 | return err 31 | } 32 | 33 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 34 | k.Ident = uint64(fd) 35 | k.Filter = int16(mode) 36 | k.Flags = uint16(flags) 37 | } 38 | 39 | func (iov *Iovec) SetLen(length int) { 40 | iov.Len = uint64(length) 41 | } 42 | 43 | func (msghdr *Msghdr) SetControllen(length int) { 44 | msghdr.Controllen = uint32(length) 45 | } 46 | 47 | func (cmsg *Cmsghdr) SetLen(length int) { 48 | cmsg.Len = uint32(length) 49 | } 50 | 51 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 52 | var length = uint64(count) 53 | 54 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 55 | 56 | written = int(length) 57 | 58 | if e1 != 0 { 59 | err = e1 60 | } 61 | return 62 | } 63 | 64 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 65 | 66 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 67 | // of darwin/amd64 the syscall is called sysctl instead of __sysctl. 68 | const SYS___SYSCTL = SYS_SYSCTL 69 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func setTimespec(sec, nsec int64) Timespec { 13 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 14 | } 15 | 16 | func setTimeval(sec, usec int64) Timeval { 17 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 18 | } 19 | 20 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) 21 | func Gettimeofday(tv *Timeval) (err error) { 22 | // The tv passed to gettimeofday must be non-nil 23 | // but is otherwise unused. The answers come back 24 | // in the two registers. 25 | sec, usec, err := gettimeofday(tv) 26 | tv.Sec = int32(sec) 27 | tv.Usec = int32(usec) 28 | return err 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint32(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint32(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var length = uint64(count) 51 | 52 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 53 | 54 | written = int(length) 55 | 56 | if e1 != 0 { 57 | err = e1 58 | } 59 | return 60 | } 61 | 62 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 63 | 64 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 65 | // of darwin/arm the syscall is called sysctl instead of __sysctl. 66 | const SYS___SYSCTL = SYS_SYSCTL 67 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.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 arm64,darwin 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: int32(usec)} 20 | } 21 | 22 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 23 | func Gettimeofday(tv *Timeval) (err error) { 24 | // The tv passed to gettimeofday must be non-nil 25 | // but is otherwise unused. The answers come back 26 | // in the two registers. 27 | sec, usec, err := gettimeofday(tv) 28 | tv.Sec = sec 29 | tv.Usec = usec 30 | return err 31 | } 32 | 33 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 34 | k.Ident = uint64(fd) 35 | k.Filter = int16(mode) 36 | k.Flags = uint16(flags) 37 | } 38 | 39 | func (iov *Iovec) SetLen(length int) { 40 | iov.Len = uint64(length) 41 | } 42 | 43 | func (msghdr *Msghdr) SetControllen(length int) { 44 | msghdr.Controllen = uint32(length) 45 | } 46 | 47 | func (cmsg *Cmsghdr) SetLen(length int) { 48 | cmsg.Len = uint32(length) 49 | } 50 | 51 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 52 | var length = uint64(count) 53 | 54 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 55 | 56 | written = int(length) 57 | 58 | if e1 != 0 { 59 | err = e1 60 | } 61 | return 62 | } 63 | 64 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 65 | 66 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 67 | // of darwin/arm64 the syscall is called sysctl instead of __sysctl. 68 | const SYS___SYSCTL = SYS_SYSCTL 69 | -------------------------------------------------------------------------------- /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/sys/unix/zptracemips_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(mips, mips64). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build mips mips64 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsMips is the registers used by mips binaries. 11 | type PtraceRegsMips struct { 12 | Regs [32]uint64 13 | Lo uint64 14 | Hi uint64 15 | Epc uint64 16 | Badvaddr uint64 17 | Status uint64 18 | Cause uint64 19 | } 20 | 21 | // PtraceGetRegsMips fetches the registers used by mips binaries. 22 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 23 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 24 | } 25 | 26 | // PtraceSetRegsMips sets the registers used by mips binaries. 27 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 28 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 29 | } 30 | 31 | // PtraceRegsMips64 is the registers used by mips64 binaries. 32 | type PtraceRegsMips64 struct { 33 | Regs [32]uint64 34 | Lo uint64 35 | Hi uint64 36 | Epc uint64 37 | Badvaddr uint64 38 | Status uint64 39 | Cause uint64 40 | } 41 | 42 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 43 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 44 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 45 | } 46 | 47 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 48 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 49 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracemipsle_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(mipsle, mips64le). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build mipsle mips64le 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsMipsle is the registers used by mipsle binaries. 11 | type PtraceRegsMipsle struct { 12 | Regs [32]uint64 13 | Lo uint64 14 | Hi uint64 15 | Epc uint64 16 | Badvaddr uint64 17 | Status uint64 18 | Cause uint64 19 | } 20 | 21 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. 22 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { 23 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 24 | } 25 | 26 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries. 27 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { 28 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 29 | } 30 | 31 | // PtraceRegsMips64le is the registers used by mips64le binaries. 32 | type PtraceRegsMips64le struct { 33 | Regs [32]uint64 34 | Lo uint64 35 | Hi uint64 36 | Epc uint64 37 | Badvaddr uint64 38 | Status uint64 39 | Cause uint64 40 | } 41 | 42 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. 43 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { 44 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 45 | } 46 | 47 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries. 48 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { 49 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/LICENSE.libyaml: -------------------------------------------------------------------------------- 1 | The following files were ported to Go from C files of libyaml, and thus 2 | are still covered by their original copyright and license: 3 | 4 | apic.go 5 | emitterc.go 6 | parserc.go 7 | readerc.go 8 | scannerc.go 9 | writerc.go 10 | yamlh.go 11 | yamlprivateh.go 12 | 13 | Copyright (c) 2006 Kirill Simonov 14 | 15 | Permission is hereby granted, free of charge, to any person obtaining a copy of 16 | this software and associated documentation files (the "Software"), to deal in 17 | the Software without restriction, including without limitation the rights to 18 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 19 | of the Software, and to permit persons to whom the Software is furnished to do 20 | so, subject to the following conditions: 21 | 22 | The above copyright notice and this permission notice shall be included in all 23 | copies or substantial portions of the Software. 24 | 25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 31 | SOFTWARE. 32 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /versioned_data.go: -------------------------------------------------------------------------------- 1 | package ldclient 2 | 3 | // VersionedData is a common interface for string-keyed, versioned objects such as feature flags. 4 | type VersionedData interface { 5 | // GetKey returns the string key for this object. 6 | GetKey() string 7 | // GetVersion returns the version number for this object. 8 | GetVersion() int 9 | // IsDeleted returns whether or not this object has been deleted. 10 | IsDeleted() bool 11 | } 12 | 13 | // VersionedDataKind describes a kind of VersionedData objects that may exist in a store. 14 | type VersionedDataKind interface { 15 | // GetNamespace returns a short string that serves as the unique name for the collection of these objects, e.g. "features". 16 | GetNamespace() string 17 | // GetDefaultItem return a pointer to a newly created null value of this object type. This is used for JSON unmarshalling. 18 | GetDefaultItem() interface{} 19 | // MakeDeletedItem returns a value of this object type with the specified key and version, and Deleted=true. 20 | MakeDeletedItem(key string, version int) VersionedData 21 | } 22 | 23 | // VersionedDataKinds is a list of supported VersionedDataKind's. Among other things, this list might 24 | // be used by feature stores to know what data (namespaces) to expect. 25 | var VersionedDataKinds = [...]VersionedDataKind{ 26 | Features, 27 | Segments, 28 | } 29 | --------------------------------------------------------------------------------