├── .circleci └── config.yml ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE ├── Makefile ├── README.md ├── docker-compose.yaml ├── grpcweb ├── README.md ├── calloption.go ├── client.go ├── clientstream.go ├── dialoption.go ├── grpcclient.go ├── grpcwebjs │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── grpc.inc.js │ ├── include.go │ └── webpack.config.js ├── include.go ├── methoddescriptor.go ├── properties.go ├── status │ ├── status.go │ ├── status_suite_test.go │ └── status_test.go ├── test │ └── grpcweb.go └── unary.go ├── internal ├── close.go ├── doc.go └── errors.go ├── jspb ├── .gitignore ├── Makefile ├── README.md ├── errors.go ├── include.go ├── jspb.inc.js ├── reader.go ├── webpack.config.js └── writer.go ├── logo.svg ├── proto ├── Makefile ├── gopherjs.pb.go ├── gopherjs.proto └── helper.go ├── protoc-gen-gopherjs ├── .gitignore ├── Makefile ├── README.md ├── doc.go ├── generator │ ├── generator.go │ └── name_test.go ├── grpc │ └── grpc.go ├── link_grpc.go ├── main.go └── test │ ├── Makefile │ ├── gentypes.go │ ├── grpc_test │ ├── test.pb.gopherjs.go │ ├── test.pb.gopherjs.go.golden │ └── test.proto │ ├── multi │ ├── multi1.pb.gopherjs.go │ ├── multi1.proto │ ├── multi2.pb.gopherjs.go │ ├── multi2.proto │ ├── multi3.pb.gopherjs.go │ └── multi3.proto │ └── types │ ├── types.pb.gopherjs.go │ ├── types.pb.gopherjs.go.golden │ └── types.proto ├── ptypes ├── .gitignore ├── Makefile ├── any │ ├── any.pb.gopherjs.go │ └── any.proto ├── duration │ ├── duration.pb.gopherjs.go │ └── duration.proto ├── empty │ ├── empty.pb.gopherjs.go │ └── empty.proto ├── struct │ ├── struct.pb.gopherjs.go │ └── struct.proto ├── timestamp │ ├── timestamp.pb.gopherjs.go │ └── timestamp.proto └── wrappers │ ├── wrappers.pb.gopherjs.go │ └── wrappers.proto ├── test ├── Makefile ├── README.md ├── client │ ├── html │ │ ├── .gitignore │ │ ├── index.html │ │ └── resources │ │ │ ├── qunit-1.15.0.css │ │ │ └── qunit-1.15.0.js │ ├── main.go │ ├── proto │ │ └── test │ │ │ └── test.pb.gopherjs.go │ └── wrappers │ │ ├── ping_bidi.go │ │ ├── ping_client.go │ │ ├── ping_list.go │ │ └── wrappers.go ├── insecure │ ├── localhost.crt │ └── localhost.key ├── proto │ └── test │ │ └── test.proto ├── recoverer │ └── recoverer.go ├── server │ ├── cmd │ │ ├── README.md │ │ └── main.go │ ├── main.go │ ├── proto │ │ ├── multi │ │ │ ├── multi1.pb.go │ │ │ ├── multi2.pb.go │ │ │ └── multi3.pb.go │ │ ├── test │ │ │ └── test.pb.go │ │ └── types │ │ │ └── types.pb.go │ └── wrappers │ │ ├── ping_bidi.go │ │ ├── ping_client.go │ │ ├── ping_list.go │ │ └── wrappers.go ├── shared │ ├── helpers.go │ ├── ping.go │ ├── ping_bidi.go │ ├── ping_client.go │ ├── ping_list.go │ └── shared.go ├── webdriver_suite_test.go └── webdriver_test.go └── vendor ├── github.com ├── 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 ├── go-test │ └── deep │ │ ├── LICENSE │ │ └── deep.go ├── golang │ └── protobuf │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── proto │ │ ├── clone.go │ │ ├── decode.go │ │ ├── discard.go │ │ ├── encode.go │ │ ├── equal.go │ │ ├── extensions.go │ │ ├── lib.go │ │ ├── message_set.go │ │ ├── pointer_reflect.go │ │ ├── pointer_unsafe.go │ │ ├── properties.go │ │ ├── table_marshal.go │ │ ├── table_merge.go │ │ ├── table_unmarshal.go │ │ ├── text.go │ │ └── text_parser.go │ │ ├── protoc-gen-go │ │ ├── descriptor │ │ │ └── descriptor.pb.go │ │ ├── doc.go │ │ ├── generator │ │ │ ├── generator.go │ │ │ └── internal │ │ │ │ └── remap │ │ │ │ └── remap.go │ │ ├── grpc │ │ │ └── grpc.go │ │ ├── link_grpc.go │ │ ├── main.go │ │ └── plugin │ │ │ └── plugin.pb.go │ │ └── ptypes │ │ ├── any.go │ │ ├── any │ │ └── any.pb.go │ │ ├── doc.go │ │ ├── duration.go │ │ ├── duration │ │ └── duration.pb.go │ │ ├── empty │ │ └── empty.pb.go │ │ ├── timestamp.go │ │ └── timestamp │ │ └── timestamp.pb.go ├── gopherjs │ └── gopherjs │ │ ├── LICENSE │ │ ├── build │ │ └── build.go │ │ ├── compiler │ │ ├── analysis │ │ │ ├── bool.go │ │ │ ├── break.go │ │ │ ├── escape.go │ │ │ ├── info.go │ │ │ └── sideeffect.go │ │ ├── astutil │ │ │ └── astutil.go │ │ ├── compiler.go │ │ ├── expressions.go │ │ ├── filter │ │ │ ├── assign.go │ │ │ └── incdecstmt.go │ │ ├── gopherjspkg │ │ │ ├── doc.go │ │ │ ├── fs.go │ │ │ └── fs_vfsdata.go │ │ ├── natives │ │ │ ├── doc.go │ │ │ ├── fs.go │ │ │ └── fs_vfsdata.go │ │ ├── package.go │ │ ├── prelude │ │ │ ├── genmin.go │ │ │ ├── goroutines.go │ │ │ ├── jsmapping.go │ │ │ ├── numeric.go │ │ │ ├── prelude.go │ │ │ ├── prelude_min.go │ │ │ └── types.go │ │ ├── statements.go │ │ ├── typesutil │ │ │ └── typesutil.go │ │ ├── utils.go │ │ └── version_check.go │ │ ├── internal │ │ └── sysutil │ │ │ ├── sysutil.go │ │ │ └── sysutil_windows.go │ │ ├── js │ │ └── js.go │ │ └── tool.go ├── gorilla │ └── websocket │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── client.go │ │ ├── client_clone.go │ │ ├── client_clone_legacy.go │ │ ├── compression.go │ │ ├── conn.go │ │ ├── conn_read.go │ │ ├── conn_read_legacy.go │ │ ├── doc.go │ │ ├── json.go │ │ ├── mask.go │ │ ├── mask_safe.go │ │ ├── prepared.go │ │ ├── server.go │ │ └── util.go ├── improbable-eng │ └── grpc-web │ │ ├── LICENSE.txt │ │ └── go │ │ └── grpcweb │ │ ├── README.md │ │ ├── doc.go │ │ ├── grpc_web_response.go │ │ ├── helpers.go │ │ ├── options.go │ │ ├── websocket_wrapper.go │ │ └── wrapper.go ├── inconshreveable │ └── mousetrap │ │ ├── LICENSE │ │ ├── trap_others.go │ │ ├── trap_windows.go │ │ └── trap_windows_1.4.go ├── kisielk │ └── gotool │ │ ├── LEGAL │ │ ├── LICENSE │ │ ├── go13.go │ │ ├── go14-15.go │ │ ├── go16-18.go │ │ ├── internal │ │ └── load │ │ │ ├── path.go │ │ │ ├── pkg.go │ │ │ └── search.go │ │ ├── match.go │ │ ├── match18.go │ │ └── tool.go ├── neelance │ ├── astrewrite │ │ ├── LICENSE │ │ └── simplify.go │ └── sourcemap │ │ ├── LICENSE │ │ └── sourcemap.go ├── onsi │ ├── ginkgo │ │ ├── LICENSE │ │ ├── config │ │ │ └── config.go │ │ ├── ginkgo │ │ │ ├── bootstrap_command.go │ │ │ ├── build_command.go │ │ │ ├── convert │ │ │ │ ├── ginkgo_ast_nodes.go │ │ │ │ ├── import.go │ │ │ │ ├── package_rewriter.go │ │ │ │ ├── test_finder.go │ │ │ │ ├── testfile_rewriter.go │ │ │ │ └── testing_t_rewriter.go │ │ │ ├── convert_command.go │ │ │ ├── generate_command.go │ │ │ ├── help_command.go │ │ │ ├── interrupthandler │ │ │ │ ├── interrupt_handler.go │ │ │ │ ├── sigquit_swallower_unix.go │ │ │ │ └── sigquit_swallower_windows.go │ │ │ ├── main.go │ │ │ ├── nodot │ │ │ │ └── nodot.go │ │ │ ├── nodot_command.go │ │ │ ├── notifications.go │ │ │ ├── run_command.go │ │ │ ├── run_watch_and_build_command_flags.go │ │ │ ├── suite_runner.go │ │ │ ├── testrunner │ │ │ │ ├── log_writer.go │ │ │ │ ├── run_result.go │ │ │ │ └── test_runner.go │ │ │ ├── testsuite │ │ │ │ ├── test_suite.go │ │ │ │ ├── vendor_check_go15.go │ │ │ │ └── vendor_check_go16.go │ │ │ ├── unfocus_command.go │ │ │ ├── version_command.go │ │ │ ├── watch │ │ │ │ ├── delta.go │ │ │ │ ├── delta_tracker.go │ │ │ │ ├── dependencies.go │ │ │ │ ├── package_hash.go │ │ │ │ ├── package_hashes.go │ │ │ │ └── suite.go │ │ │ └── watch_command.go │ │ ├── ginkgo_dsl.go │ │ ├── internal │ │ │ ├── codelocation │ │ │ │ └── code_location.go │ │ │ ├── containernode │ │ │ │ └── container_node.go │ │ │ ├── failer │ │ │ │ └── failer.go │ │ │ ├── leafnodes │ │ │ │ ├── benchmarker.go │ │ │ │ ├── interfaces.go │ │ │ │ ├── it_node.go │ │ │ │ ├── measure_node.go │ │ │ │ ├── runner.go │ │ │ │ ├── setup_nodes.go │ │ │ │ ├── suite_nodes.go │ │ │ │ ├── synchronized_after_suite_node.go │ │ │ │ └── synchronized_before_suite_node.go │ │ │ ├── remote │ │ │ │ ├── aggregator.go │ │ │ │ ├── forwarding_reporter.go │ │ │ │ ├── output_interceptor.go │ │ │ │ ├── output_interceptor_unix.go │ │ │ │ ├── output_interceptor_win.go │ │ │ │ ├── server.go │ │ │ │ ├── syscall_dup_linux_arm64.go │ │ │ │ ├── syscall_dup_solaris.go │ │ │ │ └── syscall_dup_unix.go │ │ │ ├── spec │ │ │ │ ├── spec.go │ │ │ │ └── specs.go │ │ │ ├── spec_iterator │ │ │ │ ├── index_computer.go │ │ │ │ ├── parallel_spec_iterator.go │ │ │ │ ├── serial_spec_iterator.go │ │ │ │ ├── sharded_parallel_spec_iterator.go │ │ │ │ └── spec_iterator.go │ │ │ ├── specrunner │ │ │ │ ├── random_id.go │ │ │ │ └── spec_runner.go │ │ │ ├── suite │ │ │ │ └── suite.go │ │ │ ├── testingtproxy │ │ │ │ └── testing_t_proxy.go │ │ │ └── writer │ │ │ │ ├── fake_writer.go │ │ │ │ └── writer.go │ │ ├── reporters │ │ │ ├── default_reporter.go │ │ │ ├── fake_reporter.go │ │ │ ├── junit_reporter.go │ │ │ ├── reporter.go │ │ │ ├── stenographer │ │ │ │ ├── console_logging.go │ │ │ │ ├── fake_stenographer.go │ │ │ │ ├── stenographer.go │ │ │ │ └── support │ │ │ │ │ ├── go-colorable │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── colorable_others.go │ │ │ │ │ ├── colorable_windows.go │ │ │ │ │ └── noncolorable.go │ │ │ │ │ └── go-isatty │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── isatty_appengine.go │ │ │ │ │ ├── isatty_bsd.go │ │ │ │ │ ├── isatty_linux.go │ │ │ │ │ ├── isatty_solaris.go │ │ │ │ │ └── isatty_windows.go │ │ │ └── teamcity_reporter.go │ │ └── types │ │ │ ├── code_location.go │ │ │ ├── synchronization.go │ │ │ └── types.go │ └── gomega │ │ ├── LICENSE │ │ ├── format │ │ └── format.go │ │ ├── gbytes │ │ ├── buffer.go │ │ ├── io_wrappers.go │ │ └── say_matcher.go │ │ ├── gexec │ │ ├── build.go │ │ ├── exit_matcher.go │ │ ├── prefixed_writer.go │ │ └── session.go │ │ ├── gomega_dsl.go │ │ ├── internal │ │ ├── assertion │ │ │ └── assertion.go │ │ ├── asyncassertion │ │ │ └── async_assertion.go │ │ ├── oraclematcher │ │ │ └── oracle_matcher.go │ │ └── testingtsupport │ │ │ └── testing_t_support.go │ │ ├── matchers.go │ │ ├── matchers │ │ ├── and.go │ │ ├── assignable_to_type_of_matcher.go │ │ ├── be_a_directory.go │ │ ├── be_a_regular_file.go │ │ ├── be_an_existing_file.go │ │ ├── be_closed_matcher.go │ │ ├── be_empty_matcher.go │ │ ├── be_equivalent_to_matcher.go │ │ ├── be_false_matcher.go │ │ ├── be_identical_to.go │ │ ├── be_nil_matcher.go │ │ ├── be_numerically_matcher.go │ │ ├── be_sent_matcher.go │ │ ├── be_temporally_matcher.go │ │ ├── be_true_matcher.go │ │ ├── be_zero_matcher.go │ │ ├── consist_of.go │ │ ├── contain_element_matcher.go │ │ ├── contain_substring_matcher.go │ │ ├── equal_matcher.go │ │ ├── have_cap_matcher.go │ │ ├── have_key_matcher.go │ │ ├── have_key_with_value_matcher.go │ │ ├── have_len_matcher.go │ │ ├── have_occurred_matcher.go │ │ ├── have_prefix_matcher.go │ │ ├── have_suffix_matcher.go │ │ ├── match_error_matcher.go │ │ ├── match_json_matcher.go │ │ ├── match_regexp_matcher.go │ │ ├── match_xml_matcher.go │ │ ├── match_yaml_matcher.go │ │ ├── not.go │ │ ├── or.go │ │ ├── panic_matcher.go │ │ ├── receive_matcher.go │ │ ├── succeed_matcher.go │ │ ├── support │ │ │ └── goraph │ │ │ │ ├── bipartitegraph │ │ │ │ ├── bipartitegraph.go │ │ │ │ └── bipartitegraphmatching.go │ │ │ │ ├── edge │ │ │ │ └── edge.go │ │ │ │ ├── node │ │ │ │ └── node.go │ │ │ │ └── util │ │ │ │ └── util.go │ │ ├── type_support.go │ │ └── with_transform.go │ │ └── types │ │ └── types.go ├── pkg │ └── errors │ │ ├── LICENSE │ │ ├── errors.go │ │ └── stack.go ├── rs │ └── cors │ │ ├── LICENSE │ │ ├── cors.go │ │ └── utils.go ├── rusco │ └── qunit │ │ └── qunit.go ├── sclevine │ └── agouti │ │ ├── LICENSE │ │ ├── agouti.go │ │ ├── api │ │ ├── api.go │ │ ├── element.go │ │ ├── internal │ │ │ ├── bus │ │ │ │ ├── client.go │ │ │ │ └── connect.go │ │ │ └── service │ │ │ │ ├── build.go │ │ │ │ └── service.go │ │ ├── offset.go │ │ ├── session.go │ │ ├── speed.go │ │ ├── types.go │ │ ├── webdriver.go │ │ └── window.go │ │ ├── capabilities.go │ │ ├── internal │ │ ├── element │ │ │ └── repository.go │ │ └── target │ │ │ ├── selector.go │ │ │ └── selectors.go │ │ ├── matchers │ │ ├── internal │ │ │ ├── be_found.go │ │ │ ├── boolean_matcher.go │ │ │ ├── colorparser │ │ │ │ └── color_parser.go │ │ │ ├── equal_element.go │ │ │ ├── have_attribute.go │ │ │ ├── have_css.go │ │ │ ├── log_matcher.go │ │ │ ├── match_text.go │ │ │ ├── messages.go │ │ │ └── value_matcher.go │ │ ├── matchers.go │ │ ├── page_matchers.go │ │ └── selection_matchers.go │ │ ├── multiselection.go │ │ ├── options.go │ │ ├── page.go │ │ ├── selectable.go │ │ ├── selection.go │ │ ├── selection_actions.go │ │ ├── selection_frames.go │ │ ├── selection_properties.go │ │ ├── types.go │ │ └── webdriver.go ├── shurcooL │ └── httpfs │ │ ├── filter │ │ ├── filter.go │ │ └── filters.go │ │ └── vfsutil │ │ ├── file.go │ │ ├── vfsutil.go │ │ └── walk.go ├── sirupsen │ └── logrus │ │ ├── LICENSE │ │ ├── alt_exit.go │ │ ├── doc.go │ │ ├── entry.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── hooks.go │ │ ├── json_formatter.go │ │ ├── logger.go │ │ ├── logrus.go │ │ ├── terminal_bsd.go │ │ ├── terminal_linux.go │ │ ├── text_formatter.go │ │ └── writer.go └── spf13 │ ├── cobra │ ├── LICENSE.txt │ ├── args.go │ ├── bash_completions.go │ ├── cobra.go │ ├── cobra │ │ └── cmd │ │ │ ├── license_agpl.go │ │ │ ├── license_apache_2.go │ │ │ ├── license_bsd_clause_2.go │ │ │ ├── license_bsd_clause_3.go │ │ │ ├── license_gpl_2.go │ │ │ ├── license_gpl_3.go │ │ │ ├── license_lgpl.go │ │ │ ├── license_mit.go │ │ │ ├── licenses.go │ │ │ └── testdata │ │ │ └── LICENSE.golden │ ├── command.go │ ├── command_notwin.go │ ├── command_win.go │ └── zsh_completions.go │ └── pflag │ ├── LICENSE │ ├── bool.go │ ├── bool_slice.go │ ├── bytes.go │ ├── count.go │ ├── duration.go │ ├── duration_slice.go │ ├── flag.go │ ├── float32.go │ ├── float64.go │ ├── golangflag.go │ ├── int.go │ ├── int16.go │ ├── int32.go │ ├── int64.go │ ├── int8.go │ ├── int_slice.go │ ├── ip.go │ ├── ip_slice.go │ ├── ipmask.go │ ├── ipnet.go │ ├── string.go │ ├── string_array.go │ ├── string_slice.go │ ├── uint.go │ ├── uint16.go │ ├── uint32.go │ ├── uint64.go │ ├── uint8.go │ └── uint_slice.go ├── golang.org └── x │ ├── crypto │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── ssh │ │ └── terminal │ │ ├── terminal.go │ │ ├── util.go │ │ ├── util_bsd.go │ │ ├── util_linux.go │ │ ├── util_plan9.go │ │ ├── util_solaris.go │ │ └── util_windows.go │ ├── net │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── context │ │ ├── context.go │ │ ├── go17.go │ │ ├── go19.go │ │ ├── pre_go17.go │ │ └── pre_go19.go │ ├── html │ │ ├── atom │ │ │ ├── atom.go │ │ │ ├── gen.go │ │ │ └── table.go │ │ ├── charset │ │ │ └── charset.go │ │ ├── const.go │ │ ├── doc.go │ │ ├── doctype.go │ │ ├── entity.go │ │ ├── escape.go │ │ ├── foreign.go │ │ ├── node.go │ │ ├── parse.go │ │ ├── render.go │ │ └── token.go │ ├── http2 │ │ ├── ciphers.go │ │ ├── client_conn_pool.go │ │ ├── configure_transport.go │ │ ├── databuffer.go │ │ ├── errors.go │ │ ├── flow.go │ │ ├── frame.go │ │ ├── go16.go │ │ ├── go17.go │ │ ├── go17_not18.go │ │ ├── go18.go │ │ ├── go19.go │ │ ├── gotrack.go │ │ ├── headermap.go │ │ ├── hpack │ │ │ ├── encode.go │ │ │ ├── hpack.go │ │ │ ├── huffman.go │ │ │ └── tables.go │ │ ├── http2.go │ │ ├── not_go16.go │ │ ├── not_go17.go │ │ ├── not_go18.go │ │ ├── not_go19.go │ │ ├── pipe.go │ │ ├── server.go │ │ ├── transport.go │ │ ├── write.go │ │ ├── writesched.go │ │ ├── writesched_priority.go │ │ └── writesched_random.go │ ├── idna │ │ ├── idna.go │ │ ├── punycode.go │ │ ├── tables.go │ │ ├── trie.go │ │ └── trieval.go │ ├── internal │ │ └── timeseries │ │ │ └── timeseries.go │ ├── lex │ │ └── httplex │ │ │ └── httplex.go │ └── trace │ │ ├── events.go │ │ ├── histogram.go │ │ ├── trace.go │ │ ├── trace_go16.go │ │ └── trace_go17.go │ ├── sys │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── unix │ │ ├── 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_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_linux.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── env_unset.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── file_unix.go │ │ ├── flock.go │ │ ├── flock_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── gccgo_linux_sparc64.go │ │ ├── mkpost.go │ │ ├── openbsd_pledge.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_no_getwd.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_solaris_amd64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ └── ztypes_solaris_amd64.go │ └── windows │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── dll_windows.go │ │ ├── env_unset.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── types_windows.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ └── zsyscall_windows.go │ ├── text │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── encoding │ │ ├── charmap │ │ │ ├── charmap.go │ │ │ ├── maketables.go │ │ │ └── tables.go │ │ ├── encoding.go │ │ ├── htmlindex │ │ │ ├── gen.go │ │ │ ├── htmlindex.go │ │ │ ├── map.go │ │ │ └── tables.go │ │ ├── internal │ │ │ ├── identifier │ │ │ │ ├── gen.go │ │ │ │ ├── identifier.go │ │ │ │ └── mib.go │ │ │ └── internal.go │ │ ├── japanese │ │ │ ├── all.go │ │ │ ├── eucjp.go │ │ │ ├── iso2022jp.go │ │ │ ├── maketables.go │ │ │ ├── shiftjis.go │ │ │ └── tables.go │ │ ├── korean │ │ │ ├── euckr.go │ │ │ ├── maketables.go │ │ │ └── tables.go │ │ ├── simplifiedchinese │ │ │ ├── all.go │ │ │ ├── gbk.go │ │ │ ├── hzgb2312.go │ │ │ ├── maketables.go │ │ │ └── tables.go │ │ ├── traditionalchinese │ │ │ ├── big5.go │ │ │ ├── maketables.go │ │ │ └── tables.go │ │ └── unicode │ │ │ ├── override.go │ │ │ └── unicode.go │ ├── internal │ │ ├── gen │ │ │ ├── code.go │ │ │ └── gen.go │ │ ├── tag │ │ │ └── tag.go │ │ ├── triegen │ │ │ ├── compact.go │ │ │ ├── print.go │ │ │ └── triegen.go │ │ ├── ucd │ │ │ └── ucd.go │ │ └── utf8internal │ │ │ └── utf8internal.go │ ├── language │ │ ├── common.go │ │ ├── coverage.go │ │ ├── gen.go │ │ ├── gen_common.go │ │ ├── gen_index.go │ │ ├── go1_1.go │ │ ├── go1_2.go │ │ ├── index.go │ │ ├── language.go │ │ ├── lookup.go │ │ ├── match.go │ │ ├── parse.go │ │ ├── tables.go │ │ └── tags.go │ ├── runes │ │ ├── cond.go │ │ └── runes.go │ ├── secure │ │ └── bidirule │ │ │ └── bidirule.go │ ├── transform │ │ └── transform.go │ └── unicode │ │ ├── bidi │ │ ├── bidi.go │ │ ├── bracket.go │ │ ├── core.go │ │ ├── gen.go │ │ ├── gen_ranges.go │ │ ├── gen_trieval.go │ │ ├── prop.go │ │ ├── tables.go │ │ └── trieval.go │ │ ├── cldr │ │ ├── base.go │ │ ├── cldr.go │ │ ├── collate.go │ │ ├── decode.go │ │ ├── makexml.go │ │ ├── resolve.go │ │ ├── slice.go │ │ └── xml.go │ │ ├── norm │ │ ├── composition.go │ │ ├── forminfo.go │ │ ├── input.go │ │ ├── iter.go │ │ ├── maketables.go │ │ ├── normalize.go │ │ ├── readwriter.go │ │ ├── tables.go │ │ ├── transform.go │ │ ├── trie.go │ │ └── triegen.go │ │ └── rangetable │ │ ├── gen.go │ │ ├── merge.go │ │ ├── rangetable.go │ │ └── tables.go │ └── tools │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── cmd │ └── getgo │ │ └── LICENSE │ ├── go │ ├── buildutil │ │ ├── allpackages.go │ │ ├── fakecontext.go │ │ ├── overlay.go │ │ ├── tags.go │ │ └── util.go │ ├── gcexportdata │ │ ├── gcexportdata.go │ │ ├── importer.go │ │ └── main.go │ ├── internal │ │ └── gcimporter │ │ │ ├── bexport.go │ │ │ ├── bimport.go │ │ │ ├── exportdata.go │ │ │ ├── gcimporter.go │ │ │ ├── iimport.go │ │ │ ├── isAlias18.go │ │ │ └── isAlias19.go │ └── types │ │ └── typeutil │ │ ├── imports.go │ │ ├── map.go │ │ ├── methodsetcache.go │ │ └── ui.go │ └── third_party │ ├── moduleloader │ └── LICENSE │ ├── typescript │ └── LICENSE │ └── webcomponents │ └── LICENSE ├── google.golang.org ├── genproto │ ├── LICENSE │ └── googleapis │ │ └── rpc │ │ └── status │ │ └── status.pb.go └── grpc │ ├── AUTHORS │ ├── LICENSE │ ├── backoff.go │ ├── balancer.go │ ├── balancer │ ├── balancer.go │ ├── base │ │ ├── balancer.go │ │ └── base.go │ └── roundrobin │ │ └── roundrobin.go │ ├── balancer_conn_wrappers.go │ ├── balancer_v1_wrapper.go │ ├── call.go │ ├── clientconn.go │ ├── codec.go │ ├── codes │ ├── code_string.go │ └── codes.go │ ├── connectivity │ └── connectivity.go │ ├── credentials │ ├── credentials.go │ ├── credentials_util_go17.go │ ├── credentials_util_go18.go │ └── credentials_util_pre_go17.go │ ├── doc.go │ ├── encoding │ └── encoding.go │ ├── go16.go │ ├── go17.go │ ├── grpclb.go │ ├── grpclb │ └── grpc_lb_v1 │ │ └── messages │ │ └── messages.pb.go │ ├── grpclb_picker.go │ ├── grpclb_remote_balancer.go │ ├── grpclb_util.go │ ├── grpclog │ ├── grpclog.go │ ├── logger.go │ └── loggerv2.go │ ├── interceptor.go │ ├── internal │ └── internal.go │ ├── keepalive │ └── keepalive.go │ ├── metadata │ └── metadata.go │ ├── naming │ ├── dns_resolver.go │ ├── go17.go │ ├── go18.go │ └── naming.go │ ├── peer │ └── peer.go │ ├── picker_wrapper.go │ ├── pickfirst.go │ ├── proxy.go │ ├── resolver │ ├── dns │ │ ├── dns_resolver.go │ │ ├── go17.go │ │ └── go18.go │ ├── passthrough │ │ └── passthrough.go │ └── resolver.go │ ├── resolver_conn_wrapper.go │ ├── rpc_util.go │ ├── server.go │ ├── service_config.go │ ├── stats │ ├── handlers.go │ └── stats.go │ ├── status │ └── status.go │ ├── stream.go │ ├── tap │ └── tap.go │ ├── trace.go │ └── transport │ ├── bdp_estimator.go │ ├── control.go │ ├── go16.go │ ├── go17.go │ ├── handler_server.go │ ├── http2_client.go │ ├── http2_server.go │ ├── http_util.go │ ├── log.go │ └── transport.go ├── gopkg.in └── yaml.v2 │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── 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 └── honnef.co └── go └── js └── dom ├── LICENSE ├── dom.go └── events.go /Gopkg.toml: -------------------------------------------------------------------------------- 1 | required = [ 2 | "github.com/onsi/ginkgo/ginkgo", 3 | "github.com/golang/protobuf/protoc-gen-go", 4 | "github.com/gopherjs/gopherjs", 5 | ] 6 | 7 | [prune] 8 | non-go = true 9 | unused-packages = true 10 | go-tests = true 11 | 12 | [[constraint]] 13 | name = "github.com/golang/protobuf" 14 | version = "1.1.0" 15 | 16 | [[constraint]] 17 | branch = "master" 18 | name = "github.com/gopherjs/gopherjs" 19 | 20 | [[constraint]] 21 | name = "github.com/improbable-eng/grpc-web" 22 | version = "0.6.0" 23 | 24 | [[constraint]] 25 | branch = "master" 26 | name = "github.com/onsi/ginkgo" 27 | 28 | [[constraint]] 29 | branch = "master" 30 | name = "github.com/onsi/gomega" 31 | 32 | [[constraint]] 33 | branch = "master" 34 | name = "github.com/rusco/qunit" 35 | 36 | [[constraint]] 37 | branch = "master" 38 | name = "github.com/pkg/errors" 39 | 40 | [[constraint]] 41 | branch = "master" 42 | name = "github.com/sclevine/agouti" 43 | 44 | [[constraint]] 45 | branch = "master" 46 | name = "golang.org/x/net" 47 | 48 | [[constraint]] 49 | name = "google.golang.org/grpc" 50 | version = "1.9.2" 51 | 52 | [[constraint]] 53 | branch = "master" 54 | name = "honnef.co/go/js/dom" 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Johan Brandhorst 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | regenerate: 2 | cd ptypes && make regenerate 3 | cd protoc-gen-gopherjs && make regenerate 4 | cd test && make regenerate 5 | cd proto && make regenerate 6 | 7 | install: 8 | cd protoc-gen-gopherjs && go install ./ 9 | go install ./vendor/github.com/golang/protobuf/protoc-gen-go 10 | 11 | .PHONY: test 12 | test: 13 | cd protoc-gen-gopherjs && make tests 14 | 15 | build: 16 | go build $$(go list ./... | grep -v github.com/johanbrandhorst/protobuf/test$$ | grep -v vendor) 17 | 18 | integration: 19 | bash -c "\ 20 | trap '\ 21 | # docker-compose logs selenium && \ 22 | docker-compose logs chromedriver && \ 23 | docker-compose down' EXIT; \ 24 | docker-compose up -d && \ 25 | docker-compose exec -T testrunner bash -c '\ 26 | mkdir -p /go/src/github.com/johanbrandhorst/protobuf/' && \ 27 | docker cp ./ testrunner:/go/src/github.com/johanbrandhorst/protobuf/ && \ 28 | docker-compose exec -T testrunner bash -c '\ 29 | cd /go/src/github.com/johanbrandhorst/protobuf && \ 30 | go install ./vendor/github.com/onsi/ginkgo/ginkgo && \ 31 | cd test && make test' \ 32 | " 33 | 34 | rebuild: 35 | cd grpcweb/grpcwebjs && make build 36 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | networks: 3 | internal: 4 | driver: bridge 5 | services: 6 | chromedriver: 7 | environment: 8 | CHROMEDRIVER_WHITELISTED_IPS: "" 9 | expose: 10 | - "4444" 11 | image: robcherry/docker-chromedriver:latest 12 | networks: 13 | - internal 14 | privileged: true 15 | #selenium: 16 | # expose: 17 | # - "4444" 18 | # image: selenium/standalone-firefox:latest 19 | # networks: 20 | # - internal 21 | testrunner: 22 | # This just sleeps, we execute the test command using docker-compose exec. 23 | container_name: testrunner 24 | command: sleep infinity 25 | depends_on: 26 | - chromedriver 27 | # - selenium 28 | environment: 29 | CHROMEDRIVER_ADDR: chromedriver:4444 30 | #SELENIUM_ADDR: selenium:4444 31 | GOPHERJS_SERVER_ADDR: testrunner:8080 32 | expose: 33 | - "8080" 34 | - "9090" 35 | - "9095" 36 | - "9100" 37 | - "9105" 38 | image: golang:latest 39 | networks: 40 | - internal 41 | 42 | -------------------------------------------------------------------------------- /grpcweb/README.md: -------------------------------------------------------------------------------- 1 | # GopherJS bindings for Improbable's gRPC-Web implementation 2 | 3 | [![GoDoc](https://godoc.org/github.com/johanbrandhorst/protobuf/grpcweb?status.svg)](https://godoc.org/github.com/johanbrandhorst/protobuf/grpcweb) 4 | 5 | This package provides GopherJS bindings for [Improbable's gRPC-web implementation](https://github.com/improbable-eng/grpc-web/). 6 | 7 | The API is still experimental, and is not currently intended for general use outside 8 | of via the [GopherJS protoc compiler plugin](https://github.com/johanbrandhorst/protobuf/tree/master/protoc-gen-gopherjs). 9 | See the [`protoc-gen-gopherjs` README](https://github.com/johanbrandhorst/protobuf/tree/master/protoc-gen-gopherjs/README.md) 10 | for more information on generating the interface. 11 | -------------------------------------------------------------------------------- /grpcweb/grpcwebjs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /grpcweb/grpcwebjs/Makefile: -------------------------------------------------------------------------------- 1 | all: checkout build 2 | 3 | checkout: 4 | npm install grpc-web-client webpack 5 | 6 | build: 7 | ./node_modules/.bin/webpack 8 | 9 | clean: 10 | rm -f grpc.inc.js 11 | rm -rf node_modules 12 | -------------------------------------------------------------------------------- /grpcweb/grpcwebjs/README.md: -------------------------------------------------------------------------------- 1 | # grpcwebjs 2 | Contains compiled JS for the Improbable gRPC-web client implementation 3 | -------------------------------------------------------------------------------- /grpcweb/grpcwebjs/include.go: -------------------------------------------------------------------------------- 1 | package grpcwebjs 2 | -------------------------------------------------------------------------------- /grpcweb/grpcwebjs/webpack.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require("webpack"); 2 | 3 | module.exports = { 4 | entry: "./node_modules/grpc-web-client/dist/index.js", 5 | output: { 6 | filename: "grpc.inc.js", 7 | libraryTarget: "this", 8 | }, 9 | plugins: [ 10 | new webpack.optimize.UglifyJsPlugin() 11 | ] 12 | }; 13 | -------------------------------------------------------------------------------- /grpcweb/status/status_suite_test.go: -------------------------------------------------------------------------------- 1 | package status_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestStatus(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Status Suite") 13 | } 14 | -------------------------------------------------------------------------------- /grpcweb/status/status_test.go: -------------------------------------------------------------------------------- 1 | package status_test 2 | 3 | import ( 4 | "errors" 5 | 6 | . "github.com/onsi/ginkgo" 7 | . "github.com/onsi/gomega" 8 | "google.golang.org/grpc/codes" 9 | 10 | "github.com/johanbrandhorst/protobuf/grpcweb/status" 11 | ) 12 | 13 | var _ = Describe("FromError", func() { 14 | It("Extracts the status from an status error", func() { 15 | var err error = &status.Status{ 16 | Code: codes.OK, 17 | Message: "Not an error", 18 | } 19 | Expect(status.FromError(err)).To(Equal(err.(*status.Status))) 20 | }) 21 | 22 | Context("when the error is not a status", func() { 23 | It("returns a status with unknown code", func() { 24 | err := errors.New("Not a status") 25 | st := status.FromError(err) 26 | Expect(st.Code).To(Equal(codes.Unknown)) 27 | Expect(st.Message).To(Equal(err.Error())) 28 | }) 29 | }) 30 | }) 31 | -------------------------------------------------------------------------------- /grpcweb/test/grpcweb.go: -------------------------------------------------------------------------------- 1 | package test 2 | 3 | import ( 4 | "github.com/johanbrandhorst/protobuf/grpcweb" 5 | "github.com/rusco/qunit" 6 | 7 | "github.com/johanbrandhorst/protobuf/test/recoverer" 8 | ) 9 | 10 | // This test is imported and run by the root level tests 11 | 12 | func GRPCWebTest() { 13 | defer recoverer.Recover() // recovers any panics and fails tests 14 | 15 | qunit.Module("gRPC-Web tests") 16 | 17 | qunit.Test("Creating a new client", func(assert qunit.QUnitAssert) { 18 | qunit.Expect(1) 19 | 20 | c := grpcweb.NewClient("bla", "bla") 21 | assert.NotEqual(c, nil, "NewClient creates a non-nil client") 22 | }) 23 | } 24 | -------------------------------------------------------------------------------- /internal/close.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | const closeMessage = "clos" 4 | 5 | // IsCloseMessage says whether the byte sequence is a close message 6 | func IsCloseMessage(msg []byte) bool { 7 | return string(msg) == closeMessage 8 | } 9 | 10 | // FormatCloseMessage gets the CloseMessage as a byte sequence 11 | func FormatCloseMessage() []byte { 12 | return []byte(closeMessage) 13 | } 14 | -------------------------------------------------------------------------------- /internal/doc.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | // Internal is used to shared constants between the websocket proxy in the frontend and the 4 | // one that lives on the server side. It should not (and cannot) be imported by third parties. 5 | -------------------------------------------------------------------------------- /internal/errors.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import "google.golang.org/grpc/codes" 4 | 5 | // As per https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent 6 | // codes between 4000-4999 are available for use by applications. 7 | // Take gRPC Codes and shift by 4000 to transmit the gRPC Error over websockets. 8 | 9 | // FormatErrorCode takes a gRPC Code and "encodes" it 10 | // for use over the websocket bridge 11 | func FormatErrorCode(c codes.Code) int { 12 | return 4000 + int(c) 13 | } 14 | 15 | // IsgRPCErrorCode says if the input websocket code is 16 | // a gRPC Error code. 17 | func IsgRPCErrorCode(i int) bool { 18 | return i >= 4000 19 | } 20 | 21 | // ParseErrorCode takes a websocket error code 22 | // and "parses" it into a gRPC Code 23 | func ParseErrorCode(i int) codes.Code { 24 | return codes.Code(i - 4000) 25 | } 26 | -------------------------------------------------------------------------------- /jspb/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | package-lock.json 3 | -------------------------------------------------------------------------------- /jspb/Makefile: -------------------------------------------------------------------------------- 1 | all: checkout build 2 | 3 | checkout: 4 | npm install google-protobuf webpack-cli webpack 5 | 6 | build: 7 | ./node_modules/.bin/webpack-cli 8 | 9 | clean: 10 | rm jspb.inc.js 11 | rm -rf node_modules 12 | -------------------------------------------------------------------------------- /jspb/README.md: -------------------------------------------------------------------------------- 1 | # GopherJS Bindings for Googles ProtobufJS 2 | [![GoDoc](https://godoc.org/github.com/johanbrandhorst/protobuf/jspb?status.svg)](https://godoc.org/github.com/johanbrandhorst/protobuf/jspb) 3 | 4 | This package is based on the node package `google-protobuf`. 5 | It has been "compiled" with webpack. 6 | 7 | ## Usage 8 | The API is still experimental, and is not currently intended for general use outside 9 | of via the [GopherJS protoc compiler plugin](https://github.com/johanbrandhorst/protobuf/tree/master/protoc-gen-gopherjs). 10 | See the [`protoc-gen-gopherjs` README](https://github.com/johanbrandhorst/protobuf/tree/master/protoc-gen-gopherjs/README.md) 11 | for more information on generating the interface. 12 | -------------------------------------------------------------------------------- /jspb/errors.go: -------------------------------------------------------------------------------- 1 | package jspb 2 | 3 | import "github.com/gopherjs/gopherjs/js" 4 | 5 | // catchException recovers any JS exceptions and 6 | // stores the error in the parameter 7 | func catchException(err *error) { 8 | e := recover() 9 | 10 | if e == nil { 11 | return 12 | } 13 | 14 | if e, ok := e.(*js.Error); ok { 15 | *err = e 16 | } else { 17 | panic(e) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /jspb/webpack.config.js: -------------------------------------------------------------------------------- 1 | const webpack = require("webpack"); 2 | 3 | module.exports = { 4 | entry: "./node_modules/google-protobuf/google-protobuf.js", 5 | output: { 6 | filename: "jspb.inc.js", 7 | libraryTarget: "this", 8 | path: __dirname, 9 | }, 10 | optimization: { 11 | minimize: true 12 | }, 13 | mode: "production", 14 | }; 15 | -------------------------------------------------------------------------------- /proto/Makefile: -------------------------------------------------------------------------------- 1 | regenerate: 2 | protoc --go_out=${GOPATH}/src gopherjs.proto 3 | -------------------------------------------------------------------------------- /proto/gopherjs.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package gopherjs; 4 | 5 | import "google/protobuf/descriptor.proto"; 6 | 7 | option go_package = "github.com/johanbrandhorst/protobuf/proto;gopherjs"; 8 | 9 | extend google.protobuf.FileOptions { 10 | // The gopherjs_package option can be used 11 | // like the go_package option to specify a default 12 | // package output and import location. 13 | string gopherjs_package = 1039; 14 | } 15 | -------------------------------------------------------------------------------- /proto/helper.go: -------------------------------------------------------------------------------- 1 | package gopherjs 2 | 3 | import ( 4 | "github.com/golang/protobuf/proto" 5 | "github.com/golang/protobuf/protoc-gen-go/descriptor" 6 | ) 7 | 8 | // GetGopherJSPackage returns the (gopherjs.gopherjs_package) option if 9 | // specified, or an empty string if it was not. 10 | func GetGopherJSPackage(file *descriptor.FileDescriptorProto) string { 11 | if file == nil || file.Options == nil { 12 | return "" 13 | } 14 | 15 | e, err := proto.GetExtension(file.Options, E_GopherjsPackage) 16 | if err != nil { 17 | return "" 18 | } 19 | 20 | if s, ok := e.(*string); ok { 21 | return *s 22 | } 23 | 24 | return "" 25 | } 26 | -------------------------------------------------------------------------------- /protoc-gen-gopherjs/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /protoc-gen-gopherjs/Makefile: -------------------------------------------------------------------------------- 1 | tests: 2 | go install ./ && cd test && make test 3 | go test ./generator/ 4 | 5 | regenerate: 6 | cd test && make regenerate 7 | -------------------------------------------------------------------------------- /protoc-gen-gopherjs/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | protoc-gen-gopherjs is a plugin for the Google protocol buffer compiler to generate 3 | GopherJS code. Run it by building this program and putting it in your path with 4 | the name 5 | protoc-gen-gopherjs 6 | That word 'gopherjs' at the end becomes part of the option string set for the 7 | protocol compiler, so once the protocol compiler (protoc) is installed 8 | you can run 9 | protoc --gopherjs_out=output_directory input_directory/file.proto 10 | to generate GopherJS bindings for the protocol defined by file.proto. 11 | With that input, the output will be written to 12 | output_directory/file.pb.gopherjs.go 13 | 14 | See the README and documentation for protocol buffers to learn more: 15 | https://developers.google.com/protocol-buffers/ 16 | 17 | */ 18 | package main 19 | -------------------------------------------------------------------------------- /protoc-gen-gopherjs/link_grpc.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // This runs the init() function in the grpc package to register 4 | // the plugin 5 | import _ "github.com/johanbrandhorst/protobuf/protoc-gen-gopherjs/grpc" 6 | -------------------------------------------------------------------------------- /protoc-gen-gopherjs/test/Makefile: -------------------------------------------------------------------------------- 1 | golden: 2 | gofmt -w grpc_test/test.pb.gopherjs.go 3 | diff -w grpc_test/test.pb.gopherjs.go grpc_test/test.pb.gopherjs.go.golden 4 | gofmt -w types/types.pb.gopherjs.go 5 | diff -w types/types.pb.gopherjs.go types/types.pb.gopherjs.go.golden 6 | 7 | regenerate: 8 | # Invoke protoc once to generate three independent .pb.go files in the same package. 9 | protoc -I ${GOPATH}/src -I .\ 10 | --gopherjs_out=${GOPATH}/src \ 11 | multi/multi1.proto multi/multi2.proto multi/multi3.proto 12 | protoc -I ${GOPATH}/src -I .\ 13 | --gopherjs_out=plugins=grpc,Mmulti/multi1.proto=github.com/johanbrandhorst/protobuf/protoc-gen-gopherjs/test/multi:${GOPATH}/src \ 14 | grpc_test/test.proto 15 | protoc -I ${GOPATH}/src -I .\ 16 | --gopherjs_out=plugins=grpc,Mmulti/multi1.proto=github.com/johanbrandhorst/protobuf/protoc-gen-gopherjs/test/multi:${GOPATH}/src \ 17 | types/types.proto 18 | 19 | test: regenerate golden 20 | -------------------------------------------------------------------------------- /ptypes/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /test/Makefile: -------------------------------------------------------------------------------- 1 | regenerate: 2 | # Generate protofiles 3 | protoc -I. -I${GOPATH}/src proto/test/test.proto \ 4 | --gopherjs_out=plugins=grpc,Mgoogle/protobuf/empty.proto=github.com/johanbrandhorst/protobuf/ptypes/empty:${GOPATH}/src \ 5 | --go_out=plugins=grpc:${GOPATH}/src 6 | protoc -I. -I${GOPATH}/src -I../protoc-gen-gopherjs/test \ 7 | ../protoc-gen-gopherjs/test/multi/multi1.proto \ 8 | ../protoc-gen-gopherjs/test/multi/multi2.proto \ 9 | ../protoc-gen-gopherjs/test/multi/multi3.proto \ 10 | --go_out=plugins=grpc:${GOPATH}/src 11 | protoc -I. -I${GOPATH}/src -I../protoc-gen-gopherjs/test \ 12 | ../protoc-gen-gopherjs/test/types/types.proto \ 13 | --go_out=plugins=grpc,Mmulti/multi1.proto=github.com/johanbrandhorst/protobuf/test/server/proto/multi:./server/proto 14 | 15 | # Regenerate dependencies 16 | (cd ../protoc-gen-gopherjs/test && make regenerate) 17 | 18 | # Generate GopherJS files 19 | go generate ./client/... 20 | 21 | test: 22 | ginkgo -v . 23 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | ## GopherJS Protobuf binding automated tests 2 | 3 | ### Synopsis 4 | We have Qunit tests written in the GopherJS client in `./client/`. 5 | We have a server running the gRPC backend and hosting the GopherJS client in `./server/`. 6 | We have a Chromedriver driven browser integration testing setup 7 | that loads the GopherJS client page and checks that there were 0 failures, 8 | courtesy of `ginkgo`, `gomega` and `agouti`. 9 | Simply running `ginkgo .` starts the server hosting the GopherJS unit test client, 10 | loads the page in Chromedriver using `agouti`, parses the number of failures and 11 | if it's anything other than 0, the entire test fails. 12 | 13 | ### Requirements 14 | * Chromedriver 15 | * Google Chrome 62+ 16 | * ginkgo (`govendor install +program,vendor`) 17 | 18 | ### Running 19 | ``` 20 | $ make test 21 | ``` 22 | -------------------------------------------------------------------------------- /test/client/html/.gitignore: -------------------------------------------------------------------------------- 1 | index.js 2 | index.js.map 3 | -------------------------------------------------------------------------------- /test/client/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | GopherJS - gRPC Web Tests 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/client/wrappers/ping_client.go: -------------------------------------------------------------------------------- 1 | package wrappers 2 | 3 | import ( 4 | "google.golang.org/grpc/metadata" 5 | 6 | testproto "github.com/johanbrandhorst/protobuf/test/client/proto/test" 7 | "github.com/johanbrandhorst/protobuf/test/shared" 8 | ) 9 | 10 | type pingClientStreamWrapper struct { 11 | c testproto.TestService_PingClientStreamClient 12 | } 13 | 14 | func (pcsw pingClientStreamWrapper) Send(req *shared.Request) error { 15 | return pcsw.c.Send(sharedToProtoReq(req)) 16 | } 17 | 18 | func (pcsw pingClientStreamWrapper) CloseAndRecv() (*shared.Response, error) { 19 | resp, err := pcsw.c.CloseAndRecv() 20 | if err != nil { 21 | return nil, err 22 | } 23 | 24 | return (*shared.Response)(resp), nil 25 | } 26 | 27 | func (pcsw pingClientStreamWrapper) Header() (metadata.MD, error) { 28 | return pcsw.c.Header(), nil 29 | } 30 | 31 | func (pcsw pingClientStreamWrapper) Trailer() metadata.MD { 32 | return pcsw.c.Trailer() 33 | } 34 | 35 | type pingClientStreamErrorWrapper struct { 36 | c testproto.TestService_PingClientStreamErrorClient 37 | } 38 | 39 | func (pcsew pingClientStreamErrorWrapper) Send(req *shared.Request) error { 40 | return pcsew.c.Send(sharedToProtoReq(req)) 41 | } 42 | 43 | func (pcsew pingClientStreamErrorWrapper) CloseAndRecv() (*shared.Response, error) { 44 | _, err := pcsew.c.CloseAndRecv() 45 | return nil, err 46 | } 47 | -------------------------------------------------------------------------------- /test/client/wrappers/ping_list.go: -------------------------------------------------------------------------------- 1 | package wrappers 2 | 3 | import ( 4 | "google.golang.org/grpc/metadata" 5 | 6 | testproto "github.com/johanbrandhorst/protobuf/test/client/proto/test" 7 | "github.com/johanbrandhorst/protobuf/test/shared" 8 | ) 9 | 10 | type pingListWrapper struct { 11 | c testproto.TestService_PingListClient 12 | } 13 | 14 | func (pcsw pingListWrapper) Recv() (*shared.Response, error) { 15 | resp, err := pcsw.c.Recv() 16 | if err != nil { 17 | return nil, err 18 | } 19 | 20 | return (*shared.Response)(resp), nil 21 | } 22 | 23 | func (pcsw pingListWrapper) Header() (metadata.MD, error) { 24 | return pcsw.c.Header(), nil 25 | } 26 | 27 | func (pcsw pingListWrapper) Trailer() metadata.MD { 28 | return pcsw.c.Trailer() 29 | } 30 | -------------------------------------------------------------------------------- /test/insecure/localhost.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBzCCAe+gAwIBAgIQZ3ebrkNZ/UcKkAoFa8ohGTANBgkqhkiG9w0BAQsFADAS 3 | MRAwDgYDVQQKEwdBY21lIENvMCAXDTE3MDgyODIxNDE0OVoYDzIxMTcwODA0MjE0 4 | MTQ5WjASMRAwDgYDVQQKEwdBY21lIENvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A 5 | MIIBCgKCAQEA1C9+Jh6hsffxZ5m6WOs8cwDxeBEPUokq17pRzbTyW//TRW63rVhE 6 | nex1w/UuV7duSUiIdKmKctoFMHhb2LxlqbwXIq0jH/ztWFaeBvb6JH1TcIZZZrYb 7 | j58hdnCF8sdexDsqSXkBPKU7mZDADLh9rBbgGVvGyFJWyqtaX2Lw89wZ+oxyzwTJ 8 | VKUenpp6JQi6QbqjNb6ZqZkyDYPRpJb4MXAEA/gejtClMkAw0rsaVu9toQsrev2V 9 | rWnjvu4KZptwb6BPEtnohvct4Xw/lGS2TsbBkVlCpy/sniiPQSBkK8wnBHtKEyDm 10 | ZYKJ/Udb0sw3Xk7L2J5s7GdhqPqKzV+3OQIDAQABo1cwVTAOBgNVHQ8BAf8EBAMC 11 | BaAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADAgBgNVHREEGTAX 12 | gglsb2NhbGhvc3SCCnRlc3RydW5uZXIwDQYJKoZIhvcNAQELBQADggEBAEwua0Yl 13 | xRlHEzsqwa2yqNX0FFnsoXwpqn8U4h0XFxzHct/vaydskeX/EommmIVjJ/k4rdAl 14 | wJU3McHIvOa+gwtcCVp64JCklVy4zKpRgfDdyGkYfQfqRSIWgZsIBq7GPdnkxG53 15 | ffZx+4Yi+F7wv/P6EqYCgOPE+diFginDhoonRS1eFSdZes9Dr6ehp8rgkjuBo+HV 16 | ua/nwn8ARnuIv0p3ms5i1szknhFKRNukXo5tXoBDbjs/brBVDygk2lTqqU13Ui5+ 17 | nmbd0XLWdVmp9u37VdNOpxZAHA66YBnWwsegHpyjPflf9g5eyJ1bbQEpDCpR3x49 18 | 8HPiGyPU8Y97I0M= 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /test/recoverer/recoverer.go: -------------------------------------------------------------------------------- 1 | package recoverer 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/rusco/qunit" 7 | ) 8 | 9 | func Recover() { 10 | e := recover() 11 | if e == nil { 12 | return 13 | } 14 | 15 | qunit.Ok(false, fmt.Sprintf("Saw panic: %v", e)) 16 | } 17 | -------------------------------------------------------------------------------- /test/server/cmd/README.md: -------------------------------------------------------------------------------- 1 | # Test bin 2 | 3 | This is a reference binary for comparing the output of the gRPC-Web client 4 | against the official Go gRPC client. 5 | -------------------------------------------------------------------------------- /test/server/wrappers/ping_list.go: -------------------------------------------------------------------------------- 1 | package wrappers 2 | 3 | import ( 4 | "github.com/johanbrandhorst/protobuf/test/shared" 5 | "google.golang.org/grpc/metadata" 6 | 7 | testproto "github.com/johanbrandhorst/protobuf/test/server/proto/test" 8 | ) 9 | 10 | type pingListWrapper struct { 11 | c testproto.TestService_PingListClient 12 | } 13 | 14 | func (pcsw pingListWrapper) Recv() (*shared.Response, error) { 15 | resp, err := pcsw.c.Recv() 16 | if err != nil { 17 | return nil, err 18 | } 19 | 20 | return &shared.Response{ 21 | Value: resp.GetValue(), 22 | Counter: resp.GetCounter(), 23 | }, nil 24 | } 25 | 26 | func (pcsw pingListWrapper) Header() (metadata.MD, error) { 27 | return pcsw.c.Header() 28 | } 29 | 30 | func (pcsw pingListWrapper) Trailer() metadata.MD { 31 | return pcsw.c.Trailer() 32 | } 33 | -------------------------------------------------------------------------------- /test/shared/helpers.go: -------------------------------------------------------------------------------- 1 | package shared 2 | 3 | import ( 4 | "github.com/pkg/errors" 5 | ) 6 | 7 | func reportError(property string, got, wanted interface{}) error { 8 | return errors.Errorf("Unexpected %s seen, got %v, wanted %v", property, got, wanted) 9 | } 10 | 11 | func unexpectedError(function string, err error) error { 12 | return errors.Errorf("Unexpected %s error seen: %v", function, err) 13 | } 14 | -------------------------------------------------------------------------------- /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/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/go-test/deep/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright 2015-2017 Daniel Nichter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/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/github.com/golang/protobuf/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/github.com/gopherjs/gopherjs/compiler/analysis/bool.go: -------------------------------------------------------------------------------- 1 | package analysis 2 | 3 | import ( 4 | "go/ast" 5 | "go/constant" 6 | "go/token" 7 | "go/types" 8 | ) 9 | 10 | func BoolValue(expr ast.Expr, info *types.Info) (bool, bool) { 11 | v := info.Types[expr].Value 12 | if v != nil && v.Kind() == constant.Bool { 13 | return constant.BoolVal(v), true 14 | } 15 | switch e := expr.(type) { 16 | case *ast.BinaryExpr: 17 | switch e.Op { 18 | case token.LAND: 19 | if b, ok := BoolValue(e.X, info); ok { 20 | if !b { 21 | return false, true 22 | } 23 | return BoolValue(e.Y, info) 24 | } 25 | case token.LOR: 26 | if b, ok := BoolValue(e.X, info); ok { 27 | if b { 28 | return true, true 29 | } 30 | return BoolValue(e.Y, info) 31 | } 32 | } 33 | case *ast.UnaryExpr: 34 | if e.Op == token.NOT { 35 | if b, ok := BoolValue(e.X, info); ok { 36 | return !b, true 37 | } 38 | } 39 | case *ast.ParenExpr: 40 | return BoolValue(e.X, info) 41 | } 42 | return false, false 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/analysis/break.go: -------------------------------------------------------------------------------- 1 | package analysis 2 | 3 | import ( 4 | "go/ast" 5 | "go/token" 6 | ) 7 | 8 | func HasBreak(n ast.Node) bool { 9 | v := hasBreakVisitor{} 10 | ast.Walk(&v, n) 11 | return v.hasBreak 12 | } 13 | 14 | type hasBreakVisitor struct { 15 | hasBreak bool 16 | } 17 | 18 | func (v *hasBreakVisitor) Visit(node ast.Node) (w ast.Visitor) { 19 | if v.hasBreak { 20 | return nil 21 | } 22 | switch n := node.(type) { 23 | case *ast.BranchStmt: 24 | if n.Tok == token.BREAK && n.Label == nil { 25 | v.hasBreak = true 26 | return nil 27 | } 28 | case *ast.ForStmt, *ast.RangeStmt, *ast.SwitchStmt, *ast.TypeSwitchStmt, *ast.SelectStmt, ast.Expr: 29 | return nil 30 | } 31 | return v 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/analysis/sideeffect.go: -------------------------------------------------------------------------------- 1 | package analysis 2 | 3 | import ( 4 | "go/ast" 5 | "go/token" 6 | "go/types" 7 | ) 8 | 9 | func HasSideEffect(n ast.Node, info *types.Info) bool { 10 | v := hasSideEffectVisitor{info: info} 11 | ast.Walk(&v, n) 12 | return v.hasSideEffect 13 | } 14 | 15 | type hasSideEffectVisitor struct { 16 | info *types.Info 17 | hasSideEffect bool 18 | } 19 | 20 | func (v *hasSideEffectVisitor) Visit(node ast.Node) (w ast.Visitor) { 21 | if v.hasSideEffect { 22 | return nil 23 | } 24 | switch n := node.(type) { 25 | case *ast.CallExpr: 26 | if _, isSig := v.info.TypeOf(n.Fun).(*types.Signature); isSig { // skip conversions 27 | v.hasSideEffect = true 28 | return nil 29 | } 30 | case *ast.UnaryExpr: 31 | if n.Op == token.ARROW { 32 | v.hasSideEffect = true 33 | return nil 34 | } 35 | } 36 | return v 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/astutil/astutil.go: -------------------------------------------------------------------------------- 1 | package astutil 2 | 3 | import ( 4 | "go/ast" 5 | "go/types" 6 | ) 7 | 8 | func RemoveParens(e ast.Expr) ast.Expr { 9 | for { 10 | p, isParen := e.(*ast.ParenExpr) 11 | if !isParen { 12 | return e 13 | } 14 | e = p.X 15 | } 16 | } 17 | 18 | func SetType(info *types.Info, t types.Type, e ast.Expr) ast.Expr { 19 | info.Types[e] = types.TypeAndValue{Type: t} 20 | return e 21 | } 22 | 23 | func NewIdent(name string, t types.Type, info *types.Info, pkg *types.Package) *ast.Ident { 24 | ident := ast.NewIdent(name) 25 | info.Types[ident] = types.TypeAndValue{Type: t} 26 | obj := types.NewVar(0, pkg, name, t) 27 | info.Uses[ident] = obj 28 | return ident 29 | } 30 | 31 | func IsTypeExpr(expr ast.Expr, info *types.Info) bool { 32 | switch e := expr.(type) { 33 | case *ast.ArrayType, *ast.ChanType, *ast.FuncType, *ast.InterfaceType, *ast.MapType, *ast.StructType: 34 | return true 35 | case *ast.StarExpr: 36 | return IsTypeExpr(e.X, info) 37 | case *ast.Ident: 38 | _, ok := info.Uses[e].(*types.TypeName) 39 | return ok 40 | case *ast.SelectorExpr: 41 | _, ok := info.Uses[e.Sel].(*types.TypeName) 42 | return ok 43 | case *ast.ParenExpr: 44 | return IsTypeExpr(e.X, info) 45 | default: 46 | return false 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/filter/incdecstmt.go: -------------------------------------------------------------------------------- 1 | package filter 2 | 3 | import ( 4 | "go/ast" 5 | "go/constant" 6 | "go/token" 7 | "go/types" 8 | ) 9 | 10 | func IncDecStmt(stmt ast.Stmt, info *types.Info) ast.Stmt { 11 | if s, ok := stmt.(*ast.IncDecStmt); ok { 12 | t := info.TypeOf(s.X) 13 | if iExpr, isIExpr := s.X.(*ast.IndexExpr); isIExpr { 14 | switch u := info.TypeOf(iExpr.X).Underlying().(type) { 15 | case *types.Array: 16 | t = u.Elem() 17 | case *types.Slice: 18 | t = u.Elem() 19 | case *types.Map: 20 | t = u.Elem() 21 | } 22 | } 23 | 24 | tok := token.ADD_ASSIGN 25 | if s.Tok == token.DEC { 26 | tok = token.SUB_ASSIGN 27 | } 28 | 29 | one := &ast.BasicLit{Kind: token.INT} 30 | info.Types[one] = types.TypeAndValue{Type: t, Value: constant.MakeInt64(1)} 31 | 32 | return &ast.AssignStmt{ 33 | Lhs: []ast.Expr{s.X}, 34 | Tok: tok, 35 | Rhs: []ast.Expr{one}, 36 | } 37 | } 38 | return stmt 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/doc.go: -------------------------------------------------------------------------------- 1 | // Package gopherjspkg provides core GopherJS packages via a virtual filesystem. 2 | // 3 | // Core GopherJS packages are packages that are critical for GopherJS compiler 4 | // operation. They are needed to build the Go standard library with GopherJS. 5 | // Currently, they include: 6 | // 7 | // github.com/gopherjs/gopherjs/js 8 | // github.com/gopherjs/gopherjs/nosync 9 | // 10 | package gopherjspkg 11 | 12 | //go:generate vfsgendev -source="github.com/gopherjs/gopherjs/compiler/gopherjspkg".FS -tag=gopherjsdev 13 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/gopherjspkg/fs.go: -------------------------------------------------------------------------------- 1 | // +build gopherjsdev 2 | 3 | package gopherjspkg 4 | 5 | import ( 6 | "go/build" 7 | "log" 8 | "net/http" 9 | "os" 10 | pathpkg "path" 11 | 12 | "github.com/shurcooL/httpfs/filter" 13 | ) 14 | 15 | // FS is a virtual filesystem that contains core GopherJS packages. 16 | var FS = filter.Keep( 17 | http.Dir(importPathToDir("github.com/gopherjs/gopherjs")), 18 | func(path string, fi os.FileInfo) bool { 19 | return path == "/" || 20 | path == "/js" || (pathpkg.Dir(path) == "/js" && !fi.IsDir()) || 21 | path == "/nosync" || (pathpkg.Dir(path) == "/nosync" && !fi.IsDir()) 22 | }, 23 | ) 24 | 25 | func importPathToDir(importPath string) string { 26 | p, err := build.Import(importPath, "", build.FindOnly) 27 | if err != nil { 28 | log.Fatalln(err) 29 | } 30 | return p.Dir 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/natives/doc.go: -------------------------------------------------------------------------------- 1 | // Package natives provides native packages via a virtual filesystem. 2 | // 3 | // See documentation of parseAndAugment in github.com/gopherjs/gopherjs/build 4 | // for explanation of behavior used to augment the native packages using the files 5 | // in src subfolder. 6 | package natives 7 | 8 | //go:generate vfsgendev -source="github.com/gopherjs/gopherjs/compiler/natives".FS -tag=gopherjsdev 9 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/natives/fs.go: -------------------------------------------------------------------------------- 1 | // +build gopherjsdev 2 | 3 | package natives 4 | 5 | import ( 6 | "go/build" 7 | "log" 8 | "net/http" 9 | "os" 10 | "strings" 11 | 12 | "github.com/shurcooL/httpfs/filter" 13 | ) 14 | 15 | // FS is a virtual filesystem that contains native packages. 16 | var FS = filter.Keep( 17 | http.Dir(importPathToDir("github.com/gopherjs/gopherjs/compiler/natives")), 18 | func(path string, fi os.FileInfo) bool { 19 | return path == "/" || path == "/src" || strings.HasPrefix(path, "/src/") 20 | }, 21 | ) 22 | 23 | func importPathToDir(importPath string) string { 24 | p, err := build.Import(importPath, "", build.FindOnly) 25 | if err != nil { 26 | log.Fatalln(err) 27 | } 28 | return p.Dir 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/typesutil/typesutil.go: -------------------------------------------------------------------------------- 1 | package typesutil 2 | 3 | import "go/types" 4 | 5 | func IsJsPackage(pkg *types.Package) bool { 6 | return pkg != nil && pkg.Path() == "github.com/gopherjs/gopherjs/js" 7 | } 8 | 9 | func IsJsObject(t types.Type) bool { 10 | ptr, isPtr := t.(*types.Pointer) 11 | if !isPtr { 12 | return false 13 | } 14 | named, isNamed := ptr.Elem().(*types.Named) 15 | return isNamed && IsJsPackage(named.Obj().Pkg()) && named.Obj().Name() == "Object" 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/compiler/version_check.go: -------------------------------------------------------------------------------- 1 | // +build !go1.11 2 | // +build go1.10 3 | 4 | package compiler 5 | 6 | const ___GOPHERJS_REQUIRES_GO_VERSION_1_10___ = true 7 | 8 | // Version is the GopherJS compiler version string. 9 | const Version = "1.10-4" 10 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | // Package sysutil contains system-specific utilities. 4 | package sysutil 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | // RlimitStack reports the current stack size limit in bytes. 9 | func RlimitStack() (cur uint64, err error) { 10 | var r unix.Rlimit 11 | err = unix.Getrlimit(unix.RLIMIT_STACK, &r) 12 | return uint64(r.Cur), err // Type conversion because Cur is one of uint64, int64 depending on unix flavor. 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/gopherjs/gopherjs/internal/sysutil/sysutil_windows.go: -------------------------------------------------------------------------------- 1 | package sysutil 2 | 3 | import "errors" 4 | 5 | func RlimitStack() (uint64, error) { 6 | return 0, errors.New("RlimitStack is not implemented on Windows") 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Gorilla WebSocket authors for copyright 2 | # purposes. 3 | # 4 | # Please keep the list sorted. 5 | 6 | Gary Burd 7 | Joachim Bauch 8 | 9 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/client_clone.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.8 6 | 7 | package websocket 8 | 9 | import "crypto/tls" 10 | 11 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 12 | if cfg == nil { 13 | return &tls.Config{} 14 | } 15 | return cfg.Clone() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_read.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.5 6 | 7 | package websocket 8 | 9 | import "io" 10 | 11 | func (c *Conn) read(n int) ([]byte, error) { 12 | p, err := c.br.Peek(n) 13 | if err == io.EOF { 14 | err = errUnexpectedEOF 15 | } 16 | c.br.Discard(len(p)) 17 | return p, err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_read_legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.5 6 | 7 | package websocket 8 | 9 | import "io" 10 | 11 | func (c *Conn) read(n int) ([]byte, error) { 12 | p, err := c.br.Peek(n) 13 | if err == io.EOF { 14 | err = errUnexpectedEOF 15 | } 16 | if len(p) > 0 { 17 | // advance over the bytes just read 18 | io.ReadFull(c.br, p) 19 | } 20 | return p, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/mask_safe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of 2 | // this source code is governed by a BSD-style license that can be found in the 3 | // LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package websocket 8 | 9 | func maskBytes(key [4]byte, pos int, b []byte) int { 10 | for i := range b { 11 | b[i] ^= key[pos&3] 12 | pos++ 13 | } 14 | return pos & 3 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/improbable-eng/grpc-web/go/grpcweb/README.md: -------------------------------------------------------------------------------- 1 | DOC.md -------------------------------------------------------------------------------- /vendor/github.com/improbable-eng/grpc-web/go/grpcweb/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Improbable. All Rights Reserved. 2 | // See LICENSE for licensing terms. 3 | 4 | /* 5 | `grpcweb` implements the gRPC-Web spec as a wrapper around a gRPC-Go Server. 6 | 7 | It allows web clients (see companion JS library) to talk to gRPC-Go servers over the gRPC-Web spec. It supports 8 | HTTP/1.1 and HTTP2 encoding of a gRPC stream and supports unary and server-side streaming RPCs. Bi-di and client 9 | streams are unsupported due to limitations in browser protocol support. 10 | 11 | See https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md for the protocol specification. 12 | 13 | Here's an example of how to use it inside an existing gRPC Go server on a separate http.Server that serves over TLS: 14 | 15 | grpcServer := grpc.Server() 16 | wrappedGrpc := grpcweb.WrapServer(grpcServer) 17 | tlsHttpServer.Handler = http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) { 18 | if wrappedGrpc.IsGrpcWebRequest(req) { 19 | wrappedGrpc.ServeHTTP(resp, req) 20 | } 21 | // Fall back to other servers. 22 | http.DefaultServeMux.ServeHTTP(resp, req) 23 | }) 24 | 25 | If you'd like to have a standalone binary, please take a look at `grpcwebproxy`. 26 | 27 | */ 28 | package grpcweb 29 | -------------------------------------------------------------------------------- /vendor/github.com/improbable-eng/grpc-web/go/grpcweb/helpers.go: -------------------------------------------------------------------------------- 1 | //Copyright 2017 Improbable. All Rights Reserved. 2 | // See LICENSE for licensing terms. 3 | 4 | package grpcweb 5 | 6 | import ( 7 | "fmt" 8 | 9 | "google.golang.org/grpc" 10 | ) 11 | 12 | // ListGRPCResources is a helper function that lists all URLs that are registered on gRPC server. 13 | // 14 | // This makes it easy to register all the relevant routes in your HTTP router of choice. 15 | func ListGRPCResources(server *grpc.Server) []string { 16 | ret := []string{} 17 | for serviceName, serviceInfo := range server.GetServiceInfo() { 18 | for _, methodInfo := range serviceInfo.Methods { 19 | fullResource := fmt.Sprintf("/%s/%s", serviceName, methodInfo.Name) 20 | ret = append(ret, fullResource) 21 | } 22 | } 23 | return ret 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Alan Shreve 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/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package mousetrap 4 | 5 | // StartedByExplorer returns true if the program was invoked by the user 6 | // double-clicking on the executable from explorer.exe 7 | // 8 | // It is conservative and returns false if any of the internal calls fail. 9 | // It does not guarantee that the program was run from a terminal. It only can tell you 10 | // whether it was launched from explorer.exe 11 | // 12 | // On non-Windows platforms, it always returns false. 13 | func StartedByExplorer() bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/kisielk/gotool/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Kamil Kisiel 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/kisielk/gotool/go13.go: -------------------------------------------------------------------------------- 1 | // +build !go1.4 2 | 3 | package gotool 4 | 5 | import ( 6 | "go/build" 7 | "path/filepath" 8 | "runtime" 9 | ) 10 | 11 | var gorootSrc = filepath.Join(runtime.GOROOT(), "src", "pkg") 12 | 13 | func shouldIgnoreImport(p *build.Package) bool { 14 | return true 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/kisielk/gotool/go14-15.go: -------------------------------------------------------------------------------- 1 | // +build go1.4,!go1.6 2 | 3 | package gotool 4 | 5 | import ( 6 | "go/build" 7 | "path/filepath" 8 | "runtime" 9 | ) 10 | 11 | var gorootSrc = filepath.Join(runtime.GOROOT(), "src") 12 | 13 | func shouldIgnoreImport(p *build.Package) bool { 14 | return true 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/kisielk/gotool/go16-18.go: -------------------------------------------------------------------------------- 1 | // +build go1.6,!go1.9 2 | 3 | package gotool 4 | 5 | import ( 6 | "go/build" 7 | "path/filepath" 8 | "runtime" 9 | ) 10 | 11 | var gorootSrc = filepath.Join(runtime.GOROOT(), "src") 12 | 13 | func shouldIgnoreImport(p *build.Package) bool { 14 | return p == nil || len(p.InvalidGoFiles) == 0 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/kisielk/gotool/internal/load/path.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package load 8 | 9 | import ( 10 | "strings" 11 | ) 12 | 13 | // hasPathPrefix reports whether the path s begins with the 14 | // elements in prefix. 15 | func hasPathPrefix(s, prefix string) bool { 16 | switch { 17 | default: 18 | return false 19 | case len(s) == len(prefix): 20 | return s == prefix 21 | case len(s) > len(prefix): 22 | if prefix != "" && prefix[len(prefix)-1] == '/' { 23 | return strings.HasPrefix(s, prefix) 24 | } 25 | return s[len(prefix)] == '/' && s[:len(prefix)] == prefix 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/kisielk/gotool/internal/load/pkg.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 | // +build go1.9 6 | 7 | // Package load loads packages. 8 | package load 9 | 10 | import ( 11 | "strings" 12 | ) 13 | 14 | // isStandardImportPath reports whether $GOROOT/src/path should be considered 15 | // part of the standard distribution. For historical reasons we allow people to add 16 | // their own code to $GOROOT instead of using $GOPATH, but we assume that 17 | // code will start with a domain name (dot in the first element). 18 | func isStandardImportPath(path string) bool { 19 | i := strings.Index(path, "/") 20 | if i < 0 { 21 | i = len(path) 22 | } 23 | elem := path[:i] 24 | return !strings.Contains(elem, ".") 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Onsi Fakhouri 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/convert_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "github.com/onsi/ginkgo/ginkgo/convert" 7 | "os" 8 | ) 9 | 10 | func BuildConvertCommand() *Command { 11 | return &Command{ 12 | Name: "convert", 13 | FlagSet: flag.NewFlagSet("convert", flag.ExitOnError), 14 | UsageCommand: "ginkgo convert /path/to/package", 15 | Usage: []string{ 16 | "Convert the package at the passed in path from an XUnit-style test to a Ginkgo-style test", 17 | }, 18 | Command: convertPackage, 19 | } 20 | } 21 | 22 | func convertPackage(args []string, additionalArgs []string) { 23 | if len(args) != 1 { 24 | println(fmt.Sprintf("usage: ginkgo convert /path/to/your/package")) 25 | os.Exit(1) 26 | } 27 | 28 | defer func() { 29 | err := recover() 30 | if err != nil { 31 | switch err := err.(type) { 32 | case error: 33 | println(err.Error()) 34 | case string: 35 | println(err) 36 | default: 37 | println(fmt.Sprintf("unexpected error: %#v", err)) 38 | } 39 | os.Exit(1) 40 | } 41 | }() 42 | 43 | convert.RewritePackage(args[0]) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/help_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | ) 7 | 8 | func BuildHelpCommand() *Command { 9 | return &Command{ 10 | Name: "help", 11 | FlagSet: flag.NewFlagSet("help", flag.ExitOnError), 12 | UsageCommand: "ginkgo help ", 13 | Usage: []string{ 14 | "Print usage information. If a command is passed in, print usage information just for that command.", 15 | }, 16 | Command: printHelp, 17 | } 18 | } 19 | 20 | func printHelp(args []string, additionalArgs []string) { 21 | if len(args) == 0 { 22 | usage() 23 | } else { 24 | command, found := commandMatching(args[0]) 25 | if !found { 26 | complainAndQuit(fmt.Sprintf("Unknown command: %s", args[0])) 27 | } 28 | 29 | usageForCommand(command, true) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go: -------------------------------------------------------------------------------- 1 | package interrupthandler 2 | 3 | import ( 4 | "os" 5 | "os/signal" 6 | "sync" 7 | "syscall" 8 | ) 9 | 10 | type InterruptHandler struct { 11 | interruptCount int 12 | lock *sync.Mutex 13 | C chan bool 14 | } 15 | 16 | func NewInterruptHandler() *InterruptHandler { 17 | h := &InterruptHandler{ 18 | lock: &sync.Mutex{}, 19 | C: make(chan bool, 0), 20 | } 21 | 22 | go h.handleInterrupt() 23 | SwallowSigQuit() 24 | 25 | return h 26 | } 27 | 28 | func (h *InterruptHandler) WasInterrupted() bool { 29 | h.lock.Lock() 30 | defer h.lock.Unlock() 31 | 32 | return h.interruptCount > 0 33 | } 34 | 35 | func (h *InterruptHandler) handleInterrupt() { 36 | c := make(chan os.Signal, 1) 37 | signal.Notify(c, os.Interrupt, syscall.SIGTERM) 38 | 39 | <-c 40 | signal.Stop(c) 41 | 42 | h.lock.Lock() 43 | h.interruptCount++ 44 | if h.interruptCount == 1 { 45 | close(h.C) 46 | } else if h.interruptCount > 5 { 47 | os.Exit(1) 48 | } 49 | h.lock.Unlock() 50 | 51 | go h.handleInterrupt() 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_unix.go: -------------------------------------------------------------------------------- 1 | // +build freebsd openbsd netbsd dragonfly darwin linux solaris 2 | 3 | package interrupthandler 4 | 5 | import ( 6 | "os" 7 | "os/signal" 8 | "syscall" 9 | ) 10 | 11 | func SwallowSigQuit() { 12 | c := make(chan os.Signal, 1024) 13 | signal.Notify(c, syscall.SIGQUIT) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package interrupthandler 4 | 5 | func SwallowSigQuit() { 6 | //noop 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/testrunner/log_writer.go: -------------------------------------------------------------------------------- 1 | package testrunner 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "io" 7 | "log" 8 | "strings" 9 | "sync" 10 | ) 11 | 12 | type logWriter struct { 13 | buffer *bytes.Buffer 14 | lock *sync.Mutex 15 | log *log.Logger 16 | } 17 | 18 | func newLogWriter(target io.Writer, node int) *logWriter { 19 | return &logWriter{ 20 | buffer: &bytes.Buffer{}, 21 | lock: &sync.Mutex{}, 22 | log: log.New(target, fmt.Sprintf("[%d] ", node), 0), 23 | } 24 | } 25 | 26 | func (w *logWriter) Write(data []byte) (n int, err error) { 27 | w.lock.Lock() 28 | defer w.lock.Unlock() 29 | 30 | w.buffer.Write(data) 31 | contents := w.buffer.String() 32 | 33 | lines := strings.Split(contents, "\n") 34 | for _, line := range lines[0 : len(lines)-1] { 35 | w.log.Println(line) 36 | } 37 | 38 | w.buffer.Reset() 39 | w.buffer.Write([]byte(lines[len(lines)-1])) 40 | return len(data), nil 41 | } 42 | 43 | func (w *logWriter) Close() error { 44 | w.lock.Lock() 45 | defer w.lock.Unlock() 46 | 47 | if w.buffer.Len() > 0 { 48 | w.log.Println(w.buffer.String()) 49 | } 50 | 51 | return nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/testrunner/run_result.go: -------------------------------------------------------------------------------- 1 | package testrunner 2 | 3 | type RunResult struct { 4 | Passed bool 5 | HasProgrammaticFocus bool 6 | } 7 | 8 | func PassingRunResult() RunResult { 9 | return RunResult{ 10 | Passed: true, 11 | HasProgrammaticFocus: false, 12 | } 13 | } 14 | 15 | func FailingRunResult() RunResult { 16 | return RunResult{ 17 | Passed: false, 18 | HasProgrammaticFocus: false, 19 | } 20 | } 21 | 22 | func (r RunResult) Merge(o RunResult) RunResult { 23 | return RunResult{ 24 | Passed: r.Passed && o.Passed, 25 | HasProgrammaticFocus: r.HasProgrammaticFocus || o.HasProgrammaticFocus, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15.go: -------------------------------------------------------------------------------- 1 | // +build !go1.6 2 | 3 | package testsuite 4 | 5 | import ( 6 | "os" 7 | "path" 8 | ) 9 | 10 | // "This change will only be enabled if the go command is run with 11 | // GO15VENDOREXPERIMENT=1 in its environment." 12 | // c.f. the vendor-experiment proposal https://goo.gl/2ucMeC 13 | func vendorExperimentCheck(dir string) bool { 14 | vendorExperiment := os.Getenv("GO15VENDOREXPERIMENT") 15 | return vendorExperiment == "1" && path.Base(dir) == "vendor" 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go16.go: -------------------------------------------------------------------------------- 1 | // +build go1.6 2 | 3 | package testsuite 4 | 5 | import ( 6 | "os" 7 | "path" 8 | ) 9 | 10 | // in 1.6 the vendor directory became the default go behaviour, so now 11 | // check if its disabled. 12 | func vendorExperimentCheck(dir string) bool { 13 | vendorExperiment := os.Getenv("GO15VENDOREXPERIMENT") 14 | return vendorExperiment != "0" && path.Base(dir) == "vendor" 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/unfocus_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "os/exec" 7 | ) 8 | 9 | func BuildUnfocusCommand() *Command { 10 | return &Command{ 11 | Name: "unfocus", 12 | AltName: "blur", 13 | FlagSet: flag.NewFlagSet("unfocus", flag.ExitOnError), 14 | UsageCommand: "ginkgo unfocus (or ginkgo blur)", 15 | Usage: []string{ 16 | "Recursively unfocuses any focused tests under the current directory", 17 | }, 18 | Command: unfocusSpecs, 19 | } 20 | } 21 | 22 | func unfocusSpecs([]string, []string) { 23 | unfocus("Describe") 24 | unfocus("Context") 25 | unfocus("It") 26 | unfocus("Measure") 27 | unfocus("DescribeTable") 28 | unfocus("Entry") 29 | } 30 | 31 | func unfocus(component string) { 32 | fmt.Printf("Removing F%s...\n", component) 33 | cmd := exec.Command("gofmt", fmt.Sprintf("-r=F%s -> %s", component, component), "-w", ".") 34 | out, _ := cmd.CombinedOutput() 35 | if string(out) != "" { 36 | println(string(out)) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/version_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "github.com/onsi/ginkgo/config" 7 | ) 8 | 9 | func BuildVersionCommand() *Command { 10 | return &Command{ 11 | Name: "version", 12 | FlagSet: flag.NewFlagSet("version", flag.ExitOnError), 13 | UsageCommand: "ginkgo version", 14 | Usage: []string{ 15 | "Print Ginkgo's version", 16 | }, 17 | Command: printVersion, 18 | } 19 | } 20 | 21 | func printVersion([]string, []string) { 22 | fmt.Printf("Ginkgo Version %s\n", config.VERSION) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/watch/delta.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | import "sort" 4 | 5 | type Delta struct { 6 | ModifiedPackages []string 7 | 8 | NewSuites []*Suite 9 | RemovedSuites []*Suite 10 | modifiedSuites []*Suite 11 | } 12 | 13 | type DescendingByDelta []*Suite 14 | 15 | func (a DescendingByDelta) Len() int { return len(a) } 16 | func (a DescendingByDelta) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 17 | func (a DescendingByDelta) Less(i, j int) bool { return a[i].Delta() > a[j].Delta() } 18 | 19 | func (d Delta) ModifiedSuites() []*Suite { 20 | sort.Sort(DescendingByDelta(d.modifiedSuites)) 21 | return d.modifiedSuites 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/codelocation/code_location.go: -------------------------------------------------------------------------------- 1 | package codelocation 2 | 3 | import ( 4 | "regexp" 5 | "runtime" 6 | "runtime/debug" 7 | "strings" 8 | 9 | "github.com/onsi/ginkgo/types" 10 | ) 11 | 12 | func New(skip int) types.CodeLocation { 13 | _, file, line, _ := runtime.Caller(skip + 1) 14 | stackTrace := PruneStack(string(debug.Stack()), skip) 15 | return types.CodeLocation{FileName: file, LineNumber: line, FullStackTrace: stackTrace} 16 | } 17 | 18 | func PruneStack(fullStackTrace string, skip int) string { 19 | stack := strings.Split(fullStackTrace, "\n") 20 | if len(stack) > 2*(skip+1) { 21 | stack = stack[2*(skip+1):] 22 | } 23 | prunedStack := []string{} 24 | re := regexp.MustCompile(`\/ginkgo\/|\/pkg\/testing\/|\/pkg\/runtime\/`) 25 | for i := 0; i < len(stack)/2; i++ { 26 | if !re.Match([]byte(stack[i*2])) { 27 | prunedStack = append(prunedStack, stack[i*2]) 28 | prunedStack = append(prunedStack, stack[i*2+1]) 29 | } 30 | } 31 | return strings.Join(prunedStack, "\n") 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/interfaces.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/types" 5 | ) 6 | 7 | type BasicNode interface { 8 | Type() types.SpecComponentType 9 | Run() (types.SpecState, types.SpecFailure) 10 | CodeLocation() types.CodeLocation 11 | } 12 | 13 | type SubjectNode interface { 14 | BasicNode 15 | 16 | Text() string 17 | Flag() types.FlagType 18 | Samples() int 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/internal/failer" 5 | "github.com/onsi/ginkgo/types" 6 | "time" 7 | ) 8 | 9 | type ItNode struct { 10 | runner *runner 11 | 12 | flag types.FlagType 13 | text string 14 | } 15 | 16 | func NewItNode(text string, body interface{}, flag types.FlagType, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *ItNode { 17 | return &ItNode{ 18 | runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeIt, componentIndex), 19 | flag: flag, 20 | text: text, 21 | } 22 | } 23 | 24 | func (node *ItNode) Run() (outcome types.SpecState, failure types.SpecFailure) { 25 | return node.runner.run() 26 | } 27 | 28 | func (node *ItNode) Type() types.SpecComponentType { 29 | return types.SpecComponentTypeIt 30 | } 31 | 32 | func (node *ItNode) Text() string { 33 | return node.text 34 | } 35 | 36 | func (node *ItNode) Flag() types.FlagType { 37 | return node.flag 38 | } 39 | 40 | func (node *ItNode) CodeLocation() types.CodeLocation { 41 | return node.runner.codeLocation 42 | } 43 | 44 | func (node *ItNode) Samples() int { 45 | return 1 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor.go: -------------------------------------------------------------------------------- 1 | package remote 2 | 3 | /* 4 | The OutputInterceptor is used by the ForwardingReporter to 5 | intercept and capture all stdin and stderr output during a test run. 6 | */ 7 | type OutputInterceptor interface { 8 | StartInterceptingOutput() error 9 | StopInterceptingAndReturnOutput() (string, error) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package remote 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | func NewOutputInterceptor() OutputInterceptor { 10 | return &outputInterceptor{} 11 | } 12 | 13 | type outputInterceptor struct { 14 | intercepting bool 15 | } 16 | 17 | func (interceptor *outputInterceptor) StartInterceptingOutput() error { 18 | if interceptor.intercepting { 19 | return errors.New("Already intercepting output!") 20 | } 21 | interceptor.intercepting = true 22 | 23 | // not working on windows... 24 | 25 | return nil 26 | } 27 | 28 | func (interceptor *outputInterceptor) StopInterceptingAndReturnOutput() (string, error) { 29 | // not working on windows... 30 | interceptor.intercepting = false 31 | 32 | return "", nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm64 2 | 3 | package remote 4 | 5 | import "syscall" 6 | 7 | // linux_arm64 doesn't have syscall.Dup2 which ginkgo uses, so 8 | // use the nearly identical syscall.Dup3 instead 9 | func syscallDup(oldfd int, newfd int) (err error) { 10 | return syscall.Dup3(oldfd, newfd, 0) 11 | } -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package remote 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | func syscallDup(oldfd int, newfd int) (err error) { 8 | return unix.Dup2(oldfd, newfd) 9 | } -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go: -------------------------------------------------------------------------------- 1 | // +build !linux !arm64 2 | // +build !windows 3 | // +build !solaris 4 | 5 | package remote 6 | 7 | import "syscall" 8 | 9 | func syscallDup(oldfd int, newfd int) (err error) { 10 | return syscall.Dup2(oldfd, newfd) 11 | } -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator.go: -------------------------------------------------------------------------------- 1 | package spec_iterator 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/internal/spec" 5 | ) 6 | 7 | type SerialIterator struct { 8 | specs []*spec.Spec 9 | index int 10 | } 11 | 12 | func NewSerialIterator(specs []*spec.Spec) *SerialIterator { 13 | return &SerialIterator{ 14 | specs: specs, 15 | index: 0, 16 | } 17 | } 18 | 19 | func (s *SerialIterator) Next() (*spec.Spec, error) { 20 | if s.index >= len(s.specs) { 21 | return nil, ErrClosed 22 | } 23 | 24 | spec := s.specs[s.index] 25 | s.index += 1 26 | return spec, nil 27 | } 28 | 29 | func (s *SerialIterator) NumberOfSpecsPriorToIteration() int { 30 | return len(s.specs) 31 | } 32 | 33 | func (s *SerialIterator) NumberOfSpecsToProcessIfKnown() (int, bool) { 34 | return len(s.specs), true 35 | } 36 | 37 | func (s *SerialIterator) NumberOfSpecsThatWillBeRunIfKnown() (int, bool) { 38 | count := 0 39 | for _, s := range s.specs { 40 | if !s.Skipped() && !s.Pending() { 41 | count += 1 42 | } 43 | } 44 | return count, true 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator.go: -------------------------------------------------------------------------------- 1 | package spec_iterator 2 | 3 | import "github.com/onsi/ginkgo/internal/spec" 4 | 5 | type ShardedParallelIterator struct { 6 | specs []*spec.Spec 7 | index int 8 | maxIndex int 9 | } 10 | 11 | func NewShardedParallelIterator(specs []*spec.Spec, total int, node int) *ShardedParallelIterator { 12 | startIndex, count := ParallelizedIndexRange(len(specs), total, node) 13 | 14 | return &ShardedParallelIterator{ 15 | specs: specs, 16 | index: startIndex, 17 | maxIndex: startIndex + count, 18 | } 19 | } 20 | 21 | func (s *ShardedParallelIterator) Next() (*spec.Spec, error) { 22 | if s.index >= s.maxIndex { 23 | return nil, ErrClosed 24 | } 25 | 26 | spec := s.specs[s.index] 27 | s.index += 1 28 | return spec, nil 29 | } 30 | 31 | func (s *ShardedParallelIterator) NumberOfSpecsPriorToIteration() int { 32 | return len(s.specs) 33 | } 34 | 35 | func (s *ShardedParallelIterator) NumberOfSpecsToProcessIfKnown() (int, bool) { 36 | return s.maxIndex - s.index, true 37 | } 38 | 39 | func (s *ShardedParallelIterator) NumberOfSpecsThatWillBeRunIfKnown() (int, bool) { 40 | count := 0 41 | for i := s.index; i < s.maxIndex; i += 1 { 42 | if !s.specs[i].Skipped() && !s.specs[i].Pending() { 43 | count += 1 44 | } 45 | } 46 | return count, true 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator.go: -------------------------------------------------------------------------------- 1 | package spec_iterator 2 | 3 | import ( 4 | "errors" 5 | 6 | "github.com/onsi/ginkgo/internal/spec" 7 | ) 8 | 9 | var ErrClosed = errors.New("no more specs to run") 10 | 11 | type SpecIterator interface { 12 | Next() (*spec.Spec, error) 13 | NumberOfSpecsPriorToIteration() int 14 | NumberOfSpecsToProcessIfKnown() (int, bool) 15 | NumberOfSpecsThatWillBeRunIfKnown() (int, bool) 16 | } 17 | 18 | type Counter struct { 19 | Index int `json:"index"` 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/specrunner/random_id.go: -------------------------------------------------------------------------------- 1 | package specrunner 2 | 3 | import ( 4 | "crypto/rand" 5 | "fmt" 6 | ) 7 | 8 | func randomID() string { 9 | b := make([]byte, 8) 10 | _, err := rand.Read(b) 11 | if err != nil { 12 | return "" 13 | } 14 | return fmt.Sprintf("%x-%x-%x-%x", b[0:2], b[2:4], b[4:6], b[6:8]) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/writer/fake_writer.go: -------------------------------------------------------------------------------- 1 | package writer 2 | 3 | type FakeGinkgoWriter struct { 4 | EventStream []string 5 | } 6 | 7 | func NewFake() *FakeGinkgoWriter { 8 | return &FakeGinkgoWriter{ 9 | EventStream: []string{}, 10 | } 11 | } 12 | 13 | func (writer *FakeGinkgoWriter) AddEvent(event string) { 14 | writer.EventStream = append(writer.EventStream, event) 15 | } 16 | 17 | func (writer *FakeGinkgoWriter) Truncate() { 18 | writer.EventStream = append(writer.EventStream, "TRUNCATE") 19 | } 20 | 21 | func (writer *FakeGinkgoWriter) DumpOut() { 22 | writer.EventStream = append(writer.EventStream, "DUMP") 23 | } 24 | 25 | func (writer *FakeGinkgoWriter) DumpOutWithHeader(header string) { 26 | writer.EventStream = append(writer.EventStream, "DUMP_WITH_HEADER: "+header) 27 | } 28 | 29 | func (writer *FakeGinkgoWriter) Bytes() []byte { 30 | writer.EventStream = append(writer.EventStream, "BYTES") 31 | return nil 32 | } 33 | 34 | func (writer *FakeGinkgoWriter) Write(data []byte) (n int, err error) { 35 | return 0, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/reporter.go: -------------------------------------------------------------------------------- 1 | package reporters 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/config" 5 | "github.com/onsi/ginkgo/types" 6 | ) 7 | 8 | type Reporter interface { 9 | SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) 10 | BeforeSuiteDidRun(setupSummary *types.SetupSummary) 11 | SpecWillRun(specSummary *types.SpecSummary) 12 | SpecDidComplete(specSummary *types.SpecSummary) 13 | AfterSuiteDidRun(setupSummary *types.SetupSummary) 14 | SpecSuiteDidEnd(summary *types.SuiteSummary) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | func NewColorable(file *os.File) io.Writer { 11 | if file == nil { 12 | panic("nil passed instead of *os.File to NewColorable()") 13 | } 14 | 15 | return file 16 | } 17 | 18 | func NewColorableStdout() io.Writer { 19 | return os.Stdout 20 | } 21 | 22 | func NewColorableStderr() io.Writer { 23 | return os.Stderr 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/noncolorable.go: -------------------------------------------------------------------------------- 1 | package colorable 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "io" 7 | ) 8 | 9 | type NonColorable struct { 10 | out io.Writer 11 | lastbuf bytes.Buffer 12 | } 13 | 14 | func NewNonColorable(w io.Writer) io.Writer { 15 | return &NonColorable{out: w} 16 | } 17 | 18 | func (w *NonColorable) Write(data []byte) (n int, err error) { 19 | er := bytes.NewBuffer(data) 20 | loop: 21 | for { 22 | c1, _, err := er.ReadRune() 23 | if err != nil { 24 | break loop 25 | } 26 | if c1 != 0x1b { 27 | fmt.Fprint(w.out, string(c1)) 28 | continue 29 | } 30 | c2, _, err := er.ReadRune() 31 | if err != nil { 32 | w.lastbuf.WriteRune(c1) 33 | break loop 34 | } 35 | if c2 != 0x5b { 36 | w.lastbuf.WriteRune(c1) 37 | w.lastbuf.WriteRune(c2) 38 | continue 39 | } 40 | 41 | var buf bytes.Buffer 42 | for { 43 | c, _, err := er.ReadRune() 44 | if err != nil { 45 | w.lastbuf.WriteRune(c1) 46 | w.lastbuf.WriteRune(c2) 47 | w.lastbuf.Write(buf.Bytes()) 48 | break loop 49 | } 50 | if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { 51 | break 52 | } 53 | buf.Write([]byte(string(c))) 54 | } 55 | } 56 | return len(data) - w.lastbuf.Len(), nil 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 12 | var procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var st uint32 17 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) 18 | return r != 0 && e == 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/code_location.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type CodeLocation struct { 8 | FileName string 9 | LineNumber int 10 | FullStackTrace string 11 | } 12 | 13 | func (codeLocation CodeLocation) String() string { 14 | return fmt.Sprintf("%s:%d", codeLocation.FileName, codeLocation.LineNumber) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/synchronization.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type RemoteBeforeSuiteState int 8 | 9 | const ( 10 | RemoteBeforeSuiteStateInvalid RemoteBeforeSuiteState = iota 11 | 12 | RemoteBeforeSuiteStatePending 13 | RemoteBeforeSuiteStatePassed 14 | RemoteBeforeSuiteStateFailed 15 | RemoteBeforeSuiteStateDisappeared 16 | ) 17 | 18 | type RemoteBeforeSuiteData struct { 19 | Data []byte 20 | State RemoteBeforeSuiteState 21 | } 22 | 23 | func (r RemoteBeforeSuiteData) ToJSON() []byte { 24 | data, _ := json.Marshal(r) 25 | return data 26 | } 27 | 28 | type RemoteAfterSuiteData struct { 29 | CanRun bool 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Onsi Fakhouri 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/gexec/prefixed_writer.go: -------------------------------------------------------------------------------- 1 | package gexec 2 | 3 | import ( 4 | "io" 5 | "sync" 6 | ) 7 | 8 | /* 9 | PrefixedWriter wraps an io.Writer, emiting the passed in prefix at the beginning of each new line. 10 | This can be useful when running multiple gexec.Sessions concurrently - you can prefix the log output of each 11 | session by passing in a PrefixedWriter: 12 | 13 | gexec.Start(cmd, NewPrefixedWriter("[my-cmd] ", GinkgoWriter), NewPrefixedWriter("[my-cmd] ", GinkgoWriter)) 14 | */ 15 | type PrefixedWriter struct { 16 | prefix []byte 17 | writer io.Writer 18 | lock *sync.Mutex 19 | atStartOfLine bool 20 | } 21 | 22 | func NewPrefixedWriter(prefix string, writer io.Writer) *PrefixedWriter { 23 | return &PrefixedWriter{ 24 | prefix: []byte(prefix), 25 | writer: writer, 26 | lock: &sync.Mutex{}, 27 | atStartOfLine: true, 28 | } 29 | } 30 | 31 | func (w *PrefixedWriter) Write(b []byte) (int, error) { 32 | w.lock.Lock() 33 | defer w.lock.Unlock() 34 | 35 | toWrite := []byte{} 36 | 37 | for _, c := range b { 38 | if w.atStartOfLine { 39 | toWrite = append(toWrite, w.prefix...) 40 | } 41 | 42 | toWrite = append(toWrite, c) 43 | 44 | w.atStartOfLine = c == '\n' 45 | } 46 | 47 | _, err := w.writer.Write(toWrite) 48 | if err != nil { 49 | return 0, err 50 | } 51 | 52 | return len(b), nil 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/internal/oraclematcher/oracle_matcher.go: -------------------------------------------------------------------------------- 1 | package oraclematcher 2 | 3 | import "github.com/onsi/gomega/types" 4 | 5 | /* 6 | GomegaMatchers that also match the OracleMatcher interface can convey information about 7 | whether or not their result will change upon future attempts. 8 | 9 | This allows `Eventually` and `Consistently` to short circuit if success becomes impossible. 10 | 11 | For example, a process' exit code can never change. So, gexec's Exit matcher returns `true` 12 | for `MatchMayChangeInTheFuture` until the process exits, at which point it returns `false` forevermore. 13 | */ 14 | type OracleMatcher interface { 15 | MatchMayChangeInTheFuture(actual interface{}) bool 16 | } 17 | 18 | func MatchMayChangeInTheFuture(matcher types.GomegaMatcher, value interface{}) bool { 19 | oracleMatcher, ok := matcher.(OracleMatcher) 20 | if !ok { 21 | return true 22 | } 23 | 24 | return oracleMatcher.MatchMayChangeInTheFuture(value) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/internal/testingtsupport/testing_t_support.go: -------------------------------------------------------------------------------- 1 | package testingtsupport 2 | 3 | import ( 4 | "regexp" 5 | "runtime/debug" 6 | "strings" 7 | 8 | "github.com/onsi/gomega/types" 9 | ) 10 | 11 | type gomegaTestingT interface { 12 | Fatalf(format string, args ...interface{}) 13 | } 14 | 15 | func BuildTestingTGomegaFailHandler(t gomegaTestingT) types.GomegaFailHandler { 16 | return func(message string, callerSkip ...int) { 17 | skip := 1 18 | if len(callerSkip) > 0 { 19 | skip = callerSkip[0] 20 | } 21 | stackTrace := pruneStack(string(debug.Stack()), skip) 22 | t.Fatalf("\n%s\n%s", stackTrace, message) 23 | } 24 | } 25 | 26 | func pruneStack(fullStackTrace string, skip int) string { 27 | stack := strings.Split(fullStackTrace, "\n") 28 | if len(stack) > 2*(skip+1) { 29 | stack = stack[2*(skip+1):] 30 | } 31 | prunedStack := []string{} 32 | re := regexp.MustCompile(`\/ginkgo\/|\/pkg\/testing\/|\/pkg\/runtime\/`) 33 | for i := 0; i < len(stack)/2; i++ { 34 | if !re.Match([]byte(stack[i*2])) { 35 | prunedStack = append(prunedStack, stack[i*2]) 36 | prunedStack = append(prunedStack, stack[i*2+1]) 37 | } 38 | } 39 | return strings.Join(prunedStack, "\n") 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/assignable_to_type_of_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | 7 | "github.com/onsi/gomega/format" 8 | ) 9 | 10 | type AssignableToTypeOfMatcher struct { 11 | Expected interface{} 12 | } 13 | 14 | func (matcher *AssignableToTypeOfMatcher) Match(actual interface{}) (success bool, err error) { 15 | if actual == nil || matcher.Expected == nil { 16 | return false, fmt.Errorf("Refusing to compare to .\nBe explicit and use BeNil() instead. This is to avoid mistakes where both sides of an assertion are erroneously uninitialized.") 17 | } 18 | 19 | actualType := reflect.TypeOf(actual) 20 | expectedType := reflect.TypeOf(matcher.Expected) 21 | 22 | return actualType.AssignableTo(expectedType), nil 23 | } 24 | 25 | func (matcher *AssignableToTypeOfMatcher) FailureMessage(actual interface{}) string { 26 | return format.Message(actual, fmt.Sprintf("to be assignable to the type: %T", matcher.Expected)) 27 | } 28 | 29 | func (matcher *AssignableToTypeOfMatcher) NegatedFailureMessage(actual interface{}) string { 30 | return format.Message(actual, fmt.Sprintf("not to be assignable to the type: %T", matcher.Expected)) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/onsi/gomega/format" 8 | ) 9 | 10 | type BeAnExistingFileMatcher struct { 11 | expected interface{} 12 | } 13 | 14 | func (matcher *BeAnExistingFileMatcher) Match(actual interface{}) (success bool, err error) { 15 | actualFilename, ok := actual.(string) 16 | if !ok { 17 | return false, fmt.Errorf("BeAnExistingFileMatcher matcher expects a file path") 18 | } 19 | 20 | if _, err = os.Stat(actualFilename); err != nil { 21 | switch { 22 | case os.IsNotExist(err): 23 | return false, nil 24 | default: 25 | return false, err 26 | } 27 | } 28 | 29 | return true, nil 30 | } 31 | 32 | func (matcher *BeAnExistingFileMatcher) FailureMessage(actual interface{}) (message string) { 33 | return format.Message(actual, fmt.Sprintf("to exist")) 34 | } 35 | 36 | func (matcher *BeAnExistingFileMatcher) NegatedFailureMessage(actual interface{}) (message string) { 37 | return format.Message(actual, fmt.Sprintf("not to exist")) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_empty_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type BeEmptyMatcher struct { 9 | } 10 | 11 | func (matcher *BeEmptyMatcher) Match(actual interface{}) (success bool, err error) { 12 | length, ok := lengthOf(actual) 13 | if !ok { 14 | return false, fmt.Errorf("BeEmpty matcher expects a string/array/map/channel/slice. Got:\n%s", format.Object(actual, 1)) 15 | } 16 | 17 | return length == 0, nil 18 | } 19 | 20 | func (matcher *BeEmptyMatcher) FailureMessage(actual interface{}) (message string) { 21 | return format.Message(actual, "to be empty") 22 | } 23 | 24 | func (matcher *BeEmptyMatcher) NegatedFailureMessage(actual interface{}) (message string) { 25 | return format.Message(actual, "not to be empty") 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_equivalent_to_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | "reflect" 7 | ) 8 | 9 | type BeEquivalentToMatcher struct { 10 | Expected interface{} 11 | } 12 | 13 | func (matcher *BeEquivalentToMatcher) Match(actual interface{}) (success bool, err error) { 14 | if actual == nil && matcher.Expected == nil { 15 | return false, fmt.Errorf("Both actual and expected must not be nil.") 16 | } 17 | 18 | convertedActual := actual 19 | 20 | if actual != nil && matcher.Expected != nil && reflect.TypeOf(actual).ConvertibleTo(reflect.TypeOf(matcher.Expected)) { 21 | convertedActual = reflect.ValueOf(actual).Convert(reflect.TypeOf(matcher.Expected)).Interface() 22 | } 23 | 24 | return reflect.DeepEqual(convertedActual, matcher.Expected), nil 25 | } 26 | 27 | func (matcher *BeEquivalentToMatcher) FailureMessage(actual interface{}) (message string) { 28 | return format.Message(actual, "to be equivalent to", matcher.Expected) 29 | } 30 | 31 | func (matcher *BeEquivalentToMatcher) NegatedFailureMessage(actual interface{}) (message string) { 32 | return format.Message(actual, "not to be equivalent to", matcher.Expected) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_false_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type BeFalseMatcher struct { 9 | } 10 | 11 | func (matcher *BeFalseMatcher) Match(actual interface{}) (success bool, err error) { 12 | if !isBool(actual) { 13 | return false, fmt.Errorf("Expected a boolean. Got:\n%s", format.Object(actual, 1)) 14 | } 15 | 16 | return actual == false, nil 17 | } 18 | 19 | func (matcher *BeFalseMatcher) FailureMessage(actual interface{}) (message string) { 20 | return format.Message(actual, "to be false") 21 | } 22 | 23 | func (matcher *BeFalseMatcher) NegatedFailureMessage(actual interface{}) (message string) { 24 | return format.Message(actual, "not to be false") 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_identical_to.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | 7 | "github.com/onsi/gomega/format" 8 | ) 9 | 10 | type BeIdenticalToMatcher struct { 11 | Expected interface{} 12 | } 13 | 14 | func (matcher *BeIdenticalToMatcher) Match(actual interface{}) (success bool, matchErr error) { 15 | if actual == nil && matcher.Expected == nil { 16 | return false, fmt.Errorf("Refusing to compare to .\nBe explicit and use BeNil() instead. This is to avoid mistakes where both sides of an assertion are erroneously uninitialized.") 17 | } 18 | 19 | defer func() { 20 | if r := recover(); r != nil { 21 | if _, ok := r.(runtime.Error); ok { 22 | success = false 23 | matchErr = nil 24 | } 25 | } 26 | }() 27 | 28 | return actual == matcher.Expected, nil 29 | } 30 | 31 | func (matcher *BeIdenticalToMatcher) FailureMessage(actual interface{}) string { 32 | return format.Message(actual, "to be identical to", matcher.Expected) 33 | } 34 | 35 | func (matcher *BeIdenticalToMatcher) NegatedFailureMessage(actual interface{}) string { 36 | return format.Message(actual, "not to be identical to", matcher.Expected) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_nil_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import "github.com/onsi/gomega/format" 4 | 5 | type BeNilMatcher struct { 6 | } 7 | 8 | func (matcher *BeNilMatcher) Match(actual interface{}) (success bool, err error) { 9 | return isNil(actual), nil 10 | } 11 | 12 | func (matcher *BeNilMatcher) FailureMessage(actual interface{}) (message string) { 13 | return format.Message(actual, "to be nil") 14 | } 15 | 16 | func (matcher *BeNilMatcher) NegatedFailureMessage(actual interface{}) (message string) { 17 | return format.Message(actual, "not to be nil") 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_true_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type BeTrueMatcher struct { 9 | } 10 | 11 | func (matcher *BeTrueMatcher) Match(actual interface{}) (success bool, err error) { 12 | if !isBool(actual) { 13 | return false, fmt.Errorf("Expected a boolean. Got:\n%s", format.Object(actual, 1)) 14 | } 15 | 16 | return actual.(bool), nil 17 | } 18 | 19 | func (matcher *BeTrueMatcher) FailureMessage(actual interface{}) (message string) { 20 | return format.Message(actual, "to be true") 21 | } 22 | 23 | func (matcher *BeTrueMatcher) NegatedFailureMessage(actual interface{}) (message string) { 24 | return format.Message(actual, "not to be true") 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_zero_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "github.com/onsi/gomega/format" 5 | "reflect" 6 | ) 7 | 8 | type BeZeroMatcher struct { 9 | } 10 | 11 | func (matcher *BeZeroMatcher) Match(actual interface{}) (success bool, err error) { 12 | if actual == nil { 13 | return true, nil 14 | } 15 | zeroValue := reflect.Zero(reflect.TypeOf(actual)).Interface() 16 | 17 | return reflect.DeepEqual(zeroValue, actual), nil 18 | 19 | } 20 | 21 | func (matcher *BeZeroMatcher) FailureMessage(actual interface{}) (message string) { 22 | return format.Message(actual, "to be zero-valued") 23 | } 24 | 25 | func (matcher *BeZeroMatcher) NegatedFailureMessage(actual interface{}) (message string) { 26 | return format.Message(actual, "not to be zero-valued") 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/contain_substring_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | "strings" 7 | ) 8 | 9 | type ContainSubstringMatcher struct { 10 | Substr string 11 | Args []interface{} 12 | } 13 | 14 | func (matcher *ContainSubstringMatcher) Match(actual interface{}) (success bool, err error) { 15 | actualString, ok := toString(actual) 16 | if !ok { 17 | return false, fmt.Errorf("ContainSubstring matcher requires a string or stringer. Got:\n%s", format.Object(actual, 1)) 18 | } 19 | 20 | return strings.Contains(actualString, matcher.stringToMatch()), nil 21 | } 22 | 23 | func (matcher *ContainSubstringMatcher) stringToMatch() string { 24 | stringToMatch := matcher.Substr 25 | if len(matcher.Args) > 0 { 26 | stringToMatch = fmt.Sprintf(matcher.Substr, matcher.Args...) 27 | } 28 | return stringToMatch 29 | } 30 | 31 | func (matcher *ContainSubstringMatcher) FailureMessage(actual interface{}) (message string) { 32 | return format.Message(actual, "to contain substring", matcher.stringToMatch()) 33 | } 34 | 35 | func (matcher *ContainSubstringMatcher) NegatedFailureMessage(actual interface{}) (message string) { 36 | return format.Message(actual, "not to contain substring", matcher.stringToMatch()) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_cap_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | type HaveCapMatcher struct { 10 | Count int 11 | } 12 | 13 | func (matcher *HaveCapMatcher) Match(actual interface{}) (success bool, err error) { 14 | length, ok := capOf(actual) 15 | if !ok { 16 | return false, fmt.Errorf("HaveCap matcher expects a array/channel/slice. Got:\n%s", format.Object(actual, 1)) 17 | } 18 | 19 | return length == matcher.Count, nil 20 | } 21 | 22 | func (matcher *HaveCapMatcher) FailureMessage(actual interface{}) (message string) { 23 | return fmt.Sprintf("Expected\n%s\nto have capacity %d", format.Object(actual, 1), matcher.Count) 24 | } 25 | 26 | func (matcher *HaveCapMatcher) NegatedFailureMessage(actual interface{}) (message string) { 27 | return fmt.Sprintf("Expected\n%s\nnot to have capacity %d", format.Object(actual, 1), matcher.Count) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_len_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type HaveLenMatcher struct { 9 | Count int 10 | } 11 | 12 | func (matcher *HaveLenMatcher) Match(actual interface{}) (success bool, err error) { 13 | length, ok := lengthOf(actual) 14 | if !ok { 15 | return false, fmt.Errorf("HaveLen matcher expects a string/array/map/channel/slice. Got:\n%s", format.Object(actual, 1)) 16 | } 17 | 18 | return length == matcher.Count, nil 19 | } 20 | 21 | func (matcher *HaveLenMatcher) FailureMessage(actual interface{}) (message string) { 22 | return fmt.Sprintf("Expected\n%s\nto have length %d", format.Object(actual, 1), matcher.Count) 23 | } 24 | 25 | func (matcher *HaveLenMatcher) NegatedFailureMessage(actual interface{}) (message string) { 26 | return fmt.Sprintf("Expected\n%s\nnot to have length %d", format.Object(actual, 1), matcher.Count) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | type HaveOccurredMatcher struct { 10 | } 11 | 12 | func (matcher *HaveOccurredMatcher) Match(actual interface{}) (success bool, err error) { 13 | // is purely nil? 14 | if actual == nil { 15 | return false, nil 16 | } 17 | 18 | // must be an 'error' type 19 | if !isError(actual) { 20 | return false, fmt.Errorf("Expected an error-type. Got:\n%s", format.Object(actual, 1)) 21 | } 22 | 23 | // must be non-nil (or a pointer to a non-nil) 24 | return !isNil(actual), nil 25 | } 26 | 27 | func (matcher *HaveOccurredMatcher) FailureMessage(actual interface{}) (message string) { 28 | return fmt.Sprintf("Expected an error to have occurred. Got:\n%s", format.Object(actual, 1)) 29 | } 30 | 31 | func (matcher *HaveOccurredMatcher) NegatedFailureMessage(actual interface{}) (message string) { 32 | return fmt.Sprintf("Expected error:\n%s\n%s\n%s", format.Object(actual, 1), format.IndentString(actual.(error).Error(), 1), "not to have occurred") 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_prefix_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type HavePrefixMatcher struct { 9 | Prefix string 10 | Args []interface{} 11 | } 12 | 13 | func (matcher *HavePrefixMatcher) Match(actual interface{}) (success bool, err error) { 14 | actualString, ok := toString(actual) 15 | if !ok { 16 | return false, fmt.Errorf("HavePrefix matcher requires a string or stringer. Got:\n%s", format.Object(actual, 1)) 17 | } 18 | prefix := matcher.prefix() 19 | return len(actualString) >= len(prefix) && actualString[0:len(prefix)] == prefix, nil 20 | } 21 | 22 | func (matcher *HavePrefixMatcher) prefix() string { 23 | if len(matcher.Args) > 0 { 24 | return fmt.Sprintf(matcher.Prefix, matcher.Args...) 25 | } 26 | return matcher.Prefix 27 | } 28 | 29 | func (matcher *HavePrefixMatcher) FailureMessage(actual interface{}) (message string) { 30 | return format.Message(actual, "to have prefix", matcher.prefix()) 31 | } 32 | 33 | func (matcher *HavePrefixMatcher) NegatedFailureMessage(actual interface{}) (message string) { 34 | return format.Message(actual, "not to have prefix", matcher.prefix()) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_suffix_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type HaveSuffixMatcher struct { 9 | Suffix string 10 | Args []interface{} 11 | } 12 | 13 | func (matcher *HaveSuffixMatcher) Match(actual interface{}) (success bool, err error) { 14 | actualString, ok := toString(actual) 15 | if !ok { 16 | return false, fmt.Errorf("HaveSuffix matcher requires a string or stringer. Got:\n%s", format.Object(actual, 1)) 17 | } 18 | suffix := matcher.suffix() 19 | return len(actualString) >= len(suffix) && actualString[len(actualString)-len(suffix):] == suffix, nil 20 | } 21 | 22 | func (matcher *HaveSuffixMatcher) suffix() string { 23 | if len(matcher.Args) > 0 { 24 | return fmt.Sprintf(matcher.Suffix, matcher.Args...) 25 | } 26 | return matcher.Suffix 27 | } 28 | 29 | func (matcher *HaveSuffixMatcher) FailureMessage(actual interface{}) (message string) { 30 | return format.Message(actual, "to have suffix", matcher.suffix()) 31 | } 32 | 33 | func (matcher *HaveSuffixMatcher) NegatedFailureMessage(actual interface{}) (message string) { 34 | return format.Message(actual, "not to have suffix", matcher.suffix()) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/match_regexp_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | "regexp" 7 | ) 8 | 9 | type MatchRegexpMatcher struct { 10 | Regexp string 11 | Args []interface{} 12 | } 13 | 14 | func (matcher *MatchRegexpMatcher) Match(actual interface{}) (success bool, err error) { 15 | actualString, ok := toString(actual) 16 | if !ok { 17 | return false, fmt.Errorf("RegExp matcher requires a string or stringer.\nGot:%s", format.Object(actual, 1)) 18 | } 19 | 20 | match, err := regexp.Match(matcher.regexp(), []byte(actualString)) 21 | if err != nil { 22 | return false, fmt.Errorf("RegExp match failed to compile with error:\n\t%s", err.Error()) 23 | } 24 | 25 | return match, nil 26 | } 27 | 28 | func (matcher *MatchRegexpMatcher) FailureMessage(actual interface{}) (message string) { 29 | return format.Message(actual, "to match regular expression", matcher.regexp()) 30 | } 31 | 32 | func (matcher *MatchRegexpMatcher) NegatedFailureMessage(actual interface{}) (message string) { 33 | return format.Message(actual, "not to match regular expression", matcher.regexp()) 34 | } 35 | 36 | func (matcher *MatchRegexpMatcher) regexp() string { 37 | re := matcher.Regexp 38 | if len(matcher.Args) > 0 { 39 | re = fmt.Sprintf(matcher.Regexp, matcher.Args...) 40 | } 41 | return re 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/not.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "github.com/onsi/gomega/internal/oraclematcher" 5 | "github.com/onsi/gomega/types" 6 | ) 7 | 8 | type NotMatcher struct { 9 | Matcher types.GomegaMatcher 10 | } 11 | 12 | func (m *NotMatcher) Match(actual interface{}) (bool, error) { 13 | success, err := m.Matcher.Match(actual) 14 | if err != nil { 15 | return false, err 16 | } 17 | return !success, nil 18 | } 19 | 20 | func (m *NotMatcher) FailureMessage(actual interface{}) (message string) { 21 | return m.Matcher.NegatedFailureMessage(actual) // works beautifully 22 | } 23 | 24 | func (m *NotMatcher) NegatedFailureMessage(actual interface{}) (message string) { 25 | return m.Matcher.FailureMessage(actual) // works beautifully 26 | } 27 | 28 | func (m *NotMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { 29 | return oraclematcher.MatchMayChangeInTheFuture(m.Matcher, actual) // just return m.Matcher's value 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/succeed_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | type SucceedMatcher struct { 10 | } 11 | 12 | func (matcher *SucceedMatcher) Match(actual interface{}) (success bool, err error) { 13 | // is purely nil? 14 | if actual == nil { 15 | return true, nil 16 | } 17 | 18 | // must be an 'error' type 19 | if !isError(actual) { 20 | return false, fmt.Errorf("Expected an error-type. Got:\n%s", format.Object(actual, 1)) 21 | } 22 | 23 | // must be nil (or a pointer to a nil) 24 | return isNil(actual), nil 25 | } 26 | 27 | func (matcher *SucceedMatcher) FailureMessage(actual interface{}) (message string) { 28 | return fmt.Sprintf("Expected success, but got an error:\n%s\n%s", format.Object(actual, 1), format.IndentString(actual.(error).Error(), 1)) 29 | } 30 | 31 | func (matcher *SucceedMatcher) NegatedFailureMessage(actual interface{}) (message string) { 32 | return "Expected failure, but got no error." 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph/bipartitegraph.go: -------------------------------------------------------------------------------- 1 | package bipartitegraph 2 | 3 | import "errors" 4 | import "fmt" 5 | 6 | import . "github.com/onsi/gomega/matchers/support/goraph/node" 7 | import . "github.com/onsi/gomega/matchers/support/goraph/edge" 8 | 9 | type BipartiteGraph struct { 10 | Left NodeOrderedSet 11 | Right NodeOrderedSet 12 | Edges EdgeSet 13 | } 14 | 15 | func NewBipartiteGraph(leftValues, rightValues []interface{}, neighbours func(interface{}, interface{}) (bool, error)) (*BipartiteGraph, error) { 16 | left := NodeOrderedSet{} 17 | for i, _ := range leftValues { 18 | left = append(left, Node{i}) 19 | } 20 | 21 | right := NodeOrderedSet{} 22 | for j, _ := range rightValues { 23 | right = append(right, Node{j + len(left)}) 24 | } 25 | 26 | edges := EdgeSet{} 27 | for i, leftValue := range leftValues { 28 | for j, rightValue := range rightValues { 29 | neighbours, err := neighbours(leftValue, rightValue) 30 | if err != nil { 31 | return nil, errors.New(fmt.Sprintf("error determining adjacency for %v and %v: %s", leftValue, rightValue, err.Error())) 32 | } 33 | 34 | if neighbours { 35 | edges = append(edges, Edge{left[i], right[j]}) 36 | } 37 | } 38 | } 39 | 40 | return &BipartiteGraph{left, right, edges}, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/support/goraph/edge/edge.go: -------------------------------------------------------------------------------- 1 | package edge 2 | 3 | import . "github.com/onsi/gomega/matchers/support/goraph/node" 4 | 5 | type Edge struct { 6 | Node1 Node 7 | Node2 Node 8 | } 9 | 10 | type EdgeSet []Edge 11 | 12 | func (ec EdgeSet) Free(node Node) bool { 13 | for _, e := range ec { 14 | if e.Node1 == node || e.Node2 == node { 15 | return false 16 | } 17 | } 18 | 19 | return true 20 | } 21 | 22 | func (ec EdgeSet) Contains(edge Edge) bool { 23 | for _, e := range ec { 24 | if e == edge { 25 | return true 26 | } 27 | } 28 | 29 | return false 30 | } 31 | 32 | func (ec EdgeSet) FindByNodes(node1, node2 Node) (Edge, bool) { 33 | for _, e := range ec { 34 | if (e.Node1 == node1 && e.Node2 == node2) || (e.Node1 == node2 && e.Node2 == node1) { 35 | return e, true 36 | } 37 | } 38 | 39 | return Edge{}, false 40 | } 41 | 42 | func (ec EdgeSet) SymmetricDifference(ec2 EdgeSet) EdgeSet { 43 | edgesToInclude := make(map[Edge]bool) 44 | 45 | for _, e := range ec { 46 | edgesToInclude[e] = true 47 | } 48 | 49 | for _, e := range ec2 { 50 | edgesToInclude[e] = !edgesToInclude[e] 51 | } 52 | 53 | result := EdgeSet{} 54 | for e, include := range edgesToInclude { 55 | if include { 56 | result = append(result, e) 57 | } 58 | } 59 | 60 | return result 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/support/goraph/node/node.go: -------------------------------------------------------------------------------- 1 | package node 2 | 3 | type Node struct { 4 | Id int 5 | } 6 | 7 | type NodeOrderedSet []Node 8 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/support/goraph/util/util.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "math" 4 | 5 | func Odd(n int) bool { 6 | return math.Mod(float64(n), 2.0) == 1.0 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/types/types.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | type GomegaFailHandler func(message string, callerSkip ...int) 4 | 5 | //A simple *testing.T interface wrapper 6 | type GomegaTestingT interface { 7 | Fatalf(format string, args ...interface{}) 8 | } 9 | 10 | //All Gomega matchers must implement the GomegaMatcher interface 11 | // 12 | //For details on writing custom matchers, check out: http://onsi.github.io/gomega/#adding_your_own_matchers 13 | type GomegaMatcher interface { 14 | Match(actual interface{}) (success bool, err error) 15 | FailureMessage(actual interface{}) (message string) 16 | NegatedFailureMessage(actual interface{}) (message string) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/rs/cors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Olivier Poitrey 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 furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | 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/sclevine/agouti/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Stephen Levine 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/api/api.go: -------------------------------------------------------------------------------- 1 | // Package api provides a generic, low-level WebDriver API client for Go. 2 | // All methods map directly to endpoints of the WebDriver Wire Protocol: 3 | // https://code.google.com/p/selenium/wiki/JsonWireProtocol 4 | // 5 | // This package was previously internal to the agouti package. It currently 6 | // does not have a fixed API, but this will change in the near future 7 | // (with the addition of adequate documentation). 8 | package api 9 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/api/internal/service/build.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "bytes" 5 | "errors" 6 | "os/exec" 7 | "text/template" 8 | ) 9 | 10 | func buildURL(url string, address addressInfo) (string, error) { 11 | urlTemplate, err := template.New("URL").Parse(url) 12 | if err != nil { 13 | return "", err 14 | } 15 | urlBuffer := &bytes.Buffer{} 16 | if err := urlTemplate.Execute(urlBuffer, address); err != nil { 17 | return "", err 18 | } 19 | return urlBuffer.String(), nil 20 | } 21 | 22 | func buildCommand(arguments []string, address addressInfo) (*exec.Cmd, error) { 23 | if len(arguments) == 0 { 24 | return nil, errors.New("empty command") 25 | } 26 | 27 | command := []string{} 28 | for _, argument := range arguments { 29 | argTemplate, err := template.New("command").Parse(argument) 30 | if err != nil { 31 | return nil, err 32 | } 33 | 34 | argBuffer := &bytes.Buffer{} 35 | if err := argTemplate.Execute(argBuffer, address); err != nil { 36 | return nil, err 37 | } 38 | command = append(command, argBuffer.String()) 39 | } 40 | 41 | return exec.Command(command[0], command[1:]...), nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/api/offset.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | type Offset interface { 4 | x() (x int, present bool) 5 | y() (y int, present bool) 6 | position() (x int, y int) 7 | } 8 | 9 | type XYOffset struct { 10 | X int 11 | Y int 12 | } 13 | 14 | func (o XYOffset) x() (x int, present bool) { 15 | return o.X, true 16 | } 17 | 18 | func (o XYOffset) y() (y int, present bool) { 19 | return o.Y, true 20 | } 21 | 22 | func (o XYOffset) position() (x int, y int) { 23 | return o.X, o.Y 24 | } 25 | 26 | type XOffset int 27 | 28 | func (o XOffset) x() (x int, present bool) { 29 | return int(o), true 30 | } 31 | 32 | func (XOffset) y() (y int, present bool) { 33 | return 0, false 34 | } 35 | 36 | func (o XOffset) position() (x int, y int) { 37 | return int(o), 0 38 | } 39 | 40 | type YOffset int 41 | 42 | func (YOffset) x() (x int, present bool) { 43 | return 0, false 44 | } 45 | 46 | func (o YOffset) y() (y int, present bool) { 47 | return int(o), true 48 | } 49 | 50 | func (o YOffset) position() (x int, y int) { 51 | return 0, int(o) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/api/speed.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import "math" 4 | 5 | type Speed interface { 6 | vector() (x, y int) 7 | scalar() uint 8 | } 9 | 10 | type VectorSpeed struct { 11 | X int 12 | Y int 13 | } 14 | 15 | func (s VectorSpeed) vector() (x, y int) { 16 | return s.X, s.Y 17 | } 18 | 19 | func (s VectorSpeed) scalar() uint { 20 | return uint(math.Hypot(float64(s.X), float64(s.Y))) 21 | } 22 | 23 | type ScalarSpeed uint 24 | 25 | func (s ScalarSpeed) vector() (x, y int) { 26 | scalar := int(float64(s) / math.Sqrt2) 27 | return scalar, scalar 28 | } 29 | 30 | func (s ScalarSpeed) scalar() uint { 31 | return uint(s) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/api/types.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | type Log struct { 4 | Message string 5 | Level string 6 | Timestamp int64 7 | } 8 | 9 | // A Cookie defines a web cookie 10 | type Cookie struct { 11 | // Name is the name of the cookie (required) 12 | Name string `json:"name"` 13 | 14 | // Value is the value of the cookie (required) 15 | Value string `json:"value"` 16 | 17 | // Path is the path of the cookie (default: "/") 18 | Path string `json:"path,omitempty"` 19 | 20 | // Domain is the domain of the cookie (default: current page domain) 21 | Domain string `json:"domain,omitempty"` 22 | 23 | // Secure is set to true for secure cookies (default: false) 24 | Secure bool `json:"secure,omitempty"` 25 | 26 | // HTTPOnly is set to true for HTTP-Only cookies (default: false) 27 | HTTPOnly bool `json:"httpOnly,omitempty"` 28 | 29 | // Expiry is the time when the cookie expires 30 | Expiry float64 `json:"expiry,omitempty"` 31 | } 32 | 33 | type Selector struct { 34 | Using string `json:"using"` 35 | Value string `json:"value"` 36 | } 37 | 38 | type Button int 39 | 40 | const ( 41 | LeftButton Button = iota 42 | MiddleButton 43 | RightButton 44 | ) 45 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/api/window.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import "path" 4 | 5 | type Window struct { 6 | ID string 7 | Session *Session 8 | } 9 | 10 | func (w *Window) Send(method, endpoint string, body, result interface{}) error { 11 | return w.Session.Send(method, path.Join("window", w.ID, endpoint), body, result) 12 | } 13 | 14 | func (w *Window) SetSize(width, height int) error { 15 | request := struct { 16 | Width int `json:"width"` 17 | Height int `json:"height"` 18 | }{width, height} 19 | 20 | return w.Send("POST", "size", request, nil) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/matchers/internal/be_found.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "github.com/onsi/gomega/format" 8 | ) 9 | 10 | type BeFoundMatcher struct{} 11 | 12 | func (m *BeFoundMatcher) Match(actual interface{}) (success bool, err error) { 13 | actualSelection, ok := actual.(interface { 14 | Count() (int, error) 15 | }) 16 | 17 | if !ok { 18 | return false, fmt.Errorf("BeFound matcher requires a *Selection. Got:\n%s", format.Object(actual, 1)) 19 | } 20 | 21 | count, err := actualSelection.Count() 22 | if err != nil { 23 | switch { 24 | case strings.HasSuffix(err.Error(), "element not found"): 25 | return false, nil 26 | case strings.HasSuffix(err.Error(), "element index out of range"): 27 | return false, nil 28 | default: 29 | return false, err 30 | } 31 | } 32 | 33 | return count > 0, nil 34 | } 35 | 36 | func (m *BeFoundMatcher) FailureMessage(actual interface{}) (message string) { 37 | return booleanMessage(actual, "to be found") 38 | } 39 | 40 | func (m *BeFoundMatcher) NegatedFailureMessage(actual interface{}) (message string) { 41 | return booleanMessage(actual, "not to be found") 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/matchers/internal/boolean_matcher.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | 7 | "github.com/onsi/gomega/format" 8 | ) 9 | 10 | type BooleanMatcher struct { 11 | Method string 12 | Property string 13 | } 14 | 15 | func (m *BooleanMatcher) Match(actual interface{}) (success bool, err error) { 16 | method := reflect.ValueOf(actual).MethodByName(m.Method) 17 | if !method.IsValid() { 18 | return false, fmt.Errorf("Be%s matcher requires a *Selection. Got:\n%s", m.Method, format.Object(actual, 1)) 19 | } 20 | 21 | results := method.Call(nil) 22 | propertyValue, errValue := results[0], results[1] 23 | if !errValue.IsNil() { 24 | return false, errValue.Interface().(error) 25 | } 26 | 27 | return propertyValue.Bool(), nil 28 | } 29 | 30 | func (m *BooleanMatcher) FailureMessage(actual interface{}) (message string) { 31 | return booleanMessage(actual, "to be "+m.Property) 32 | } 33 | 34 | func (m *BooleanMatcher) NegatedFailureMessage(actual interface{}) (message string) { 35 | return booleanMessage(actual, "not to be "+m.Property) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/matchers/internal/equal_element.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | type EqualElementMatcher struct { 10 | ExpectedSelection interface{} 11 | } 12 | 13 | func (m *EqualElementMatcher) Match(actual interface{}) (success bool, err error) { 14 | actualSelection, ok := actual.(interface { 15 | EqualsElement(selection interface{}) (bool, error) 16 | }) 17 | 18 | if !ok { 19 | return false, fmt.Errorf("EqualElement matcher requires a *Selection. Got:\n%s", format.Object(actual, 1)) 20 | } 21 | 22 | same, err := actualSelection.EqualsElement(m.ExpectedSelection) 23 | if err != nil { 24 | return false, err 25 | } 26 | 27 | return same, nil 28 | } 29 | 30 | func (m *EqualElementMatcher) FailureMessage(actual interface{}) (message string) { 31 | return equalityMessage(actual, "to equal element of", m.ExpectedSelection) 32 | } 33 | 34 | func (m *EqualElementMatcher) NegatedFailureMessage(actual interface{}) (message string) { 35 | return equalityMessage(actual, "not to equal element of", m.ExpectedSelection) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/matchers/internal/match_text.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | 7 | "github.com/onsi/gomega/format" 8 | ) 9 | 10 | type MatchTextMatcher struct { 11 | Regexp string 12 | actualText string 13 | } 14 | 15 | func (m *MatchTextMatcher) Match(actual interface{}) (success bool, err error) { 16 | actualSelection, ok := actual.(interface { 17 | Text() (string, error) 18 | }) 19 | 20 | if !ok { 21 | return false, fmt.Errorf("MatchText matcher requires a *Selection. Got:\n%s", format.Object(actual, 1)) 22 | } 23 | 24 | m.actualText, err = actualSelection.Text() 25 | if err != nil { 26 | return false, err 27 | } 28 | 29 | return regexp.MatchString(m.Regexp, m.actualText) 30 | } 31 | 32 | func (m *MatchTextMatcher) FailureMessage(actual interface{}) (message string) { 33 | return valueMessage(actual, "to have text matching", m.Regexp, m.actualText) 34 | } 35 | 36 | func (m *MatchTextMatcher) NegatedFailureMessage(actual interface{}) (message string) { 37 | return valueMessage(actual, "not to have text matching", m.Regexp, m.actualText) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/matchers/internal/messages.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | var tab = format.Indent 10 | 11 | func valueMessage(actual interface{}, message string, expected, actualValue interface{}) string { 12 | failureMessage := "Expected %s %s\n%s%s\nbut found\n%s%s" 13 | return fmt.Sprintf(failureMessage, actual, message, tab, expected, tab, actualValue) 14 | } 15 | 16 | func booleanMessage(actual interface{}, message string) string { 17 | failureMessage := "Expected %s %s" 18 | return fmt.Sprintf(failureMessage, actual, message) 19 | } 20 | 21 | func equalityMessage(actual interface{}, message string, expected interface{}) string { 22 | failureMessage := "Expected %s %s\n%s%s" 23 | return fmt.Sprintf(failureMessage, actual, message, tab, expected) 24 | } 25 | 26 | func expectedColorMessage(expectedValue string, expectedColor, actualColor interface{}) string { 27 | failureMessage := "The expected value:\n%s%s\nis a color:\n%s%s\nBut the actual value:\n%s%s\nis not.\n" 28 | return fmt.Sprintf(failureMessage, tab, expectedValue, tab, expectedColor, tab, actualColor) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/matchers/internal/value_matcher.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | "reflect" 6 | 7 | "github.com/onsi/gomega/format" 8 | ) 9 | 10 | type ValueMatcher struct { 11 | Method string 12 | Property string 13 | Expected interface{} 14 | actualValue interface{} 15 | } 16 | 17 | func (m *ValueMatcher) Match(actual interface{}) (success bool, err error) { 18 | method := reflect.ValueOf(actual).MethodByName(m.Method) 19 | if !method.IsValid() { 20 | return false, fmt.Errorf("Have%s matcher requires a *Selection. Got:\n%s", m.Method, format.Object(actual, 1)) 21 | } 22 | 23 | results := method.Call(nil) 24 | propertyValue, errValue := results[0], results[1] 25 | if !errValue.IsNil() { 26 | return false, errValue.Interface().(error) 27 | } 28 | 29 | m.actualValue = propertyValue.Interface() 30 | 31 | return reflect.DeepEqual(m.actualValue, m.Expected), nil 32 | } 33 | 34 | func (m *ValueMatcher) FailureMessage(actual interface{}) (message string) { 35 | return valueMessage(actual, fmt.Sprintf("to have %s equaling", m.Property), m.Expected, m.actualValue) 36 | } 37 | 38 | func (m *ValueMatcher) NegatedFailureMessage(actual interface{}) (message string) { 39 | return valueMessage(actual, fmt.Sprintf("not to have %s equaling", m.Property), m.Expected, m.actualValue) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/matchers/matchers.go: -------------------------------------------------------------------------------- 1 | // Package matchers provides a set of Gomega-compatible matchers for use 2 | // with the agouti package. 3 | package matchers 4 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/multiselection.go: -------------------------------------------------------------------------------- 1 | package agouti 2 | 3 | import "github.com/sclevine/agouti/internal/target" 4 | 5 | // A MultiSelection is a Selection that may be indexed using the At() method. 6 | // All Selection methods are available on a MultiSelection. 7 | // 8 | // A Selection returned by At() may still refer to multiple elements if any 9 | // parent of the MultiSelection refers to multiple elements. 10 | // 11 | // Examples: 12 | // selection.All("section").All("form").At(1).Submit() 13 | // Submits the second form in each section. 14 | // selection.All("div").Find("h1").Click() 15 | // Clicks one h1 in each div, failing if any div does not contain exactly one h1. 16 | type MultiSelection struct { 17 | Selection 18 | } 19 | 20 | func newMultiSelection(session apiSession, selectors target.Selectors) *MultiSelection { 21 | return &MultiSelection{*newSelection(session, selectors)} 22 | } 23 | 24 | // At finds an element at the provided index. It only applies to the immediate selection, 25 | // meaning that the returned selection may still refer to multiple elements if any parent 26 | // of the immediate selection is also a *MultiSelection. 27 | func (s *MultiSelection) At(index int) *Selection { 28 | return newSelection(s.session, s.selectors.At(index)) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/sclevine/agouti/selection_frames.go: -------------------------------------------------------------------------------- 1 | package agouti 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/sclevine/agouti/api" 7 | ) 8 | 9 | // SwitchToFrame focuses on the frame specified by the selection. All new and 10 | // existing selections will refer to the new frame. All further Page methods 11 | // will apply to this frame as well. 12 | func (s *Selection) SwitchToFrame() error { 13 | selectedElement, err := s.elements.GetExactlyOne() 14 | if err != nil { 15 | return fmt.Errorf("failed to select element from %s: %s", s, err) 16 | } 17 | 18 | if err := s.session.Frame(selectedElement.(*api.Element)); err != nil { 19 | return fmt.Errorf("failed to switch to frame referred to by %s: %s", s, err) 20 | } 21 | return nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/httpfs/filter/filters.go: -------------------------------------------------------------------------------- 1 | package filter 2 | 3 | import ( 4 | "os" 5 | pathpkg "path" 6 | ) 7 | 8 | // FilesWithExtensions returns a filter func that selects files (but not directories) 9 | // that have any of the given extensions. For example: 10 | // 11 | // filter.FilesWithExtensions(".go", ".html") 12 | // 13 | // Would select both .go and .html files. It would not select any directories. 14 | func FilesWithExtensions(exts ...string) Func { 15 | return func(path string, fi os.FileInfo) bool { 16 | if fi.IsDir() { 17 | return false 18 | } 19 | for _, ext := range exts { 20 | if pathpkg.Ext(path) == ext { 21 | return true 22 | } 23 | } 24 | return false 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/httpfs/vfsutil/file.go: -------------------------------------------------------------------------------- 1 | package vfsutil 2 | 3 | import ( 4 | "net/http" 5 | "os" 6 | ) 7 | 8 | // File implements http.FileSystem using the native file system restricted to a 9 | // specific file served at root. 10 | // 11 | // While the FileSystem.Open method takes '/'-separated paths, a File's string 12 | // value is a filename on the native file system, not a URL, so it is separated 13 | // by filepath.Separator, which isn't necessarily '/'. 14 | type File string 15 | 16 | func (f File) Open(name string) (http.File, error) { 17 | if name != "/" { 18 | return nil, &os.PathError{Op: "open", Path: name, Err: os.ErrNotExist} 19 | } 20 | return os.Open(string(f)) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/shurcooL/httpfs/vfsutil/vfsutil.go: -------------------------------------------------------------------------------- 1 | // Package vfsutil implements some I/O utility functions for http.FileSystem. 2 | package vfsutil 3 | 4 | import ( 5 | "io/ioutil" 6 | "net/http" 7 | "os" 8 | ) 9 | 10 | // ReadDir reads the contents of the directory associated with file and 11 | // returns a slice of FileInfo values in directory order. 12 | func ReadDir(fs http.FileSystem, name string) ([]os.FileInfo, error) { 13 | f, err := fs.Open(name) 14 | if err != nil { 15 | return nil, err 16 | } 17 | defer f.Close() 18 | return f.Readdir(0) 19 | } 20 | 21 | // Stat returns the FileInfo structure describing file. 22 | func Stat(fs http.FileSystem, name string) (os.FileInfo, error) { 23 | f, err := fs.Open(name) 24 | if err != nil { 25 | return nil, err 26 | } 27 | defer f.Close() 28 | return f.Stat() 29 | } 30 | 31 | // ReadFile reads the file named by path from fs and returns the contents. 32 | func ReadFile(fs http.FileSystem, path string) ([]byte, error) { 33 | rc, err := fs.Open(path) 34 | if err != nil { 35 | return nil, err 36 | } 37 | defer rc.Close() 38 | return ioutil.ReadAll(rc) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 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/sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/hooks.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | // A hook to be fired when logging on the logging levels returned from 4 | // `Levels()` on your implementation of the interface. Note that this is not 5 | // fired in a goroutine or a channel with workers, you should handle such 6 | // functionality yourself if your call is non-blocking and you don't wish for 7 | // the logging calls for levels returned from `Levels()` to block. 8 | type Hook interface { 9 | Levels() []Level 10 | Fire(*Entry) error 11 | } 12 | 13 | // Internal type for storing the hooks on a logger instance. 14 | type LevelHooks map[Level][]Hook 15 | 16 | // Add a hook to an instance of logger. This is called with 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. 18 | func (hooks LevelHooks) Add(hook Hook) { 19 | for _, level := range hook.Levels() { 20 | hooks[level] = append(hooks[level], hook) 21 | } 22 | } 23 | 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire 25 | // appropriate hooks for a log entry. 26 | func (hooks LevelHooks) Fire(level Level, entry *Entry) error { 27 | for _, hook := range hooks[level] { 28 | if err := hook.Fire(entry); err != nil { 29 | return err 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | const ioctlReadTermios = unix.TIOCGETA 9 | 10 | type Termios unix.Termios 11 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | const ioctlReadTermios = unix.TCGETS 13 | 14 | type Termios unix.Termios 15 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_notwin.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package cobra 4 | 5 | var preExecHookFn func(*Command) 6 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package cobra 4 | 5 | import ( 6 | "os" 7 | "time" 8 | 9 | "github.com/inconshreveable/mousetrap" 10 | ) 11 | 12 | var preExecHookFn = preExecHook 13 | 14 | func preExecHook(c *Command) { 15 | if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { 16 | c.Print(MousetrapHelpText) 17 | time.Sleep(5 * time.Second) 18 | os.Exit(1) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/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 https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/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 https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/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/net/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/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/flow.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Flow control 6 | 7 | package http2 8 | 9 | // flow is the flow control window's size. 10 | type flow struct { 11 | // n is the number of DATA bytes we're allowed to send. 12 | // A flow is kept both on a conn and a per-stream. 13 | n int32 14 | 15 | // conn points to the shared connection-level flow that is 16 | // shared by all streams on that conn. It is nil for the flow 17 | // that's on the conn directly. 18 | conn *flow 19 | } 20 | 21 | func (f *flow) setConnFlow(cf *flow) { f.conn = cf } 22 | 23 | func (f *flow) available() int32 { 24 | n := f.n 25 | if f.conn != nil && f.conn.n < n { 26 | n = f.conn.n 27 | } 28 | return n 29 | } 30 | 31 | func (f *flow) take(n int32) { 32 | if n > f.available() { 33 | panic("internal error: took too much") 34 | } 35 | f.n -= n 36 | if f.conn != nil { 37 | f.conn.n -= n 38 | } 39 | } 40 | 41 | // add adds n bytes (positive or negative) to the flow control window. 42 | // It returns false if the sum would exceed 2^31-1. 43 | func (f *flow) add(n int32) bool { 44 | remain := (1<<31 - 1) - f.n 45 | if n > remain { 46 | return false 47 | } 48 | f.n += n 49 | return true 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 15 | return t1.ExpectContinueTimeout 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | s.RegisterOnShutdown(conf.state.startGracefulShutdown) 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func configureTransport(t1 *http.Transport) (*Transport, error) { 15 | return nil, errTransportVersion 16 | } 17 | 18 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 19 | return 0 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | func configureServer18(h1 *http.Server, h2 *Server) error { 15 | // No IdleTimeout to sync prior to Go 1.8. 16 | return nil 17 | } 18 | 19 | func shouldLogPanic(panicValue interface{}) bool { 20 | return panicValue != nil 21 | } 22 | 23 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 24 | return nil 25 | } 26 | 27 | func reqBodyIsNoBody(io.ReadCloser) bool { return false } 28 | 29 | func go18httpNoBody() io.ReadCloser { return nil } // for tests only 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | // not supported prior to go1.9 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7 6 | 7 | package trace 8 | 9 | import "golang.org/x/net/context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package trace 8 | 9 | import "context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/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/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_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 | // 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 ·RawSyscall(SB),NOSPLIT,$0-28 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·socketcall(SB),NOSPLIT,$0-36 29 | JMP syscall·socketcall(SB) 30 | 31 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 32 | JMP syscall·rawsocketcall(SB) 33 | 34 | TEXT ·seek(SB),NOSPLIT,$0-28 35 | JMP syscall·seek(SB) 36 | -------------------------------------------------------------------------------- /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 ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /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 ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /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 ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /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 ·RawSyscall(SB),NOSPLIT,$0-28 28 | JMP syscall·RawSyscall(SB) 29 | 30 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 31 | JMP syscall·RawSyscall6(SB) 32 | -------------------------------------------------------------------------------- /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 ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /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 ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /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_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.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 go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/file_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 | package unix 6 | 7 | import ( 8 | "os" 9 | "syscall" 10 | ) 11 | 12 | // FIXME: unexported function from os 13 | // syscallMode returns the syscall-specific mode bits from Go's portable mode bits. 14 | func syscallMode(i os.FileMode) (o uint32) { 15 | o |= uint32(i.Perm()) 16 | if i&os.ModeSetuid != 0 { 17 | o |= syscall.S_ISUID 18 | } 19 | if i&os.ModeSetgid != 0 { 20 | o |= syscall.S_ISGID 21 | } 22 | if i&os.ModeSticky != 0 { 23 | o |= syscall.S_ISVTX 24 | } 25 | // No mapping for Go's ModeTemporary (plan9 only). 26 | return 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 16 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 17 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 18 | if errno == 0 { 19 | return nil 20 | } 21 | return errno 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | // Define the use function in C so that it is not inlined. 35 | 36 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 37 | 38 | void 39 | use(void *p __attribute__ ((unused))) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /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/gccgo_linux_sparc64.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 gccgo,linux,sparc64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern sysconf 12 | func realSysconf(name int) int64 13 | 14 | func sysconf(name int) (n int64, err syscall.Errno) { 15 | r := realSysconf(name) 16 | if r < 0 { 17 | return 0, syscall.GetErrno() 18 | } 19 | return r, 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/openbsd_pledge.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 openbsd 6 | // +build 386 amd64 arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | const ( 16 | SYS_PLEDGE = 108 17 | ) 18 | 19 | // Pledge implements the pledge syscall. For more information see pledge(2). 20 | func Pledge(promises string, paths []string) error { 21 | promisesPtr, err := syscall.BytePtrFromString(promises) 22 | if err != nil { 23 | return err 24 | } 25 | promisesUnsafe, pathsUnsafe := unsafe.Pointer(promisesPtr), unsafe.Pointer(nil) 26 | if paths != nil { 27 | var pathsPtr []*byte 28 | if pathsPtr, err = syscall.SlicePtrFromStrings(paths); err != nil { 29 | return err 30 | } 31 | pathsUnsafe = unsafe.Pointer(&pathsPtr[0]) 32 | } 33 | _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(promisesUnsafe), uintptr(pathsUnsafe), 0) 34 | if e != 0 { 35 | return e 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /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 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 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_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_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 Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /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 Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int64(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /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 Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.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 dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /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 Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /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 Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = nsec / 1e9 15 | ts.Nsec = nsec % 1e9 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = nsec % 1e9 / 1e3 22 | tv.Sec = nsec / 1e9 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /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 TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func NsecToTimeval(nsec int64) (tv Timeval) { 18 | nsec += 999 // round up to microsecond 19 | tv.Usec = nsec % 1e9 / 1e3 20 | tv.Sec = int64(nsec / 1e9) 21 | return 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (cmsg *Cmsghdr) SetLen(length int) { 29 | cmsg.Len = uint32(length) 30 | } 31 | 32 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 33 | // TODO(aram): implement this, see issue 5847. 34 | panic("unimplemented") 35 | } 36 | -------------------------------------------------------------------------------- /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/zsysnum_solaris_amd64.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 amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-8 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-4 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-8 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_unset.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 windows 6 | // +build go1.4 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | func Unsetenv(key string) error { 13 | // This was added in Go 1.4. 14 | return syscall.Unsetenv(key) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/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/text/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/text/encoding/japanese/all.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 japanese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{EUCJP, ISO2022JP, ShiftJIS} 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/simplifiedchinese/all.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 simplifiedchinese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{GB18030, GBK, HZGB2312} 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // langAliasType is the type of an alias in langAliasMap. 8 | type langAliasType int8 9 | 10 | const ( 11 | langDeprecated langAliasType = iota 12 | langMacro 13 | langLegacy 14 | 15 | langAliasTypeUnknown langAliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/gen_common.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 ignore 6 | 7 | package main 8 | 9 | // This file contains code common to the maketables.go and the package code. 10 | 11 | // langAliasType is the type of an alias in langAliasMap. 12 | type langAliasType int8 13 | 14 | const ( 15 | langDeprecated langAliasType = iota 16 | langMacro 17 | langLegacy 18 | 19 | langAliasTypeUnknown langAliasType = -1 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_1.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 !go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | func sortStable(s sort.Interface) { 12 | ss := stableSort{ 13 | s: s, 14 | pos: make([]int, s.Len()), 15 | } 16 | for i := range ss.pos { 17 | ss.pos[i] = i 18 | } 19 | sort.Sort(&ss) 20 | } 21 | 22 | type stableSort struct { 23 | s sort.Interface 24 | pos []int 25 | } 26 | 27 | func (s *stableSort) Len() int { 28 | return len(s.pos) 29 | } 30 | 31 | func (s *stableSort) Less(i, j int) bool { 32 | return s.s.Less(i, j) || !s.s.Less(j, i) && s.pos[i] < s.pos[j] 33 | } 34 | 35 | func (s *stableSort) Swap(i, j int) { 36 | s.s.Swap(i, j) 37 | s.pos[i], s.pos[j] = s.pos[j], s.pos[i] 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/language/go1_2.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 go1.2 6 | 7 | package language 8 | 9 | import "sort" 10 | 11 | var sortStable = sort.Stable 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/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/tools/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/tools/go/internal/gcimporter/isAlias18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package gcimporter 8 | 9 | import "go/types" 10 | 11 | func isAlias(obj *types.TypeName) bool { 12 | return false // there are no type aliases before Go 1.9 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/internal/gcimporter/isAlias19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package gcimporter 8 | 9 | import "go/types" 10 | 11 | func isAlias(obj *types.TypeName) bool { 12 | return obj.IsAlias() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/types/typeutil/imports.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 | package typeutil 6 | 7 | import "go/types" 8 | 9 | // Dependencies returns all dependencies of the specified packages. 10 | // 11 | // Dependent packages appear in topological order: if package P imports 12 | // package Q, Q appears earlier than P in the result. 13 | // The algorithm follows import statements in the order they 14 | // appear in the source code, so the result is a total order. 15 | // 16 | func Dependencies(pkgs ...*types.Package) []*types.Package { 17 | var result []*types.Package 18 | seen := make(map[*types.Package]bool) 19 | var visit func(pkgs []*types.Package) 20 | visit = func(pkgs []*types.Package) { 21 | for _, p := range pkgs { 22 | if !seen[p] { 23 | seen[p] = true 24 | visit(p.Imports()) 25 | result = append(result, p) 26 | } 27 | } 28 | } 29 | visit(pkgs) 30 | return result 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/third_party/moduleloader/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2016 Guy Bedford, Luke Hoban, Addy Osmani 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/credentials/credentials_util_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package credentials 22 | 23 | import ( 24 | "crypto/tls" 25 | ) 26 | 27 | // cloneTLSConfig returns a shallow clone of the exported 28 | // fields of cfg, ignoring the unexported sync.Once, which 29 | // contains a mutex and must not be copied. 30 | // 31 | // If cfg is nil, a new zero tls.Config is returned. 32 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 33 | if cfg == nil { 34 | return &tls.Config{} 35 | } 36 | 37 | return cfg.Clone() 38 | } 39 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | /* 20 | Package grpc implements an RPC system called gRPC. 21 | 22 | See grpc.io for more information about gRPC. 23 | */ 24 | package grpc // import "google.golang.org/grpc" 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/internal.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 gRPC authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | // Package internal contains gRPC-internal code for testing, to avoid polluting 19 | // the godoc of the top-level grpc package. 20 | package internal 21 | 22 | // TestingUseHandlerImpl enables the http.Handler-based server implementation. 23 | // It must be called before Serve and requires TLS credentials. 24 | // 25 | // The provided grpcServer must be of type *grpc.Server. It is untyped 26 | // for circular dependency reasons. 27 | var TestingUseHandlerImpl func(grpcServer interface{}) 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6,!go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6, !go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | lookupTXT = func(ctx context.Context, name string) ([]string, error) { return net.LookupTXT(name) } 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | lookupTXT = net.DefaultResolver.LookupTXT 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/LICENSE: -------------------------------------------------------------------------------- 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/honnef.co/go/js/dom/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Dominik Honnef 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | --------------------------------------------------------------------------------