├── .dockerignore ├── .editorconfig ├── .github ├── CODE_OF_CONDUCT.md ├── DCO └── screenshot.png ├── .gitignore ├── .travis.yml ├── Dockerfile ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE ├── MAINTAINERS ├── Makefile ├── README.md ├── cmd └── gitbase-web │ └── main.go ├── docker-compose.build.yml ├── docker-compose.yml ├── docs ├── CONTRIBUTING.md └── rest-api.md ├── frontend ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── craco.config.js ├── package.json ├── public │ ├── favicon.ico │ ├── index.html │ └── manifest.json ├── src │ ├── App.js │ ├── App.less │ ├── App.test.js │ ├── api.js │ ├── components │ │ ├── CodeViewer.js │ │ ├── CodeViewer.less │ │ ├── DivTabs.js │ │ ├── HelpModal.js │ │ ├── HelpModal.less │ │ ├── HistoryTable.js │ │ ├── HistoryTable.less │ │ ├── ParseModeSwitcher.js │ │ ├── ParseModeSwitcher.test.js │ │ ├── QueryBox.js │ │ ├── QueryBox.less │ │ ├── ResultsTable.js │ │ ├── ResultsTable.less │ │ ├── ResultsTable.test.js │ │ ├── SampleQueries.js │ │ ├── SampleQueries.less │ │ ├── Schema.js │ │ ├── Schema.less │ │ ├── Sidebar.js │ │ ├── Sidebar.less │ │ ├── TabbedResults.js │ │ ├── TabbedResults.less │ │ ├── UASTViewer.js │ │ ├── UASTViewerPane.js │ │ ├── UASTViewerPane.less │ │ └── __snapshots__ │ │ │ ├── ParseModeSwitcher.test.js.snap │ │ │ └── ResultsTable.test.js.snap │ ├── fonts.less │ ├── fonts │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lujVj9_mf.woff2 │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lujVj9_mf.woff2 │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2 │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lujVj9_mf.woff2 │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lujVj9_mf.woff2 │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7lujVj9w.woff2 │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lujVj9_mf.woff2 │ │ ├── hack-bold.woff │ │ ├── hack-bold.woff2 │ │ ├── hack-bolditalic.woff │ │ ├── hack-bolditalic.woff2 │ │ ├── hack-italic.woff │ │ ├── hack-italic.woff2 │ │ ├── hack-regular.woff │ │ └── hack-regular.woff2 │ ├── icons │ │ ├── alex-loading-results.gif │ │ ├── alex-suspended-tab.gif │ │ ├── broken-alex.gif │ │ ├── close-query-tab.svg │ │ ├── close-tree.svg │ │ ├── collapse-left-column.svg │ │ ├── edit-query-tab-name.svg │ │ ├── error-query.svg │ │ ├── example-query.svg │ │ ├── help.svg │ │ ├── history-tab.svg │ │ ├── links.svg │ │ ├── open-tree.svg │ │ ├── success-query.svg │ │ └── tree-column.svg │ ├── index.js │ ├── setupProxy.js │ ├── setupTests.js │ ├── state │ │ └── query.js │ ├── utils │ │ └── bootstrap.js │ └── variables.less └── yarn.lock ├── server ├── common_test.go ├── handler │ ├── common_integration_test.go │ ├── common_unit_test.go │ ├── detect_lang.go │ ├── detect_lang_test.go │ ├── export.go │ ├── export_integration_test.go │ ├── export_test.go │ ├── query.go │ ├── query_integration_test.go │ ├── query_test.go │ ├── query_uast_integration_test.go │ ├── render.go │ ├── schema.go │ ├── schema_integration_test.go │ ├── schema_test.go │ ├── static_files.go │ ├── static_files_dev.go │ ├── uast.go │ ├── uast_integration_test.go │ └── version.go ├── router.go ├── router_test.go ├── serializer │ ├── serializers.go │ └── serializers_test.go ├── service │ ├── common.go │ ├── common_test.go │ └── uast.go └── testing │ └── common.go └── vendor ├── github.com ├── BurntSushi │ └── toml │ │ ├── COPYING │ │ ├── cmd │ │ ├── toml-test-decoder │ │ │ └── COPYING │ │ ├── toml-test-encoder │ │ │ └── COPYING │ │ └── tomlv │ │ │ └── COPYING │ │ ├── decode.go │ │ ├── decode_meta.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encoding_types.go │ │ ├── encoding_types_1.1.go │ │ ├── lex.go │ │ ├── parse.go │ │ ├── type_check.go │ │ └── type_fields.go ├── antchfx │ └── xpath │ │ ├── LICENSE │ │ ├── build.go │ │ ├── func.go │ │ ├── func_go110.go │ │ ├── func_pre_go110.go │ │ ├── operator.go │ │ ├── parse.go │ │ ├── query.go │ │ └── xpath.go ├── bblfsh │ └── go-client │ │ ├── LICENSE │ │ ├── client.go │ │ ├── doc.go │ │ ├── request.go │ │ └── tools │ │ ├── context.go │ │ └── tools.go ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── go-chi │ └── chi │ │ ├── LICENSE │ │ ├── chain.go │ │ ├── chi.go │ │ ├── context.go │ │ ├── middleware │ │ ├── compress.go │ │ ├── content_charset.go │ │ ├── content_type.go │ │ ├── get_head.go │ │ ├── heartbeat.go │ │ ├── logger.go │ │ ├── middleware.go │ │ ├── nocache.go │ │ ├── profiler.go │ │ ├── realip.go │ │ ├── recoverer.go │ │ ├── request_id.go │ │ ├── strip.go │ │ ├── terminal.go │ │ ├── throttle.go │ │ ├── timeout.go │ │ ├── url_format.go │ │ ├── value.go │ │ └── wrap_writer.go │ │ ├── mux.go │ │ └── tree.go ├── go-sql-driver │ └── mysql │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── appengine.go │ │ ├── auth.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── connection.go │ │ ├── connection_go18.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── dsn.go │ │ ├── errors.go │ │ ├── fields.go │ │ ├── infile.go │ │ ├── packets.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── transaction.go │ │ ├── utils.go │ │ ├── utils_go17.go │ │ └── utils_go18.go ├── gogo │ └── protobuf │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── GOLANG_CONTRIBUTORS │ │ ├── LICENSE │ │ ├── gogoproto │ │ ├── doc.go │ │ ├── gogo.pb.go │ │ └── helper.go │ │ ├── proto │ │ ├── clone.go │ │ ├── custom_gogo.go │ │ ├── decode.go │ │ ├── discard.go │ │ ├── duration.go │ │ ├── duration_gogo.go │ │ ├── encode.go │ │ ├── encode_gogo.go │ │ ├── equal.go │ │ ├── extensions.go │ │ ├── extensions_gogo.go │ │ ├── lib.go │ │ ├── lib_gogo.go │ │ ├── message_set.go │ │ ├── pointer_reflect.go │ │ ├── pointer_reflect_gogo.go │ │ ├── pointer_unsafe.go │ │ ├── pointer_unsafe_gogo.go │ │ ├── properties.go │ │ ├── properties_gogo.go │ │ ├── skip_gogo.go │ │ ├── table_marshal.go │ │ ├── table_marshal_gogo.go │ │ ├── table_merge.go │ │ ├── table_unmarshal.go │ │ ├── table_unmarshal_gogo.go │ │ ├── text.go │ │ ├── text_gogo.go │ │ ├── text_parser.go │ │ ├── timestamp.go │ │ └── timestamp_gogo.go │ │ ├── protoc-gen-gogo │ │ └── descriptor │ │ │ ├── descriptor.go │ │ │ ├── descriptor.pb.go │ │ │ ├── descriptor_gostring.gen.go │ │ │ └── helper.go │ │ ├── sortkeys │ │ └── sortkeys.go │ │ └── types │ │ ├── any.go │ │ ├── any.pb.go │ │ ├── api.pb.go │ │ ├── doc.go │ │ ├── duration.go │ │ ├── duration.pb.go │ │ ├── duration_gogo.go │ │ ├── empty.pb.go │ │ ├── field_mask.pb.go │ │ ├── source_context.pb.go │ │ ├── struct.pb.go │ │ ├── timestamp.go │ │ ├── timestamp.pb.go │ │ ├── timestamp_gogo.go │ │ ├── type.pb.go │ │ └── wrappers.pb.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 │ │ └── ptypes │ │ ├── any.go │ │ ├── any │ │ └── any.pb.go │ │ ├── doc.go │ │ ├── duration.go │ │ ├── duration │ │ └── duration.pb.go │ │ ├── timestamp.go │ │ └── timestamp │ │ └── timestamp.pb.go ├── grpc-ecosystem │ └── grpc-opentracing │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── go │ │ └── otgrpc │ │ ├── client.go │ │ ├── errors.go │ │ ├── options.go │ │ ├── package.go │ │ ├── server.go │ │ └── shared.go ├── jessevdk │ └── go-flags │ │ ├── LICENSE │ │ ├── arg.go │ │ ├── closest.go │ │ ├── command.go │ │ ├── completion.go │ │ ├── convert.go │ │ ├── error.go │ │ ├── flags.go │ │ ├── group.go │ │ ├── help.go │ │ ├── ini.go │ │ ├── man.go │ │ ├── multitag.go │ │ ├── option.go │ │ ├── optstyle_other.go │ │ ├── optstyle_windows.go │ │ ├── parser.go │ │ ├── termsize.go │ │ ├── termsize_nosysioctl.go │ │ ├── tiocgwinsz_bsdish.go │ │ ├── tiocgwinsz_linux.go │ │ └── tiocgwinsz_other.go ├── kelseyhightower │ └── envconfig │ │ ├── LICENSE │ │ ├── doc.go │ │ ├── env_os.go │ │ ├── env_syscall.go │ │ ├── envconfig.go │ │ └── usage.go ├── konsorten │ └── go-windows-terminal-sequences │ │ ├── LICENSE │ │ └── sequences.go ├── mattn │ ├── go-colorable │ │ ├── LICENSE │ │ ├── colorable_appengine.go │ │ ├── colorable_others.go │ │ ├── colorable_windows.go │ │ └── noncolorable.go │ └── go-isatty │ │ ├── LICENSE │ │ ├── doc.go │ │ ├── isatty_appengine.go │ │ ├── isatty_bsd.go │ │ ├── isatty_linux.go │ │ ├── isatty_linux_ppc64x.go │ │ ├── isatty_others.go │ │ ├── isatty_solaris.go │ │ └── isatty_windows.go ├── mcuadros │ └── go-lookup │ │ ├── LICENSE │ │ └── lookup.go ├── mgutz │ └── ansi │ │ ├── LICENSE │ │ ├── ansi.go │ │ ├── doc.go │ │ └── print.go ├── opentracing │ └── opentracing-go │ │ ├── LICENSE │ │ ├── ext │ │ └── tags.go │ │ ├── globaltracer.go │ │ ├── gocontext.go │ │ ├── log │ │ ├── field.go │ │ └── util.go │ │ ├── noop.go │ │ ├── propagation.go │ │ ├── span.go │ │ └── tracer.go ├── pkg │ └── errors │ │ ├── LICENSE │ │ ├── errors.go │ │ └── stack.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── pressly │ └── lg │ │ ├── LICENSE │ │ ├── context.go │ │ ├── lg.go │ │ ├── redirect.go │ │ ├── request_logger.go │ │ └── sanitizing_logger.go ├── rs │ └── cors │ │ ├── LICENSE │ │ ├── cors.go │ │ └── utils.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_check_appengine.go │ │ ├── terminal_check_bsd.go │ │ ├── terminal_check_js.go │ │ ├── terminal_check_notappengine.go │ │ ├── terminal_check_unix.go │ │ ├── terminal_check_windows.go │ │ ├── terminal_notwindows.go │ │ ├── terminal_windows.go │ │ ├── text_formatter.go │ │ └── writer.go ├── src-d │ ├── envconfig │ │ ├── LICENSE │ │ ├── doc.go │ │ └── envconfig.go │ └── go-oniguruma │ │ ├── LICENSE │ │ ├── chelper.c │ │ ├── chelper.h │ │ ├── constants.go │ │ ├── quotemeta.go │ │ └── regex.go ├── stretchr │ └── testify │ │ ├── LICENSE │ │ ├── assert │ │ ├── assertion_format.go │ │ ├── assertion_forward.go │ │ ├── assertions.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ └── http_assertions.go │ │ ├── require │ │ ├── doc.go │ │ ├── forward_requirements.go │ │ ├── require.go │ │ ├── require_forward.go │ │ └── requirements.go │ │ └── suite │ │ ├── doc.go │ │ ├── interfaces.go │ │ └── suite.go ├── toqueteos │ └── trie │ │ ├── LICENSE.txt │ │ └── trie.go └── x-cray │ └── logrus-prefixed-formatter │ ├── LICENSE │ └── formatter.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 │ ├── http │ │ └── httpguts │ │ │ ├── guts.go │ │ │ └── httplex.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 │ └── trace │ │ ├── events.go │ │ ├── histogram.go │ │ ├── trace.go │ │ ├── trace_go16.go │ │ └── trace_go17.go │ ├── sys │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── unix │ │ ├── affinity_linux.go │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── fcntl.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── mkpost.go │ │ ├── openbsd_pledge.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── timestruct.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go │ └── windows │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── dll_windows.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── types_windows.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ └── zsyscall_windows.go │ └── text │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── collate │ ├── build │ │ ├── builder.go │ │ ├── colelem.go │ │ ├── contract.go │ │ ├── order.go │ │ ├── table.go │ │ └── trie.go │ ├── collate.go │ ├── index.go │ ├── maketables.go │ ├── option.go │ ├── sort.go │ └── tables.go │ ├── internal │ ├── colltab │ │ ├── collelem.go │ │ ├── colltab.go │ │ ├── contract.go │ │ ├── iter.go │ │ ├── numeric.go │ │ ├── table.go │ │ ├── trie.go │ │ └── weighter.go │ ├── gen │ │ ├── code.go │ │ └── gen.go │ ├── tag │ │ └── tag.go │ ├── triegen │ │ ├── compact.go │ │ ├── print.go │ │ └── triegen.go │ └── ucd │ │ └── ucd.go │ ├── language │ ├── common.go │ ├── coverage.go │ ├── doc.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 │ ├── secure │ └── bidirule │ │ ├── bidirule.go │ │ ├── bidirule10.0.0.go │ │ └── bidirule9.0.0.go │ ├── transform │ └── transform.go │ └── unicode │ ├── bidi │ ├── bidi.go │ ├── bracket.go │ ├── core.go │ ├── gen.go │ ├── gen_ranges.go │ ├── gen_trieval.go │ ├── prop.go │ ├── tables10.0.0.go │ ├── tables9.0.0.go │ └── trieval.go │ ├── 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 │ ├── tables10.0.0.go │ ├── tables9.0.0.go │ ├── transform.go │ ├── trie.go │ └── triegen.go │ └── rangetable │ ├── gen.go │ ├── merge.go │ ├── rangetable.go │ ├── tables10.0.0.go │ └── tables9.0.0.go ├── google.golang.org ├── appengine │ ├── LICENSE │ └── cloudsql │ │ ├── cloudsql.go │ │ ├── cloudsql_classic.go │ │ └── cloudsql_vm.go ├── 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 │ ├── go16.go │ ├── go17.go │ ├── go18.go │ └── go19.go │ ├── dialoptions.go │ ├── doc.go │ ├── encoding │ ├── encoding.go │ └── proto │ │ └── proto.go │ ├── go16.go │ ├── go17.go │ ├── grpclog │ ├── grpclog.go │ ├── logger.go │ └── loggerv2.go │ ├── interceptor.go │ ├── internal │ ├── backoff │ │ └── backoff.go │ ├── channelz │ │ ├── funcs.go │ │ ├── types.go │ │ ├── types_linux.go │ │ ├── types_nonlinux.go │ │ ├── util_linux_go19.go │ │ └── util_nonlinux_pre_go19.go │ ├── envconfig │ │ └── envconfig.go │ ├── grpcrand │ │ └── grpcrand.go │ ├── internal.go │ └── transport │ │ ├── bdp_estimator.go │ │ ├── controlbuf.go │ │ ├── defaults.go │ │ ├── flowcontrol.go │ │ ├── go16.go │ │ ├── go17.go │ │ ├── handler_server.go │ │ ├── http2_client.go │ │ ├── http2_server.go │ │ ├── http_util.go │ │ ├── log.go │ │ └── transport.go │ ├── keepalive │ └── keepalive.go │ ├── metadata │ └── metadata.go │ ├── naming │ ├── dns_resolver.go │ ├── go17.go │ ├── go18.go │ └── naming.go │ ├── peer │ └── peer.go │ ├── picker_wrapper.go │ ├── pickfirst.go │ ├── proxy.go │ ├── resolver │ ├── dns │ │ ├── dns_resolver.go │ │ ├── go17.go │ │ └── go18.go │ ├── passthrough │ │ └── passthrough.go │ └── resolver.go │ ├── resolver_conn_wrapper.go │ ├── rpc_util.go │ ├── server.go │ ├── service_config.go │ ├── stats │ ├── handlers.go │ └── stats.go │ ├── status │ ├── go16.go │ ├── go17.go │ └── status.go │ ├── stream.go │ ├── tap │ └── tap.go │ ├── trace.go │ └── version.go └── gopkg.in ├── DATA-DOG └── go-sqlmock.v1 │ ├── LICENSE │ ├── argument.go │ ├── driver.go │ ├── expectations.go │ ├── expectations_before_go18.go │ ├── expectations_go18.go │ ├── options.go │ ├── query.go │ ├── result.go │ ├── rows.go │ ├── rows_go18.go │ ├── sqlmock.go │ ├── sqlmock_go18.go │ └── statement.go ├── bblfsh ├── sdk.v1 │ ├── LICENSE │ ├── etc │ │ └── skeleton │ │ │ └── LICENSE │ ├── manifest │ │ └── manifest.go │ ├── protocol │ │ ├── generated.pb.go │ │ ├── server.proteus.go │ │ ├── service.go │ │ ├── stringer.go │ │ └── types.go │ └── uast │ │ ├── generated.pb.go │ │ ├── iter.go │ │ ├── node.go │ │ ├── pretty.go │ │ ├── role_string.go │ │ └── uast.go └── sdk.v2 │ ├── LICENSE │ ├── driver │ ├── driver.go │ ├── errors │ │ └── errors.go │ ├── impl.go │ ├── manifest │ │ └── manifest.go │ └── transforms.go │ ├── etc │ └── skeleton │ │ └── LICENSE │ ├── protocol │ ├── driver.go │ └── driver.pb.go │ └── uast │ ├── iter.go │ ├── nodes │ ├── external.go │ ├── hash.go │ ├── iter.go │ ├── node.go │ └── nodesproto │ │ ├── nodes.pb.go │ │ ├── nodesproto.go │ │ └── pio │ │ ├── io.go │ │ └── varint.go │ ├── query │ ├── iter.go │ ├── query.go │ └── xpath │ │ ├── query.go │ │ └── xpath.go │ ├── role │ ├── generated.pb.go │ ├── role.go │ └── role_string.go │ ├── transformer │ ├── arrays.go │ ├── ast.go │ ├── conv.go │ ├── errors.go │ ├── legacy.go │ ├── ops.go │ ├── semantic.go │ └── transformer.go │ ├── types.go │ └── uast.go ├── src-d ├── enry.v1 │ ├── LICENSE │ ├── classifier.go │ ├── common.go │ ├── data │ │ ├── alias.go │ │ ├── commit.go │ │ ├── content.go │ │ ├── doc.go │ │ ├── documentation.go │ │ ├── extension.go │ │ ├── filename.go │ │ ├── frequencies.go │ │ ├── heuristics.go │ │ ├── interpreter.go │ │ ├── mimeType.go │ │ ├── rule │ │ │ └── rule.go │ │ ├── type.go │ │ └── vendor.go │ ├── enry.go │ ├── internal │ │ └── tokenizer │ │ │ └── tokenize.go │ ├── regex │ │ ├── oniguruma.go │ │ └── standard.go │ └── utils.go ├── go-cli.v0 │ ├── LICENSE │ ├── addcommand.go │ ├── cli.go │ ├── context.go │ ├── doc.go │ ├── log.go │ ├── pprof.go │ ├── profiler.go │ └── version.go ├── go-errors.v1 │ ├── LICENSE │ ├── doc.go │ ├── error.go │ ├── matcher.go │ └── stack.go └── go-log.v1 │ ├── LICENSE │ ├── default.go │ ├── doc.go │ ├── factory.go │ ├── filename.go │ └── logger.go └── toqueteos └── substring.v1 ├── LICENSE ├── bytes.go ├── lib.go └── string.go /.dockerignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /vendor 3 | /repos 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps developers define and maintain consistent 2 | # coding styles between different editors and IDEs 3 | # editorconfig.org 4 | 5 | root = true 6 | 7 | [*] 8 | end_of_line = lf 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | insert_final_newline = true 12 | indent_style = space 13 | indent_size = 4 14 | 15 | [*.hbs] 16 | insert_final_newline = false 17 | 18 | [*.{js,ts,jsx,yml,json,diff,lock}] 19 | indent_size = 2 20 | 21 | [*.{diff}] 22 | trim_trailing_whitespace = false 23 | 24 | [{*.go,Makefile,Makefile.*,makefile}] 25 | indent_style = tab 26 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | All activities under source{d} projects are governed by the [source{d} code of conduct](https://github.com/src-d/guide/blob/master/.github/CODE_OF_CONDUCT.md). 4 | -------------------------------------------------------------------------------- /.github/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/.github/screenshot.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # default internal db 2 | /repos 3 | 4 | # dependencies 5 | /node_modules 6 | 7 | # builds 8 | /build 9 | server/assets/asset.go 10 | 11 | # testing, logs, caches... 12 | /coverage 13 | coverage.txt 14 | profile.out 15 | npm-debug.log* 16 | yarn-debug.log* 17 | yarn-error.log* 18 | .eslintcache 19 | 20 | # misc 21 | .DS_Store 22 | .env 23 | .env.local 24 | .env.development.local 25 | .env.test.local 26 | .env.production.local 27 | 28 | # ci files 29 | .ci 30 | .docsrv-resources 31 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch-slim 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y --no-install-recommends --no-install-suggests \ 5 | ca-certificates \ 6 | && apt-get clean 7 | 8 | ADD ./build/bin /bin 9 | 10 | ENTRYPOINT ["/bin/gitbase-web"] 11 | CMD ["serve"] 12 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html 2 | # for detailed Gopkg.toml documentation. 3 | 4 | [prune] 5 | go-tests = true 6 | unused-packages = true 7 | non-go = true 8 | 9 | [[constraint]] 10 | name = "github.com/go-chi/chi" 11 | version = "4.0.1" 12 | 13 | [[constraint]] 14 | name = "github.com/kelseyhightower/envconfig" 15 | version = "1.3.0" 16 | 17 | [[constraint]] 18 | name = "github.com/pressly/lg" 19 | version = "1.1.0" 20 | 21 | [[constraint]] 22 | name = "github.com/rs/cors" 23 | version = "1.3.0" 24 | 25 | [[constraint]] 26 | name = "github.com/sirupsen/logrus" 27 | version = "1.0.5" 28 | 29 | [[constraint]] 30 | name = "github.com/go-sql-driver/mysql" 31 | version = "1.4.0" 32 | 33 | [[constraint]] 34 | name = "github.com/stretchr/testify" 35 | version = "1.2.2" 36 | 37 | [[constraint]] 38 | name = "gopkg.in/bblfsh/sdk.v2" 39 | version = "2.3.0" 40 | 41 | [[constraint]] 42 | name = "gopkg.in/DATA-DOG/go-sqlmock.v1" 43 | version = "1.3.0" 44 | 45 | [[constraint]] 46 | name = "gopkg.in/src-d/enry.v1" 47 | version = "1.6.4" 48 | 49 | [[constraint]] 50 | name = "gopkg.in/src-d/go-cli.v0" 51 | branch= "master" 52 | 53 | [[constraint]] 54 | name = "github.com/bblfsh/go-client" 55 | version = "4.0.0" 56 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | Lou Marvin Caraig (@se7entyse7en) -------------------------------------------------------------------------------- /docker-compose.build.yml: -------------------------------------------------------------------------------- 1 | version: '3.3' 2 | 3 | services: 4 | gitbase-web: 5 | image: gitbase-web-dev 6 | build: . 7 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.3' 2 | 3 | services: 4 | gitbase-web: 5 | image: "srcd/gitbase-web" 6 | ports: 7 | - "8080:8080" 8 | environment: 9 | GITBASEPG_DB_CONNECTION: root@tcp(gitbase:3306)/none?maxAllowedPacket=4194304 10 | GITBASEPG_BBLFSH_SERVER_URL: bblfsh:9432 11 | depends_on: 12 | - gitbase 13 | gitbase: 14 | image: "srcd/gitbase:v0.19.0" 15 | environment: 16 | BBLFSH_ENDPOINT: bblfsh:9432 17 | volumes: 18 | - ${GITBASEPG_REPOS_FOLDER}:/opt/repos 19 | bblfsh: 20 | image: "bblfsh/bblfshd:v2.12.1-drivers" 21 | privileged: true 22 | -------------------------------------------------------------------------------- /frontend/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: [ 3 | 'airbnb-base', 4 | 'plugin:react/recommended', 5 | 'prettier', 6 | 'prettier/react', 7 | ], 8 | env: { 9 | browser: true, 10 | es6: true, 11 | node: true, 12 | 'jest/globals': true, 13 | }, 14 | plugins: ['import', 'react', 'jest', 'prettier'], 15 | rules: { 16 | 'prettier/prettier': 'error', 17 | 'import/no-extraneous-dependencies': ['error', { 'devDependencies': ['**/*.test.js', 'src/setupTests.js'] }], 18 | 'import/no-unresolved': 0, 19 | 'import/extensions': 0, 20 | 'func-names': 0, 21 | 'no-plusplus': 0, 22 | 'class-methods-use-this': 0, // strange rule. It doesn't allow to create method render() without this 23 | 'no-case-declarations': 0, // otherwise code is very ugly 24 | }, 25 | settings: { 26 | "react": { 27 | "version": "detect", 28 | }, 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | 23 | .eslintcache 24 | -------------------------------------------------------------------------------- /frontend/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /frontend/craco.config.js: -------------------------------------------------------------------------------- 1 | const CracoLessPlugin = require('craco-less'); 2 | const { ESLINT_MODES } = require('@craco/craco'); 3 | 4 | module.exports = { 5 | plugins: [{ plugin: CracoLessPlugin }], 6 | eslint: { 7 | mode: ESLINT_MODES.file 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/public/favicon.ico -------------------------------------------------------------------------------- /frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Gitbase Web", 3 | "name": "Gitbase Web", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /frontend/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | it('renders without crashing', () => { 6 | const div = document.createElement('div'); 7 | ReactDOM.render(, div); 8 | ReactDOM.unmountComponentAtNode(div); 9 | }); 10 | -------------------------------------------------------------------------------- /frontend/src/components/HelpModal.less: -------------------------------------------------------------------------------- 1 | @import '../variables.less'; 2 | 3 | .kb-shortcuts-title { 4 | text-transform: uppercase; 5 | line-height: 2em; 6 | margin-top: 2em; 7 | 8 | border-bottom: solid 1px @primary-tint-3; 9 | 10 | color: @dark-text; 11 | font-size: 20px; 12 | font-weight: normal; 13 | letter-spacing: 0.8px; 14 | } 15 | 16 | table.keyboard-shortcuts { 17 | width: 100%; 18 | 19 | td { 20 | padding-bottom: 1em; 21 | } 22 | 23 | td.keys { 24 | text-align: right; 25 | padding-right: 20px; 26 | } 27 | 28 | div.key { 29 | display: inline; 30 | color: @dark-text; 31 | font-family: @monospace-font; 32 | font-weight: @bold-font-weight; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /frontend/src/components/HistoryTable.less: -------------------------------------------------------------------------------- 1 | @import '../variables.less'; 2 | 3 | .history { 4 | flex: 1; 5 | display: flex; 6 | flex-direction: column; 7 | 8 | a { 9 | color: @tertiary-tint-2; 10 | letter-spacing: 0.5px; 11 | font-weight: @bold-font-weight; 12 | text-decoration: underline; 13 | 14 | &:hover { 15 | cursor: pointer; 16 | color: darken(@tertiary-tint-2, 10%); 17 | } 18 | } 19 | 20 | .toolbar { 21 | margin-bottom: 10px; 22 | 23 | text-align: right; 24 | } 25 | 26 | .history-log { 27 | &.history-stat-error { 28 | color: @error-text; 29 | } 30 | 31 | &.history-stat-success { 32 | color: @secondary-tint-2; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /frontend/src/components/ParseModeSwitcher.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import api from '../api'; 4 | 5 | function ParseModeSwitcher({ mode, handleModeChange }) { 6 | return ( 7 |
8 | {api.uastModes.map(m => ( 9 | 24 | ))} 25 |
26 | ); 27 | } 28 | 29 | ParseModeSwitcher.propTypes = { 30 | mode: PropTypes.string.isRequired, 31 | handleModeChange: PropTypes.func.isRequired 32 | }; 33 | 34 | export default ParseModeSwitcher; 35 | -------------------------------------------------------------------------------- /frontend/src/components/ParseModeSwitcher.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { shallow } from 'enzyme'; 3 | import renderer from 'react-test-renderer'; 4 | import ParseModeSwitcher from './ParseModeSwitcher'; 5 | 6 | test('it renders correctly', () => { 7 | const tree = renderer 8 | .create( 9 | null} /> 10 | ) 11 | .toJSON(); 12 | 13 | expect(tree).toMatchSnapshot(); 14 | }); 15 | 16 | test('it calls handleModeChange when the input is clicked', () => { 17 | const spy = jest.fn(); 18 | const wrapper = shallow( 19 | 20 | ); 21 | wrapper 22 | .find('[value="annotated"]') 23 | .simulate('change', { target: { value: 'annotated' } }); 24 | expect(spy.mock.calls.length).toBe(1); 25 | }); 26 | -------------------------------------------------------------------------------- /frontend/src/components/ResultsTable.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import renderer from 'react-test-renderer'; 3 | import ResultsTable from './ResultsTable'; 4 | 5 | describe('ResultsTable', () => { 6 | const noop = () => null; 7 | 8 | it('text with new lines should be shown as code', () => { 9 | const response = { 10 | meta: { 11 | headers: ['notCode', 'code'], 12 | types: ['TEXT', 'TEXT'] 13 | }, 14 | data: [{ notCode: 'not a code', code: 'this\nis\ncode' }] 15 | }; 16 | const tree = renderer 17 | .create( 18 | 19 | ) 20 | .toJSON(); 21 | 22 | expect(tree).toMatchSnapshot(); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /frontend/src/components/SampleQueries.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import PropTypes from 'prop-types'; 3 | import './SampleQueries.less'; 4 | import { ReactComponent as ExampleIcon } from '../icons/example-query.svg'; 5 | 6 | function SampleQueries({ onExampleClick, exampleQueries }) { 7 | return ( 8 |
9 |
Sample Queries
10 |
11 | {exampleQueries.map((q, i) => ( 12 |
onExampleClick(q.sql)} 17 | > 18 | 19 | {q.name} 20 |
21 | ))} 22 |
23 |
24 | ); 25 | } 26 | 27 | SampleQueries.propTypes = { 28 | onExampleClick: PropTypes.func, 29 | exampleQueries: PropTypes.arrayOf( 30 | PropTypes.shape({ 31 | name: PropTypes.string.isRequired, 32 | sql: PropTypes.string.isRequired 33 | }).isRequired 34 | ) 35 | }; 36 | 37 | export default SampleQueries; 38 | -------------------------------------------------------------------------------- /frontend/src/components/SampleQueries.less: -------------------------------------------------------------------------------- 1 | @import '../variables.less'; 2 | 3 | .sample-queries { 4 | .title { 5 | letter-spacing: 0.5px; 6 | color: @primary; 7 | text-align: center; 8 | text-transform: uppercase; 9 | 10 | font-size: 14px; 11 | 12 | padding: 12px 0; 13 | margin-bottom: 19px; 14 | 15 | background-color: @query-examples-bock; 16 | } 17 | 18 | .query { 19 | padding-left: @big-spacing; 20 | overflow: hidden; 21 | white-space: nowrap; 22 | text-overflow: ellipsis; 23 | cursor: pointer; 24 | padding-right: 40px; 25 | 26 | .icon-container-variant(@primary-tint-2); 27 | 28 | &:hover { 29 | color: darken(@primary, 10%); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /frontend/src/components/Schema.less: -------------------------------------------------------------------------------- 1 | @import '../variables.less'; 2 | 3 | .schema-table { 4 | .name { 5 | color: @primary; 6 | > span { 7 | cursor: pointer; 8 | &:hover { 9 | color: darken(@primary, 10%); 10 | } 11 | } 12 | 13 | .small-icon { 14 | cursor: pointer; 15 | .icon-btn-variant(@primary-tint-2); 16 | } 17 | } 18 | 19 | .columns { 20 | margin-left: @big-spacing; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /frontend/src/components/__snapshots__/ParseModeSwitcher.test.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`it renders correctly 1`] = ` 4 |
11 | 28 | 45 | 62 |
63 | `; 64 | -------------------------------------------------------------------------------- /frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lujVj9_mf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qN67lujVj9_mf.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lujVj9_mf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNK7lujVj9_mf.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNa7lujVj9_mf.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lujVj9_mf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qNq7lujVj9_mf.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lujVj9_mf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qO67lujVj9_mf.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7lujVj9w.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7lujVj9w.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lujVj9_mf.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qPK7lujVj9_mf.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/hack-bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/hack-bold.woff -------------------------------------------------------------------------------- /frontend/src/fonts/hack-bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/hack-bold.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/hack-bolditalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/hack-bolditalic.woff -------------------------------------------------------------------------------- /frontend/src/fonts/hack-bolditalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/hack-bolditalic.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/hack-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/hack-italic.woff -------------------------------------------------------------------------------- /frontend/src/fonts/hack-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/hack-italic.woff2 -------------------------------------------------------------------------------- /frontend/src/fonts/hack-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/hack-regular.woff -------------------------------------------------------------------------------- /frontend/src/fonts/hack-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/fonts/hack-regular.woff2 -------------------------------------------------------------------------------- /frontend/src/icons/alex-loading-results.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/icons/alex-loading-results.gif -------------------------------------------------------------------------------- /frontend/src/icons/alex-suspended-tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/icons/alex-suspended-tab.gif -------------------------------------------------------------------------------- /frontend/src/icons/broken-alex.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/src-d/gitbase-web/1dd90d2581d4f9955702c3deef274a1c1e49e720/frontend/src/icons/broken-alex.gif -------------------------------------------------------------------------------- /frontend/src/icons/close-query-tab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/close-tree.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/collapse-left-column.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/edit-query-tab-name.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/error-query.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/example-query.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/help.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/history-tab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/links.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/open-tree.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/success-query.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/icons/tree-column.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /frontend/src/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import 'bootstrap/dist/css/bootstrap.css'; 4 | import './variables.less'; 5 | import App from './App'; 6 | 7 | ReactDOM.render(, document.getElementById('root')); 8 | 9 | if (!window.AbortController) { 10 | // eslint-disable-next-line no-console 11 | console.warn(`Cancelling gitbase queries is disabled; your browser does not support the AbortController interface. 12 | Please check for compatibility here: https://developer.mozilla.org/en-US/docs/Web/API/AbortController#Browser_compatibility`); 13 | } 14 | -------------------------------------------------------------------------------- /frontend/src/setupProxy.js: -------------------------------------------------------------------------------- 1 | const proxy = require('http-proxy-middleware'); 2 | 3 | module.exports = function(app) { 4 | [ 5 | '/query', 6 | '/export', 7 | '/schema', 8 | '/detect-lang', 9 | '/parse', 10 | '/get-languages', 11 | '/filter', 12 | '/version' 13 | ].forEach(path => app.use(proxy(path, { target: 'http://localhost:8080' }))); 14 | }; 15 | -------------------------------------------------------------------------------- /frontend/src/setupTests.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import os from 'os'; 3 | import 'abortcontroller-polyfill/dist/polyfill-patch-fetch'; 4 | import { configure } from 'enzyme'; 5 | import Adapter from 'enzyme-adapter-react-16'; 6 | import initButtonStyles from './utils/bootstrap'; 7 | 8 | configure({ adapter: new Adapter() }); 9 | 10 | const { LocalStorage } = require('node-localstorage'); 11 | // URL API for node 12 | const { URL } = require('whatwg-url'); 13 | 14 | global.URL = URL; 15 | global.fetch = require('jest-fetch-mock'); 16 | 17 | global.localStorage = new LocalStorage( 18 | path.join(os.tmpdir(), 'node-localstorage') 19 | ); 20 | 21 | global.window = document.defaultView; 22 | global.window.localStorage = global.localStorage; 23 | global.window.URLSearchParams = require('@ungap/url-search-params'); 24 | 25 | initButtonStyles(); 26 | 27 | // CodeMirror needs all of this in order to work. 28 | // see: https://discuss.codemirror.net/t/working-in-jsdom-or-node-js-natively/138/5 29 | global.document.body.createTextRange = function() { 30 | return { 31 | setEnd() {}, 32 | setStart() {}, 33 | getBoundingClientRect() { 34 | return { right: 0 }; 35 | }, 36 | getClientRects() { 37 | return { 38 | length: 0, 39 | left: 0, 40 | right: 0 41 | }; 42 | } 43 | }; 44 | }; 45 | -------------------------------------------------------------------------------- /frontend/src/state/query.js: -------------------------------------------------------------------------------- 1 | export const STATUS_LOADING = 'loading'; 2 | export const STATUS_ERROR = 'error'; 3 | export const STATUS_SUCCESS = 'success'; 4 | -------------------------------------------------------------------------------- /frontend/src/utils/bootstrap.js: -------------------------------------------------------------------------------- 1 | import { Button } from 'react-bootstrap'; 2 | import { bootstrapUtils } from 'react-bootstrap/lib/utils'; 3 | 4 | function initButtonStyles() { 5 | bootstrapUtils.addStyle(Button, 'gbpl-secondary'); 6 | bootstrapUtils.addStyle(Button, 'gbpl-secondary-tint-2-link'); 7 | bootstrapUtils.addStyle(Button, 'gbpl-tertiary'); 8 | bootstrapUtils.addStyle(Button, 'gbpl-tertiary-tint-2-link'); 9 | bootstrapUtils.addStyle(Button, 'gbpl-primary-tint-2'); 10 | bootstrapUtils.addStyle(Button, 'gbpl-primary-tint-2-link'); 11 | } 12 | 13 | export default initButtonStyles; 14 | -------------------------------------------------------------------------------- /server/handler/common_unit_test.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/src-d/gitbase-web/server/service" 7 | sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1" 8 | 9 | "github.com/pressly/lg" 10 | "github.com/sirupsen/logrus" 11 | "github.com/stretchr/testify/suite" 12 | ) 13 | 14 | type HandlerUnitSuite struct { 15 | suite.Suite 16 | db service.SQLDB 17 | mock sqlmock.Sqlmock 18 | handler http.Handler 19 | logger *logrus.Logger 20 | requestProcessFunc func(db service.SQLDB) RequestProcessFunc 21 | IsIntegration bool 22 | } 23 | 24 | func (suite *HandlerUnitSuite) SetupSuite() { 25 | // logger 26 | suite.logger = logrus.New() 27 | suite.logger.SetLevel(logrus.FatalLevel) 28 | } 29 | 30 | func (suite *HandlerUnitSuite) SetupTest() { 31 | var err error 32 | suite.db, suite.mock, err = sqlmock.New() 33 | if err != nil { 34 | suite.T().Fatalf("failed to initialize the mock DB. '%s'", err) 35 | } 36 | 37 | h := APIHandlerFunc(suite.requestProcessFunc(suite.db)) 38 | suite.handler = lg.RequestLogger(suite.logger)(h) 39 | } 40 | 41 | func (suite *HandlerUnitSuite) TearDownTest() { 42 | defer suite.db.Close() 43 | 44 | if err := suite.mock.ExpectationsWereMet(); err != nil { 45 | suite.FailNowf("there were unfulfilled expectations:", err.Error()) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /server/handler/detect_lang.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "encoding/json" 5 | "io/ioutil" 6 | "net/http" 7 | 8 | "gopkg.in/src-d/enry.v1" 9 | 10 | "github.com/src-d/gitbase-web/server/serializer" 11 | ) 12 | 13 | type detectLangRequest struct { 14 | Content string `json:"content"` 15 | Filename string `json:"filename"` 16 | } 17 | 18 | // DetectLanguage returns a function that detects language by filename and content 19 | func DetectLanguage() RequestProcessFunc { 20 | return func(r *http.Request) (res *serializer.Response, err error) { 21 | var req detectLangRequest 22 | body, err := ioutil.ReadAll(r.Body) 23 | if err != nil { 24 | return nil, err 25 | } 26 | 27 | err = json.Unmarshal(body, &req) 28 | if err != nil { 29 | return nil, serializer.NewHTTPError(http.StatusBadRequest, err.Error()) 30 | } 31 | 32 | lang := enry.GetLanguage(req.Filename, []byte(req.Content)) 33 | langType := enry.GetLanguageType(lang) 34 | return serializer.NewDetectLangResponse(lang, langType), nil 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /server/handler/schema_test.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "net/http" 5 | "net/http/httptest" 6 | "testing" 7 | 8 | "github.com/stretchr/testify/suite" 9 | sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1" 10 | ) 11 | 12 | type SchemaSuite struct { 13 | HandlerUnitSuite 14 | } 15 | 16 | // Tests 17 | // ----------------------------------------------------------------------------- 18 | 19 | func TestSchemaSuite(t *testing.T) { 20 | s := new(SchemaSuite) 21 | s.requestProcessFunc = Schema 22 | 23 | suite.Run(t, s) 24 | } 25 | 26 | func (suite *SchemaSuite) TestGet() { 27 | suite.mock.ExpectQuery("SHOW TABLES").WillReturnRows( 28 | sqlmock.NewRows([]string{"table"}). 29 | AddRow("foo")) 30 | 31 | suite.mock.ExpectQuery("DESCRIBE TABLE foo").WillReturnRows( 32 | sqlmock.NewRows([]string{"name", "type"}). 33 | AddRow("foo", "TEXT"). 34 | AddRow("bar", "TEXT")) 35 | 36 | req, _ := http.NewRequest("GET", "/schema", nil) 37 | 38 | res := httptest.NewRecorder() 39 | suite.handler.ServeHTTP(res, req) 40 | 41 | suite.Equal(http.StatusOK, res.Code) 42 | } 43 | -------------------------------------------------------------------------------- /server/handler/static_files_dev.go: -------------------------------------------------------------------------------- 1 | // +build !bindata 2 | 3 | package handler 4 | 5 | import ( 6 | "net/http" 7 | ) 8 | 9 | // Static without the 'bindata' tag contains a placeholder handler 10 | // that returns 'not implemented' 11 | type Static struct{} 12 | 13 | // NewStatic creates new Static 14 | func NewStatic(dir, serverURL string, selectLimit int, footerHTML string) *Static { 15 | return &Static{} 16 | } 17 | 18 | // ServeHTTP serves any static file from static directory or fallbacks on index.hml 19 | func (s *Static) ServeHTTP(w http.ResponseWriter, r *http.Request) { 20 | http.Error(w, 21 | "Frontend assets are only available when using 'make build' or 'make serve'", 22 | http.StatusNotImplemented) 23 | 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /server/handler/version.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "net/http" 5 | 6 | bblfsh "github.com/bblfsh/go-client" 7 | "github.com/src-d/gitbase-web/server/serializer" 8 | "github.com/src-d/gitbase-web/server/service" 9 | ) 10 | 11 | // Version returns a function that returns a *serializer.Response 12 | // with a current version of server and dependencies 13 | func Version(version, bbblfshServerURL string, db service.SQLDB) RequestProcessFunc { 14 | return func(r *http.Request) (*serializer.Response, error) { 15 | // old versions of gitbase don't have VERSION() function 16 | // so we set it to undefined and ignore error 17 | gitbaseVersion := "undefined" 18 | row := db.QueryRow("SELECT VERSION()") 19 | if row != nil { 20 | row.Scan(&gitbaseVersion) 21 | } 22 | 23 | // ignore bblfsh errors and return undefined to be consistent with gitbase 24 | bblfshVersion := "undefined" 25 | cli, err := bblfsh.NewClient(bbblfshServerURL) 26 | if err == nil { 27 | resp, err := cli.NewVersionRequest().Do() 28 | if err == nil { 29 | bblfshVersion = resp.Version 30 | } 31 | } 32 | 33 | return serializer.NewVersionResponse(version, bblfshVersion, gitbaseVersion), nil 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /server/serializer/serializers_test.go: -------------------------------------------------------------------------------- 1 | package serializer_test 2 | -------------------------------------------------------------------------------- /server/service/common.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "context" 5 | "database/sql" 6 | ) 7 | 8 | // SQLDB describes a *sql.DB 9 | type SQLDB interface { 10 | Close() error 11 | Conn(context.Context) (*sql.Conn, error) 12 | Query(query string, args ...interface{}) (*sql.Rows, error) 13 | QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) 14 | QueryRow(query string, args ...interface{}) *sql.Row 15 | Ping() error 16 | Exec(query string, args ...interface{}) (sql.Result, error) 17 | } 18 | -------------------------------------------------------------------------------- /server/service/common_test.go: -------------------------------------------------------------------------------- 1 | package service_test 2 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/cmd/toml-test-decoder/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/cmd/toml-test-encoder/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/cmd/tomlv/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package toml provides facilities for decoding and encoding TOML configuration 3 | files via reflection. There is also support for delaying decoding with 4 | the Primitive type, and querying the set of keys in a TOML document with the 5 | MetaData type. 6 | 7 | The specification implemented: https://github.com/toml-lang/toml 8 | 9 | The sub-command github.com/BurntSushi/toml/cmd/tomlv can be used to verify 10 | whether a file is a valid TOML document. It can also be used to print the 11 | type of each key in a TOML document. 12 | 13 | Testing 14 | 15 | There are two important types of tests used for this package. The first is 16 | contained inside '*_test.go' files and uses the standard Go unit testing 17 | framework. These tests are primarily devoted to holistically testing the 18 | decoder and encoder. 19 | 20 | The second type of testing is used to verify the implementation's adherence 21 | to the TOML specification. These tests have been factored into their own 22 | project: https://github.com/BurntSushi/toml-test 23 | 24 | The reason the tests are in a separate project is so that they can be used by 25 | any implementation of TOML. Namely, it is language agnostic. 26 | */ 27 | package toml 28 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/LICENSE: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/func_go110.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package xpath 4 | 5 | import "math" 6 | 7 | func round(f float64) int { 8 | return int(math.Round(f)) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/func_pre_go110.go: -------------------------------------------------------------------------------- 1 | // +build !go1.10 2 | 3 | package xpath 4 | 5 | import "math" 6 | 7 | // math.Round() is supported by Go 1.10+, 8 | // This method just compatible for version <1.10. 9 | // https://github.com/golang/go/issues/20100 10 | func round(f float64) int { 11 | if math.Abs(f) < 0.5 { 12 | return 0 13 | } 14 | return int(f + math.Copysign(0.5, f)) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/bblfsh/go-client/doc.go: -------------------------------------------------------------------------------- 1 | // Babelfish (https://doc.bblf.sh) Go client library provides functionality to 2 | // both connect to the bblfsh daemon to parse code (obtaining an UAST as a 3 | // result) and to analyse UASTs with the functionality provided by libuast. 4 | package bblfsh 5 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-chi/chi/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-present Peter Kieltyka (https://github.com/pkieltyka), Google Inc. 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-chi/chi/middleware/get_head.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/go-chi/chi" 7 | ) 8 | 9 | // GetHead automatically route undefined HEAD requests to GET handlers. 10 | func GetHead(next http.Handler) http.Handler { 11 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 12 | if r.Method == "HEAD" { 13 | rctx := chi.RouteContext(r.Context()) 14 | routePath := rctx.RoutePath 15 | if routePath == "" { 16 | if r.URL.RawPath != "" { 17 | routePath = r.URL.RawPath 18 | } else { 19 | routePath = r.URL.Path 20 | } 21 | } 22 | 23 | // Temporary routing context to look-ahead before routing the request 24 | tctx := chi.NewRouteContext() 25 | 26 | // Attempt to find a HEAD handler for the routing path, if not found, traverse 27 | // the router as through its a GET route, but proceed with the request 28 | // with the HEAD method. 29 | if !rctx.Routes.Match(tctx, "HEAD", routePath) { 30 | rctx.RouteMethod = "GET" 31 | rctx.RoutePath = routePath 32 | next.ServeHTTP(w, r) 33 | return 34 | } 35 | } 36 | 37 | next.ServeHTTP(w, r) 38 | }) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/go-chi/chi/middleware/heartbeat.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "net/http" 5 | "strings" 6 | ) 7 | 8 | // Heartbeat endpoint middleware useful to setting up a path like 9 | // `/ping` that load balancers or uptime testing external services 10 | // can make a request before hitting any routes. It's also convenient 11 | // to place this above ACL middlewares as well. 12 | func Heartbeat(endpoint string) func(http.Handler) http.Handler { 13 | f := func(h http.Handler) http.Handler { 14 | fn := func(w http.ResponseWriter, r *http.Request) { 15 | if r.Method == "GET" && strings.EqualFold(r.URL.Path, endpoint) { 16 | w.Header().Set("Content-Type", "text/plain") 17 | w.WriteHeader(http.StatusOK) 18 | w.Write([]byte(".")) 19 | return 20 | } 21 | h.ServeHTTP(w, r) 22 | } 23 | return http.HandlerFunc(fn) 24 | } 25 | return f 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/go-chi/chi/middleware/middleware.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | // contextKey is a value for use with context.WithValue. It's used as 4 | // a pointer so it fits in an interface{} without allocation. This technique 5 | // for defining context keys was copied from Go 1.7's new use of context in net/http. 6 | type contextKey struct { 7 | name string 8 | } 9 | 10 | func (k *contextKey) String() string { 11 | return "chi/middleware context value " + k.name 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-chi/chi/middleware/recoverer.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | // The original work was derived from Goji's middleware, source: 4 | // https://github.com/zenazn/goji/tree/master/web/middleware 5 | 6 | import ( 7 | "fmt" 8 | "net/http" 9 | "os" 10 | "runtime/debug" 11 | ) 12 | 13 | // Recoverer is a middleware that recovers from panics, logs the panic (and a 14 | // backtrace), and returns a HTTP 500 (Internal Server Error) status if 15 | // possible. Recoverer prints a request ID if one is provided. 16 | // 17 | // Alternatively, look at https://github.com/pressly/lg middleware pkgs. 18 | func Recoverer(next http.Handler) http.Handler { 19 | fn := func(w http.ResponseWriter, r *http.Request) { 20 | defer func() { 21 | if rvr := recover(); rvr != nil { 22 | 23 | logEntry := GetLogEntry(r) 24 | if logEntry != nil { 25 | logEntry.Panic(rvr, debug.Stack()) 26 | } else { 27 | fmt.Fprintf(os.Stderr, "Panic: %+v\n", rvr) 28 | debug.PrintStack() 29 | } 30 | 31 | http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) 32 | } 33 | }() 34 | 35 | next.ServeHTTP(w, r) 36 | } 37 | 38 | return http.HandlerFunc(fn) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/go-chi/chi/middleware/value.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "context" 5 | "net/http" 6 | ) 7 | 8 | // WithValue is a middleware that sets a given key/value in a context chain. 9 | func WithValue(key interface{}, val interface{}) func(next http.Handler) http.Handler { 10 | return func(next http.Handler) http.Handler { 11 | fn := func(w http.ResponseWriter, r *http.Request) { 12 | r = r.WithContext(context.WithValue(r.Context(), key, val)) 13 | next.ServeHTTP(w, r) 14 | } 15 | return http.HandlerFunc(fn) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/appengine.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build appengine 10 | 11 | package mysql 12 | 13 | import ( 14 | "google.golang.org/appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/result.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlResult struct { 12 | affectedRows int64 13 | insertId int64 14 | } 15 | 16 | func (res *mysqlResult) LastInsertId() (int64, error) { 17 | return res.insertId, nil 18 | } 19 | 20 | func (res *mysqlResult) RowsAffected() (int64, error) { 21 | return res.affectedRows, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/transaction.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlTx struct { 12 | mc *mysqlConn 13 | } 14 | 15 | func (tx *mysqlTx) Commit() (err error) { 16 | if tx.mc == nil || tx.mc.closed.IsSet() { 17 | return ErrInvalidConn 18 | } 19 | err = tx.mc.exec("COMMIT") 20 | tx.mc = nil 21 | return 22 | } 23 | 24 | func (tx *mysqlTx) Rollback() (err error) { 25 | if tx.mc == nil || tx.mc.closed.IsSet() { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of GoGo authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS file, which 3 | # lists people. For example, employees are listed in CONTRIBUTORS, 4 | # but not in AUTHORS, because the employer holds the copyright. 5 | 6 | # Names should be added to this file as one of 7 | # Organization's name 8 | # Individual's name 9 | # Individual's name 10 | 11 | # Please keep the list sorted. 12 | 13 | Sendgrid, Inc 14 | Vastech SA (PTY) LTD 15 | Walter Schulze 16 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Anton Povarov 2 | Brian Goff 3 | Clayton Coleman 4 | Denis Smirnov 5 | DongYun Kang 6 | Dwayne Schultz 7 | Georg Apitz 8 | Gustav Paul 9 | Johan Brandhorst 10 | John Shahid 11 | John Tuley 12 | Laurent 13 | Patrick Lee 14 | Peter Edge 15 | Roger Johansson 16 | Sam Nguyen 17 | Sergio Arbeo 18 | Stephen J Day 19 | Tamir Duberstein 20 | Todd Eisenberger 21 | Tormod Erevik Lea 22 | Vyacheslav Kim 23 | Walter Schulze 24 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/GOLANG_CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | The contributors to the Go protobuf repository: 2 | 3 | # This source code was written by the Go contributors. 4 | # The master list of contributors is in the main Go distribution, 5 | # visible at http://tip.golang.org/CONTRIBUTORS. -------------------------------------------------------------------------------- /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/grpc-ecosystem/grpc-opentracing/go/otgrpc/package.go: -------------------------------------------------------------------------------- 1 | // Package otgrpc provides OpenTracing support for any gRPC client or server. 2 | // 3 | // See the README for simple usage examples: 4 | // https://github.com/grpc-ecosystem/grpc-opentracing/blob/master/go/otgrpc/README.md 5 | package otgrpc 6 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc/shared.go: -------------------------------------------------------------------------------- 1 | package otgrpc 2 | 3 | import ( 4 | "strings" 5 | 6 | opentracing "github.com/opentracing/opentracing-go" 7 | "github.com/opentracing/opentracing-go/ext" 8 | "google.golang.org/grpc/metadata" 9 | ) 10 | 11 | var ( 12 | // Morally a const: 13 | gRPCComponentTag = opentracing.Tag{string(ext.Component), "gRPC"} 14 | ) 15 | 16 | // metadataReaderWriter satisfies both the opentracing.TextMapReader and 17 | // opentracing.TextMapWriter interfaces. 18 | type metadataReaderWriter struct { 19 | metadata.MD 20 | } 21 | 22 | func (w metadataReaderWriter) Set(key, val string) { 23 | // The GRPC HPACK implementation rejects any uppercase keys here. 24 | // 25 | // As such, since the HTTP_HEADERS format is case-insensitive anyway, we 26 | // blindly lowercase the key (which is guaranteed to work in the 27 | // Inject/Extract sense per the OpenTracing spec). 28 | key = strings.ToLower(key) 29 | w.MD[key] = append(w.MD[key], val) 30 | } 31 | 32 | func (w metadataReaderWriter) ForeachKey(handler func(key, val string) error) error { 33 | for k, vals := range w.MD { 34 | for _, v := range vals { 35 | if err := handler(k, v); err != nil { 36 | return err 37 | } 38 | } 39 | } 40 | 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/arg.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | import ( 4 | "reflect" 5 | ) 6 | 7 | // Arg represents a positional argument on the command line. 8 | type Arg struct { 9 | // The name of the positional argument (used in the help) 10 | Name string 11 | 12 | // A description of the positional argument (used in the help) 13 | Description string 14 | 15 | // The minimal number of required positional arguments 16 | Required int 17 | 18 | // The maximum number of required positional arguments 19 | RequiredMaximum int 20 | 21 | value reflect.Value 22 | tag multiTag 23 | } 24 | 25 | func (a *Arg) isRemaining() bool { 26 | return a.value.Type().Kind() == reflect.Slice 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/closest.go: -------------------------------------------------------------------------------- 1 | package flags 2 | 3 | func levenshtein(s string, t string) int { 4 | if len(s) == 0 { 5 | return len(t) 6 | } 7 | 8 | if len(t) == 0 { 9 | return len(s) 10 | } 11 | 12 | dists := make([][]int, len(s)+1) 13 | for i := range dists { 14 | dists[i] = make([]int, len(t)+1) 15 | dists[i][0] = i 16 | } 17 | 18 | for j := range t { 19 | dists[0][j] = j 20 | } 21 | 22 | for i, sc := range s { 23 | for j, tc := range t { 24 | if sc == tc { 25 | dists[i+1][j+1] = dists[i][j] 26 | } else { 27 | dists[i+1][j+1] = dists[i][j] + 1 28 | if dists[i+1][j] < dists[i+1][j+1] { 29 | dists[i+1][j+1] = dists[i+1][j] + 1 30 | } 31 | if dists[i][j+1] < dists[i+1][j+1] { 32 | dists[i+1][j+1] = dists[i][j+1] + 1 33 | } 34 | } 35 | } 36 | } 37 | 38 | return dists[len(s)][len(t)] 39 | } 40 | 41 | func closestChoice(cmd string, choices []string) (string, int) { 42 | if len(choices) == 0 { 43 | return "", 0 44 | } 45 | 46 | mincmd := -1 47 | mindist := -1 48 | 49 | for i, c := range choices { 50 | l := levenshtein(cmd, c) 51 | 52 | if mincmd < 0 || l < mindist { 53 | mindist = l 54 | mincmd = i 55 | } 56 | } 57 | 58 | return choices[mincmd], mindist 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/termsize.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9,!solaris,!appengine 2 | 3 | package flags 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | type winsize struct { 11 | row, col uint16 12 | xpixel, ypixel uint16 13 | } 14 | 15 | func getTerminalColumns() int { 16 | ws := winsize{} 17 | 18 | if tIOCGWINSZ != 0 { 19 | syscall.Syscall(syscall.SYS_IOCTL, 20 | uintptr(0), 21 | uintptr(tIOCGWINSZ), 22 | uintptr(unsafe.Pointer(&ws))) 23 | 24 | return int(ws.col) 25 | } 26 | 27 | return 80 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/termsize_nosysioctl.go: -------------------------------------------------------------------------------- 1 | // +build windows plan9 solaris appengine 2 | 3 | package flags 4 | 5 | func getTerminalColumns() int { 6 | return 80 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/tiocgwinsz_bsdish.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd netbsd openbsd 2 | 3 | package flags 4 | 5 | const ( 6 | tIOCGWINSZ = 0x40087468 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/tiocgwinsz_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package flags 4 | 5 | const ( 6 | tIOCGWINSZ = 0x5413 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/jessevdk/go-flags/tiocgwinsz_other.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!freebsd,!netbsd,!openbsd,!linux 2 | 3 | package flags 4 | 5 | const ( 6 | tIOCGWINSZ = 0 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/kelseyhightower/envconfig/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Kelsey Hightower 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | 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 THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/kelseyhightower/envconfig/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Kelsey Hightower. All rights reserved. 2 | // Use of this source code is governed by the MIT License that can be found in 3 | // the LICENSE file. 4 | 5 | // Package envconfig implements decoding of environment variables based on a user 6 | // defined specification. A typical use is using environment variables for 7 | // configuration settings. 8 | package envconfig 9 | -------------------------------------------------------------------------------- /vendor/github.com/kelseyhightower/envconfig/env_os.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package envconfig 4 | 5 | import "os" 6 | 7 | var lookupEnv = os.LookupEnv 8 | -------------------------------------------------------------------------------- /vendor/github.com/kelseyhightower/envconfig/env_syscall.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package envconfig 4 | 5 | import "syscall" 6 | 7 | var lookupEnv = syscall.Getenv 8 | -------------------------------------------------------------------------------- /vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2017 marvin + konsorten GmbH (open-source@konsorten.de) 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/konsorten/go-windows-terminal-sequences/sequences.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package sequences 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | var ( 11 | kernel32Dll *syscall.LazyDLL = syscall.NewLazyDLL("Kernel32.dll") 12 | setConsoleMode *syscall.LazyProc = kernel32Dll.NewProc("SetConsoleMode") 13 | ) 14 | 15 | func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error { 16 | const ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x4 17 | 18 | var mode uint32 19 | err := syscall.GetConsoleMode(syscall.Stdout, &mode) 20 | if err != nil { 21 | return err 22 | } 23 | 24 | if enable { 25 | mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING 26 | } else { 27 | mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING 28 | } 29 | 30 | ret, _, err := setConsoleMode.Call(uintptr(unsafe.Pointer(stream)), uintptr(mode)) 31 | if ret == 0 { 32 | return err 33 | } 34 | 35 | return nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/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/mattn/go-colorable/colorable_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | _ "github.com/mattn/go-isatty" 10 | ) 11 | 12 | // NewColorable return new instance of Writer which handle escape sequence. 13 | func NewColorable(file *os.File) io.Writer { 14 | if file == nil { 15 | panic("nil passed instead of *os.File to NewColorable()") 16 | } 17 | 18 | return file 19 | } 20 | 21 | // NewColorableStdout return new instance of Writer which handle escape sequence for stdout. 22 | func NewColorableStdout() io.Writer { 23 | return os.Stdout 24 | } 25 | 26 | // NewColorableStderr return new instance of Writer which handle escape sequence for stderr. 27 | func NewColorableStderr() io.Writer { 28 | return os.Stderr 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable return new instance of Writer which handle escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout return new instance of Writer which handle escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr return new instance of Writer which handle escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/noncolorable.go: -------------------------------------------------------------------------------- 1 | package colorable 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | // NonColorable hold writer but remove escape sequence. 9 | type NonColorable struct { 10 | out io.Writer 11 | } 12 | 13 | // NewNonColorable return new instance of Writer which remove escape sequence from Writer. 14 | func NewNonColorable(w io.Writer) io.Writer { 15 | return &NonColorable{out: w} 16 | } 17 | 18 | // Write write data on console 19 | func (w *NonColorable) Write(data []byte) (n int, err error) { 20 | er := bytes.NewReader(data) 21 | var bw [1]byte 22 | loop: 23 | for { 24 | c1, err := er.ReadByte() 25 | if err != nil { 26 | break loop 27 | } 28 | if c1 != 0x1b { 29 | bw[0] = c1 30 | w.out.Write(bw[:]) 31 | continue 32 | } 33 | c2, err := er.ReadByte() 34 | if err != nil { 35 | break loop 36 | } 37 | if c2 != 0x5b { 38 | continue 39 | } 40 | 41 | var buf bytes.Buffer 42 | for { 43 | c, err := er.ReadByte() 44 | if err != nil { 45 | break loop 46 | } 47 | if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { 48 | break 49 | } 50 | buf.Write([]byte(string(c))) 51 | } 52 | } 53 | 54 | return len(data), nil 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/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/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | 11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 12 | // terminal. This is also always false on this environment. 13 | func IsCygwinTerminal(fd uintptr) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine,!ppc64,!ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build ppc64 ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "unsafe" 8 | 9 | syscall "golang.org/x/sys/unix" 10 | ) 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var termios syscall.Termios 17 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 18 | return err == 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 7 | // terminal. This is also always false on this environment. 8 | func IsCygwinTerminal(fd uintptr) bool { 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mcuadros/go-lookup/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Máximo Cuadros 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/mgutz/ansi/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2013 Mario L. Gutierrez 3 | 4 | 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: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | 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. 9 | 10 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 The OpenTracing Authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 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/opentracing/opentracing-go/globaltracer.go: -------------------------------------------------------------------------------- 1 | package opentracing 2 | 3 | var ( 4 | globalTracer Tracer = NoopTracer{} 5 | ) 6 | 7 | // SetGlobalTracer sets the [singleton] opentracing.Tracer returned by 8 | // GlobalTracer(). Those who use GlobalTracer (rather than directly manage an 9 | // opentracing.Tracer instance) should call SetGlobalTracer as early as 10 | // possible in main(), prior to calling the `StartSpan` global func below. 11 | // Prior to calling `SetGlobalTracer`, any Spans started via the `StartSpan` 12 | // (etc) globals are noops. 13 | func SetGlobalTracer(tracer Tracer) { 14 | globalTracer = tracer 15 | } 16 | 17 | // GlobalTracer returns the global singleton `Tracer` implementation. 18 | // Before `SetGlobalTracer()` is called, the `GlobalTracer()` is a noop 19 | // implementation that drops all data handed to it. 20 | func GlobalTracer() Tracer { 21 | return globalTracer 22 | } 23 | 24 | // StartSpan defers to `Tracer.StartSpan`. See `GlobalTracer()`. 25 | func StartSpan(operationName string, opts ...StartSpanOption) Span { 26 | return globalTracer.StartSpan(operationName, opts...) 27 | } 28 | 29 | // InitGlobalTracer is deprecated. Please use SetGlobalTracer. 30 | func InitGlobalTracer(tracer Tracer) { 31 | SetGlobalTracer(tracer) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/pressly/lg/redirect.go: -------------------------------------------------------------------------------- 1 | package lg 2 | 3 | import ( 4 | stdlog "log" 5 | 6 | "github.com/sirupsen/logrus" 7 | ) 8 | 9 | func RedirectStdlogOutput(logger *logrus.Logger) { 10 | // Redirect standard logger 11 | stdlog.SetOutput(&logRedirectWriter{logger}) 12 | stdlog.SetFlags(0) 13 | } 14 | 15 | // Proxy writer for any packages using the standard log.Println() stuff 16 | type logRedirectWriter struct { 17 | Logger *logrus.Logger 18 | } 19 | 20 | func (l *logRedirectWriter) Write(p []byte) (n int, err error) { 21 | if len(p) > 0 { 22 | l.Logger.Infof("%s", p[:len(p)-1]) 23 | } 24 | return len(p), nil 25 | } 26 | -------------------------------------------------------------------------------- /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/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_check_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd netbsd openbsd 2 | 3 | package logrus 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | const ioctlReadTermios = unix.TIOCGETA 8 | 9 | func isTerminal(fd int) bool { 10 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) 11 | return err == nil 12 | } 13 | 14 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_js.go: -------------------------------------------------------------------------------- 1 | // +build js 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,!windows 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | func checkIfTerminal(w io.Writer) bool { 11 | switch v := w.(type) { 12 | case *os.File: 13 | return isTerminal(int(v.Fd())) 14 | default: 15 | return false 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux aix 2 | 3 | package logrus 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | const ioctlReadTermios = unix.TCGETS 8 | 9 | func isTerminal(fd int) bool { 10 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) 11 | return err == nil 12 | } 13 | 14 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_windows.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,windows 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | func checkIfTerminal(w io.Writer) bool { 12 | switch v := w.(type) { 13 | case *os.File: 14 | var mode uint32 15 | err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode) 16 | return err == nil 17 | default: 18 | return false 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package logrus 4 | 5 | import "io" 6 | 7 | func initTerminal(w io.Writer) { 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,windows 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | "syscall" 9 | 10 | sequences "github.com/konsorten/go-windows-terminal-sequences" 11 | ) 12 | 13 | func initTerminal(w io.Writer) { 14 | switch v := w.(type) { 15 | case *os.File: 16 | sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/src-d/envconfig/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Kelsey Hightower 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | 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 THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/src-d/envconfig/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Kelsey Hightower. All rights reserved. 2 | // Use of this source code is governed by the Apache License, Version 2.0 3 | // that can be found in the LICENSE file. 4 | 5 | // Package envconfig implements decoding of environment variables based on a user 6 | // defined specification. A typical use is using environment variables for 7 | // configuration settings. 8 | package envconfig 9 | -------------------------------------------------------------------------------- /vendor/github.com/src-d/go-oniguruma/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by Zhigang Chen 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/src-d/go-oniguruma/chelper.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern int NewOnigRegex( char *pattern, int pattern_length, int option, 4 | OnigRegex *regex, OnigRegion **region, OnigEncoding *encoding, OnigErrorInfo **error_info, char **error_buffer); 5 | 6 | extern int SearchOnigRegex( void *str, int str_length, int offset, int option, 7 | OnigRegex regex, OnigRegion *region, OnigErrorInfo *error_info, char *error_buffer, int *captures, int *numCaptures); 8 | 9 | extern int MatchOnigRegex( void *str, int str_length, int offset, int option, 10 | OnigRegex regex, OnigRegion *region); 11 | 12 | extern int LookupOnigCaptureByName(char *name, int name_length, OnigRegex regex, OnigRegion *region); 13 | 14 | extern int GetCaptureNames(OnigRegex regex, void *buffer, int bufferSize, int* groupNumbers); 15 | -------------------------------------------------------------------------------- /vendor/github.com/src-d/go-oniguruma/constants.go: -------------------------------------------------------------------------------- 1 | package rubex 2 | 3 | const ( 4 | ONIG_OPTION_DEFAULT = ONIG_OPTION_NONE 5 | /* options */ 6 | ONIG_OPTION_NONE = 0 7 | ONIG_OPTION_IGNORECASE = 1 8 | ONIG_OPTION_EXTEND = (ONIG_OPTION_IGNORECASE << 1) 9 | ONIG_OPTION_MULTILINE = (ONIG_OPTION_EXTEND << 1) 10 | ONIG_OPTION_SINGLELINE = (ONIG_OPTION_MULTILINE << 1) 11 | ONIG_OPTION_FIND_LONGEST = (ONIG_OPTION_SINGLELINE << 1) 12 | ONIG_OPTION_FIND_NOT_EMPTY = (ONIG_OPTION_FIND_LONGEST << 1) 13 | ONIG_OPTION_NEGATE_SINGLELINE = (ONIG_OPTION_FIND_NOT_EMPTY << 1) 14 | ONIG_OPTION_DONT_CAPTURE_GROUP = (ONIG_OPTION_NEGATE_SINGLELINE << 1) 15 | ONIG_OPTION_CAPTURE_GROUP = (ONIG_OPTION_DONT_CAPTURE_GROUP << 1) 16 | /* options (search time) */ 17 | ONIG_OPTION_NOTBOL = (ONIG_OPTION_CAPTURE_GROUP << 1) 18 | ONIG_OPTION_NOTEOL = (ONIG_OPTION_NOTBOL << 1) 19 | ONIG_OPTION_POSIX_REGION = (ONIG_OPTION_NOTEOL << 1) 20 | ONIG_OPTION_MAXBIT = ONIG_OPTION_POSIX_REGION /* limit */ 21 | 22 | ONIG_NORMAL = 0 23 | ONIG_MISMATCH = -1 24 | 25 | ONIG_MISMATCH_STR = "mismatch" 26 | ONIGERR_UNDEFINED_NAME_REFERENCE = -217 27 | ) 28 | -------------------------------------------------------------------------------- /vendor/github.com/src-d/go-oniguruma/quotemeta.go: -------------------------------------------------------------------------------- 1 | // Use of this source code is governed by a BSD-style 2 | // license that can be found in the LICENSE file. 3 | 4 | // Package regexp implements a simple regular expression library. 5 | 6 | // QuoteMeta func is copied here to avoid linking the entire Regexp library. 7 | 8 | package rubex 9 | 10 | func special(c int) bool { 11 | for _, r := range `\.+*?()|[]^$` { 12 | if c == int(r) { 13 | return true 14 | } 15 | } 16 | return false 17 | } 18 | 19 | // QuoteMeta returns a string that quotes all regular expression metacharacters 20 | // inside the argument text; the returned string is a regular expression matching 21 | // the literal text. For example, QuoteMeta(`[foo]`) returns `\[foo\]`. 22 | func QuoteMeta(s string) string { 23 | b := make([]byte, 2*len(s)) 24 | 25 | // A byte loop is correct because all metacharacters are ASCII. 26 | j := 0 27 | for i := 0; i < len(s); i++ { 28 | if special(int(s[i])) { 29 | b[j] = '\\' 30 | j++ 31 | } 32 | b[j] = s[i] 33 | j++ 34 | } 35 | return string(b[0:j]) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell 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/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=require -template=require_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | type tHelper interface { 10 | Helper() 11 | } 12 | 13 | // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful 14 | // for table driven tests. 15 | type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) 16 | 17 | // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful 18 | // for table driven tests. 19 | type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) 20 | 21 | // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful 22 | // for table driven tests. 23 | type BoolAssertionFunc func(TestingT, bool, ...interface{}) 24 | 25 | // ErrorAssertionFunc is a common function prototype when validating an error value. Can be useful 26 | // for table driven tests. 27 | type ErrorAssertionFunc func(TestingT, error, ...interface{}) 28 | 29 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl -include-format-funcs 30 | -------------------------------------------------------------------------------- /vendor/github.com/toqueteos/trie/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Caleb Spare 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/x-cray/logrus-prefixed-formatter/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Denis Parchenko 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/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/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/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 | sum := f.n + n 45 | if (sum > n) == (f.n > 0) { 46 | f.n = sum 47 | return true 48 | } 49 | return false 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/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 21 | BL runtime·entersyscall(SB) 22 | MOVD a1+8(FP), R0 23 | MOVD a2+16(FP), R1 24 | MOVD a3+24(FP), R2 25 | MOVD $0, R3 26 | MOVD $0, R4 27 | MOVD $0, R5 28 | MOVD trap+0(FP), R8 // syscall entry 29 | SVC 30 | MOVD R0, r1+32(FP) // r1 31 | MOVD R1, r2+40(FP) // r2 32 | BL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | B syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | B syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOVD a1+8(FP), R0 43 | MOVD a2+16(FP), R1 44 | MOVD a3+24(FP), R2 45 | MOVD $0, R3 46 | MOVD $0, R4 47 | MOVD $0, R5 48 | MOVD trap+0(FP), R8 // syscall entry 49 | SVC 50 | MOVD R0, r1+32(FP) 51 | MOVD R1, r2+40(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 16 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 26 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 27 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 28 | if errno == 0 { 29 | return nil 30 | } 31 | return errno 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | uintptr_t 35 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 36 | { 37 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 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_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/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-16 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-12 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-24 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | 27 | func Unsetenv(key string) error { 28 | return syscall.Unsetenv(key) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/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/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/collate/index.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 collate 6 | 7 | import "golang.org/x/text/internal/colltab" 8 | 9 | const blockSize = 64 10 | 11 | func getTable(t tableIndex) *colltab.Table { 12 | return &colltab.Table{ 13 | Index: colltab.Trie{ 14 | Index0: mainLookup[:][blockSize*t.lookupOffset:], 15 | Values0: mainValues[:][blockSize*t.valuesOffset:], 16 | Index: mainLookup[:], 17 | Values: mainValues[:], 18 | }, 19 | ExpandElem: mainExpandElem[:], 20 | ContractTries: colltab.ContractTrieSet(mainCTEntries[:]), 21 | ContractElem: mainContractElem[:], 22 | MaxContractLen: 18, 23 | VariableTop: varTop, 24 | } 25 | } 26 | 27 | // tableIndex holds information for constructing a table 28 | // for a certain locale based on the main table. 29 | type tableIndex struct { 30 | lookupOffset uint32 31 | valuesOffset uint32 32 | } 33 | -------------------------------------------------------------------------------- /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/text/secure/bidirule/bidirule10.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | if !t.isRTL() { 11 | return true 12 | } 13 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 14 | } 15 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/cloudsql/cloudsql_classic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package cloudsql 8 | 9 | import ( 10 | "net" 11 | 12 | "appengine/cloudsql" 13 | ) 14 | 15 | func connect(instance string) (net.Conn, error) { 16 | return cloudsql.Dial(instance) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/appengine/cloudsql/cloudsql_vm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All rights reserved. 2 | // Use of this source code is governed by the Apache 2.0 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package cloudsql 8 | 9 | import ( 10 | "errors" 11 | "net" 12 | ) 13 | 14 | func connect(instance string) (net.Conn, error) { 15 | return nil, errors.New(`cloudsql: not supported in App Engine "flexible environment"`) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/backoff.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2017 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // See internal/backoff package for the backoff implementation. This file is 20 | // kept for the exported types and API backward compatility. 21 | 22 | package grpc 23 | 24 | import ( 25 | "time" 26 | ) 27 | 28 | // DefaultBackoffConfig uses values specified for backoff in 29 | // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. 30 | var DefaultBackoffConfig = BackoffConfig{ 31 | MaxDelay: 120 * time.Second, 32 | } 33 | 34 | // BackoffConfig defines the parameters for the default gRPC backoff strategy. 35 | type BackoffConfig struct { 36 | // MaxDelay is the upper bound of backoff delay. 37 | MaxDelay time.Duration 38 | } 39 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/credentials/go19.go: -------------------------------------------------------------------------------- 1 | // +build go1.9,!appengine 2 | 3 | /* 4 | * 5 | * Copyright 2018 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package credentials 22 | 23 | import ( 24 | "errors" 25 | "syscall" 26 | ) 27 | 28 | // implements the syscall.Conn interface 29 | func (c tlsConn) SyscallConn() (syscall.RawConn, error) { 30 | conn, ok := c.rawConn.(syscall.Conn) 31 | if !ok { 32 | return nil, errors.New("RawConn does not implement syscall.Conn") 33 | } 34 | return conn.SyscallConn() 35 | } 36 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | /* 20 | Package grpc implements an RPC system called gRPC. 21 | 22 | See grpc.io for more information about gRPC. 23 | */ 24 | package grpc // import "google.golang.org/grpc" 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/channelz/util_linux_go19.go: -------------------------------------------------------------------------------- 1 | // +build linux,go1.9,!appengine 2 | 3 | /* 4 | * 5 | * Copyright 2018 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package channelz 22 | 23 | import ( 24 | "syscall" 25 | ) 26 | 27 | // GetSocketOption gets the socket option info of the conn. 28 | func GetSocketOption(socket interface{}) *SocketOptionData { 29 | c, ok := socket.(syscall.Conn) 30 | if !ok { 31 | return nil 32 | } 33 | data := &SocketOptionData{} 34 | if rawConn, err := c.SyscallConn(); err == nil { 35 | rawConn.Control(data.Getsockopt) 36 | return data 37 | } 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/channelz/util_nonlinux_pre_go19.go: -------------------------------------------------------------------------------- 1 | // +build !linux !go1.9 appengine 2 | 3 | /* 4 | * 5 | * Copyright 2018 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package channelz 22 | 23 | // GetSocketOption gets the socket option info of the conn. 24 | func GetSocketOption(c interface{}) *SocketOptionData { 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/envconfig/envconfig.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2018 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // Package envconfig contains grpc settings configured by environment variables. 20 | package envconfig 21 | 22 | import ( 23 | "os" 24 | "strings" 25 | ) 26 | 27 | const ( 28 | prefix = "GRPC_GO_" 29 | retryStr = prefix + "RETRY" 30 | ) 31 | 32 | var ( 33 | // Retry is set if retry is explicitly enabled via "GRPC_GO_RETRY=on". 34 | Retry = strings.EqualFold(os.Getenv(retryStr), "on") 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/internal.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 gRPC authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | // Package internal contains gRPC-internal code, to avoid polluting 19 | // the godoc of the top-level grpc package. It must not import any grpc 20 | // symbols to avoid circular dependencies. 21 | package internal 22 | 23 | var ( 24 | // WithContextDialer is exported by clientconn.go 25 | WithContextDialer interface{} // func(context.Context, string) (net.Conn, error) grpc.DialOption 26 | // WithResolverBuilder is exported by clientconn.go 27 | WithResolverBuilder interface{} // func (resolver.Builder) grpc.DialOption 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/transport/log.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2017 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | // This file contains wrappers for grpclog functions. 20 | // The transport package only logs to verbose level 2 by default. 21 | 22 | package transport 23 | 24 | import "google.golang.org/grpc/grpclog" 25 | 26 | const logLevel = 2 27 | 28 | func infof(format string, args ...interface{}) { 29 | if grpclog.V(logLevel) { 30 | grpclog.Infof(format, args...) 31 | } 32 | } 33 | 34 | func warningf(format string, args ...interface{}) { 35 | if grpclog.V(logLevel) { 36 | grpclog.Warningf(format, args...) 37 | } 38 | } 39 | 40 | func errorf(format string, args ...interface{}) { 41 | if grpclog.V(logLevel) { 42 | grpclog.Errorf(format, args...) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6,!go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6, !go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | lookupTXT = func(ctx context.Context, name string) ([]string, error) { return net.LookupTXT(name) } 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | lookupTXT = net.DefaultResolver.LookupTXT 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/version.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2018 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package grpc 20 | 21 | // Version is the current grpc version. 22 | const Version = "1.15.0" 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/DATA-DOG/go-sqlmock.v1/argument.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import "database/sql/driver" 4 | 5 | // Argument interface allows to match 6 | // any argument in specific way when used with 7 | // ExpectedQuery and ExpectedExec expectations. 8 | type Argument interface { 9 | Match(driver.Value) bool 10 | } 11 | 12 | // AnyArg will return an Argument which can 13 | // match any kind of arguments. 14 | // 15 | // Useful for time.Time or similar kinds of arguments. 16 | func AnyArg() Argument { 17 | return anyArgument{} 18 | } 19 | 20 | type anyArgument struct{} 21 | 22 | func (a anyArgument) Match(_ driver.Value) bool { 23 | return true 24 | } 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/DATA-DOG/go-sqlmock.v1/options.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import "database/sql/driver" 4 | 5 | // ValueConverterOption allows to create a sqlmock connection 6 | // with a custom ValueConverter to support drivers with special data types. 7 | func ValueConverterOption(converter driver.ValueConverter) func(*sqlmock) error { 8 | return func(s *sqlmock) error { 9 | s.converter = converter 10 | return nil 11 | } 12 | } 13 | 14 | // QueryMatcherOption allows to customize SQL query matcher 15 | // and match SQL query strings in more sophisticated ways. 16 | // The default QueryMatcher is QueryMatcherRegexp. 17 | func QueryMatcherOption(queryMatcher QueryMatcher) func(*sqlmock) error { 18 | return func(s *sqlmock) error { 19 | s.queryMatcher = queryMatcher 20 | return nil 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/DATA-DOG/go-sqlmock.v1/result.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import ( 4 | "database/sql/driver" 5 | ) 6 | 7 | // Result satisfies sql driver Result, which 8 | // holds last insert id and rows affected 9 | // by Exec queries 10 | type result struct { 11 | insertID int64 12 | rowsAffected int64 13 | err error 14 | } 15 | 16 | // NewResult creates a new sql driver Result 17 | // for Exec based query mocks. 18 | func NewResult(lastInsertID int64, rowsAffected int64) driver.Result { 19 | return &result{ 20 | insertID: lastInsertID, 21 | rowsAffected: rowsAffected, 22 | } 23 | } 24 | 25 | // NewErrorResult creates a new sql driver Result 26 | // which returns an error given for both interface methods 27 | func NewErrorResult(err error) driver.Result { 28 | return &result{ 29 | err: err, 30 | } 31 | } 32 | 33 | func (r *result) LastInsertId() (int64, error) { 34 | return r.insertID, r.err 35 | } 36 | 37 | func (r *result) RowsAffected() (int64, error) { 38 | return r.rowsAffected, r.err 39 | } 40 | -------------------------------------------------------------------------------- /vendor/gopkg.in/DATA-DOG/go-sqlmock.v1/rows_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package sqlmock 4 | 5 | import "io" 6 | 7 | // Implement the "RowsNextResultSet" interface 8 | func (rs *rowSets) HasNextResultSet() bool { 9 | return rs.pos+1 < len(rs.sets) 10 | } 11 | 12 | // Implement the "RowsNextResultSet" interface 13 | func (rs *rowSets) NextResultSet() error { 14 | if !rs.HasNextResultSet() { 15 | return io.EOF 16 | } 17 | 18 | rs.pos++ 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/DATA-DOG/go-sqlmock.v1/statement.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import ( 4 | "database/sql/driver" 5 | ) 6 | 7 | type statement struct { 8 | conn *sqlmock 9 | ex *ExpectedPrepare 10 | query string 11 | } 12 | 13 | func (stmt *statement) Close() error { 14 | stmt.ex.wasClosed = true 15 | return stmt.ex.closeErr 16 | } 17 | 18 | func (stmt *statement) NumInput() int { 19 | return -1 20 | } 21 | 22 | func (stmt *statement) Exec(args []driver.Value) (driver.Result, error) { 23 | return stmt.conn.Exec(stmt.query, args) 24 | } 25 | 26 | func (stmt *statement) Query(args []driver.Value) (driver.Rows, error) { 27 | return stmt.conn.Query(stmt.query, args) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bblfsh/sdk.v1/protocol/server.proteus.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | import ( 4 | "golang.org/x/net/context" 5 | ) 6 | 7 | type protocolServiceServer struct { 8 | } 9 | 10 | func NewProtocolServiceServer() *protocolServiceServer { 11 | return &protocolServiceServer{} 12 | } 13 | func (s *protocolServiceServer) NativeParse(ctx context.Context, in *NativeParseRequest) (result *NativeParseResponse, err error) { 14 | result = new(NativeParseResponse) 15 | result = NativeParse(in) 16 | return 17 | } 18 | func (s *protocolServiceServer) Parse(ctx context.Context, in *ParseRequest) (result *ParseResponse, err error) { 19 | result = new(ParseResponse) 20 | result = Parse(in) 21 | return 22 | } 23 | func (s *protocolServiceServer) SupportedLanguages(ctx context.Context, in *SupportedLanguagesRequest) (result *SupportedLanguagesResponse, err error) { 24 | result = new(SupportedLanguagesResponse) 25 | result = SupportedLanguages(in) 26 | return 27 | } 28 | func (s *protocolServiceServer) Version(ctx context.Context, in *VersionRequest) (result *VersionResponse, err error) { 29 | result = new(VersionResponse) 30 | result = Version(in) 31 | return 32 | } 33 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bblfsh/sdk.v1/protocol/stringer.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Status,Encoding -output stringer.go"; DO NOT EDIT. 2 | 3 | package protocol 4 | 5 | import "strconv" 6 | 7 | const _Status_name = "OkErrorFatal" 8 | 9 | var _Status_index = [...]uint8{0, 2, 7, 12} 10 | 11 | func (i Status) String() string { 12 | if i >= Status(len(_Status_index)-1) { 13 | return "Status(" + strconv.FormatInt(int64(i), 10) + ")" 14 | } 15 | return _Status_name[_Status_index[i]:_Status_index[i+1]] 16 | } 17 | 18 | const _Encoding_name = "UTF8Base64" 19 | 20 | var _Encoding_index = [...]uint8{0, 4, 10} 21 | 22 | func (i Encoding) String() string { 23 | if i >= Encoding(len(_Encoding_index)-1) { 24 | return "Encoding(" + strconv.FormatInt(int64(i), 10) + ")" 25 | } 26 | return _Encoding_name[_Encoding_index[i]:_Encoding_index[i+1]] 27 | } 28 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bblfsh/sdk.v2/driver/errors/errors.go: -------------------------------------------------------------------------------- 1 | package errors 2 | 3 | import ( 4 | "strings" 5 | 6 | "gopkg.in/src-d/go-errors.v1" 7 | ) 8 | 9 | var ( 10 | // ErrDriverFailure is returned when the driver is malfunctioning. 11 | ErrDriverFailure = errors.NewKind("driver failure") 12 | 13 | // ErrSyntax is returned when driver cannot parse the source file. 14 | // Can be omitted for native driver implementations. 15 | ErrSyntax = errors.NewKind("syntax error") 16 | ) 17 | 18 | // Join multiple errors into a single error value. 19 | // If there are only one error, it will be returned directly. 20 | // Zero or more than one error will be wrapped into ErrMulti. 21 | func Join(errs []error) error { 22 | if len(errs) == 1 { 23 | return errs[0] 24 | } 25 | return &ErrMulti{Errors: errs} 26 | } 27 | 28 | // ErrMulti joins multiple errors. 29 | type ErrMulti struct { 30 | Errors []error 31 | } 32 | 33 | func (e *ErrMulti) Error() string { 34 | var buf strings.Builder 35 | for _, err := range e.Errors { 36 | buf.WriteString(err.Error()) 37 | buf.WriteString("\n") 38 | } 39 | return buf.String() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bblfsh/sdk.v2/uast/query/iter.go: -------------------------------------------------------------------------------- 1 | package query 2 | 3 | import ( 4 | "gopkg.in/bblfsh/sdk.v2/uast" 5 | "gopkg.in/bblfsh/sdk.v2/uast/nodes" 6 | ) 7 | 8 | type Empty = nodes.Empty 9 | 10 | type IterOrder = nodes.IterOrder 11 | 12 | const ( 13 | IterAny = nodes.IterAny 14 | PreOrder = nodes.PreOrder 15 | PostOrder = nodes.PostOrder 16 | LevelOrder = nodes.LevelOrder 17 | PositionOrder = LevelOrder + iota + 1 18 | ) 19 | 20 | func NewIterator(root nodes.External, order IterOrder) Iterator { 21 | if root == nil { 22 | return Empty{} 23 | } 24 | switch order { 25 | case PositionOrder: 26 | return uast.NewPositionalIterator(root) 27 | } 28 | return nodes.NewIterator(root, order) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bblfsh/sdk.v2/uast/query/query.go: -------------------------------------------------------------------------------- 1 | package query 2 | 3 | import ( 4 | "gopkg.in/bblfsh/sdk.v2/uast/nodes" 5 | ) 6 | 7 | type Interface interface { 8 | // Prepare parses the query and prepares it for repeated execution. 9 | Prepare(query string) (Query, error) 10 | // Execute prepares and runs a query for a given subtree. 11 | Execute(root nodes.External, query string) (Iterator, error) 12 | } 13 | 14 | type Query interface { 15 | // Execute runs a query for a given subtree. 16 | Execute(root nodes.External) (Iterator, error) 17 | } 18 | 19 | type Iterator = nodes.Iterator 20 | 21 | // AllNodes iterates over all nodes and returns them as a slice. 22 | func AllNodes(it Iterator) []nodes.External { 23 | var out []nodes.External 24 | for it.Next() { 25 | out = append(out, it.Node()) 26 | } 27 | return out 28 | } 29 | 30 | // Count counts the nodes in the iterator. Iterator will be exhausted as a result. 31 | func Count(it Iterator) int { 32 | var n int 33 | for it.Next() { 34 | n++ 35 | } 36 | return n 37 | } 38 | -------------------------------------------------------------------------------- /vendor/gopkg.in/bblfsh/sdk.v2/uast/transformer/conv.go: -------------------------------------------------------------------------------- 1 | package transformer 2 | 3 | import ( 4 | "fmt" 5 | "strconv" 6 | ) 7 | 8 | // Quote uses strconv.Quote/Unquote to wrap provided string value. 9 | func Quote(op Op) Op { 10 | return StringConv(op, func(s string) (string, error) { 11 | ns, err := strconv.Unquote(s) 12 | if err != nil { 13 | return "", fmt.Errorf("%v (%s)", err, s) 14 | } 15 | return ns, nil 16 | }, func(s string) (string, error) { 17 | return strconv.Quote(s), nil 18 | }) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/enry.v1/data/commit.go: -------------------------------------------------------------------------------- 1 | // Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT. 2 | // Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db 3 | 4 | package data 5 | 6 | // linguist's commit from which files were generated. 7 | var LinguistCommit = "e4560984058b4726010ca4b8f03ed9d0f8f464db" 8 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/enry.v1/data/doc.go: -------------------------------------------------------------------------------- 1 | // Package data contains only auto-generated data-structures for all the language 2 | // identification strategies from the Linguist project sources. 3 | package data 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/enry.v1/data/documentation.go: -------------------------------------------------------------------------------- 1 | // Code generated by gopkg.in/src-d/enry.v1/internal/code-generator DO NOT EDIT. 2 | // Extracted from github/linguist commit: e4560984058b4726010ca4b8f03ed9d0f8f464db 3 | 4 | package data 5 | 6 | import "gopkg.in/toqueteos/substring.v1" 7 | 8 | var DocumentationMatchers = substring.Or( 9 | substring.Regexp(`^[Dd]ocs?/`), 10 | substring.Regexp(`(^|/)[Dd]ocumentation/`), 11 | substring.Regexp(`(^|/)[Gg]roovydoc/`), 12 | substring.Regexp(`(^|/)[Jj]avadoc/`), 13 | substring.Regexp(`^[Mm]an/`), 14 | substring.Regexp(`^[Ee]xamples/`), 15 | substring.Regexp(`^[Dd]emos?/`), 16 | substring.Regexp(`(^|/)inst/doc/`), 17 | substring.Regexp(`(^|/)CHANGE(S|LOG)?(\.|$)`), 18 | substring.Regexp(`(^|/)CONTRIBUTING(\.|$)`), 19 | substring.Regexp(`(^|/)COPYING(\.|$)`), 20 | substring.Regexp(`(^|/)INSTALL(\.|$)`), 21 | substring.Regexp(`(^|/)LICEN[CS]E(\.|$)`), 22 | substring.Regexp(`(^|/)[Ll]icen[cs]e(\.|$)`), 23 | substring.Regexp(`(^|/)README(\.|$)`), 24 | substring.Regexp(`(^|/)[Rr]eadme(\.|$)`), 25 | substring.Regexp(`^[Ss]amples?/`), 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/enry.v1/data/heuristics.go: -------------------------------------------------------------------------------- 1 | package data 2 | 3 | import "gopkg.in/src-d/enry.v1/data/rule" 4 | 5 | // Heuristics implements a rule-based content matching engine. 6 | 7 | // Heuristics is a number of sequntially applied rule.Heuristic where a 8 | // matching one disambiguages language(s) for a single file extension. 9 | type Heuristics []rule.Heuristic 10 | 11 | // Match returns languages identified by the matching rule of the heuristic. 12 | func (hs Heuristics) Match(data []byte) []string { 13 | var matchedLangs []string 14 | for _, heuristic := range hs { 15 | if heuristic.Match(data) { 16 | for _, langOrAlias := range heuristic.Languages() { 17 | lang, ok := LanguageByAlias(langOrAlias) 18 | if !ok { // should never happen 19 | // reaching here means language name/alias in heuristics.yml 20 | // is not consistent with languages.yml 21 | // but we do not surface any such error at the API 22 | continue 23 | } 24 | matchedLangs = append(matchedLangs, lang) 25 | } 26 | break 27 | } 28 | } 29 | return matchedLangs 30 | } 31 | 32 | // matchString is a convenience used only in tests. 33 | func (hs *Heuristics) matchString(data string) []string { 34 | return hs.Match([]byte(data)) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/enry.v1/enry.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package enry implements multiple strategies for programming language identification. 3 | 4 | Identification is made based on file name and file content using a seriece 5 | of strategies to narrow down possible option. 6 | Each strategy is available as a separate API call, as well as a main enty point 7 | 8 | GetLanguage(filename string, content []byte) (language string) 9 | 10 | It is a port of the https://github.com/github/linguist from Ruby. 11 | Upstream Linguist YAML files are used to generate datastructures for data 12 | package. 13 | */ 14 | package enry // import "gopkg.in/src-d/enry.v1" 15 | 16 | //go:generate make code-generate 17 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/enry.v1/regex/oniguruma.go: -------------------------------------------------------------------------------- 1 | // +build oniguruma 2 | 3 | package regex 4 | 5 | import ( 6 | rubex "github.com/src-d/go-oniguruma" 7 | ) 8 | 9 | type EnryRegexp = *rubex.Regexp 10 | 11 | func MustCompile(str string) EnryRegexp { 12 | return rubex.MustCompile(str) 13 | } 14 | 15 | func QuoteMeta(s string) string { 16 | return rubex.QuoteMeta(s) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/enry.v1/regex/standard.go: -------------------------------------------------------------------------------- 1 | // +build !oniguruma 2 | 3 | package regex 4 | 5 | import ( 6 | "regexp" 7 | ) 8 | 9 | type EnryRegexp = *regexp.Regexp 10 | 11 | func MustCompile(str string) EnryRegexp { 12 | return regexp.MustCompile(str) 13 | } 14 | 15 | func QuoteMeta(s string) string { 16 | return regexp.QuoteMeta(s) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/go-cli.v0/log.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "gopkg.in/src-d/go-log.v1" 5 | ) 6 | 7 | // LogOptions defines logging flags. It is meant to be embedded in a 8 | // command struct. 9 | type LogOptions struct { 10 | LogLevel string `long:"log-level" env:"LOG_LEVEL" choice:"info" choice:"debug" choice:"warning" choice:"error" default:"info" description:"Logging level"` 11 | LogFormat string `long:"log-format" env:"LOG_FORMAT" choice:"text" choice:"json" description:"log format, defaults to text on a terminal and json otherwise"` 12 | LogFields string `long:"log-fields" env:"LOG_FIELDS" description:"default fields for the logger, specified in json"` 13 | LogForceFormat bool `long:"log-force-format" env:"LOG_FORCE_FORMAT" description:"ignore if it is running on a terminal or not"` 14 | } 15 | 16 | // Init initializes the default logger factory. 17 | func (c LogOptions) Init(a *App) error { 18 | log.DefaultFactory = &log.LoggerFactory{ 19 | Level: c.LogLevel, 20 | Format: c.LogFormat, 21 | Fields: c.LogFields, 22 | ForceFormat: c.LogForceFormat, 23 | } 24 | 25 | log.DefaultLogger = log.New(nil) 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/go-cli.v0/version.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // VersionCommand defines he default version command. Most if the time, it 8 | // should not be used directly, since it will be added by default to the App. 9 | type VersionCommand struct { 10 | PlainCommand `name:"version" short-description:"print version" long-description:"print version and exit"` 11 | Name string 12 | Version string 13 | Build string 14 | } 15 | 16 | // Execute runs the version command. 17 | func (c VersionCommand) Execute(args []string) error { 18 | fmt.Printf("%s version %s build %s\n", c.Name, c.Version, c.Build) 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/go-errors.v1/doc.go: -------------------------------------------------------------------------------- 1 | // Yet another `errors` package, implementing errors handling primitives, 2 | // allowing error wrapping and error tracing. 3 | package errors // import "gopkg.in/src-d/go-errors.v1" 4 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/go-errors.v1/matcher.go: -------------------------------------------------------------------------------- 1 | package errors 2 | 3 | // Matcher matches a given error 4 | type Matcher interface { 5 | // Is returns true if the err matches 6 | Is(err error) bool 7 | } 8 | 9 | // Is check if err matches all matchers 10 | func Is(err error, matchers ...Matcher) bool { 11 | if len(matchers) == 0 { 12 | return false 13 | } 14 | 15 | for _, m := range matchers { 16 | if !m.Is(err) { 17 | return false 18 | } 19 | } 20 | 21 | return true 22 | } 23 | 24 | // Any checks if err matches any matchers 25 | func Any(err error, matchers ...Matcher) bool { 26 | if len(matchers) == 0 { 27 | return false 28 | } 29 | 30 | for _, m := range matchers { 31 | if m.Is(err) { 32 | return true 33 | } 34 | } 35 | 36 | return false 37 | } 38 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/go-errors.v1/stack.go: -------------------------------------------------------------------------------- 1 | package errors 2 | 3 | import ( 4 | "runtime" 5 | 6 | "github.com/pkg/errors" 7 | ) 8 | 9 | // StackTrace is stack of Frames from innermost (newest) to outermost (oldest). 10 | type StackTrace struct { 11 | errors.StackTrace 12 | } 13 | 14 | // NewStackTrace returns a new StackTrace, skipping the given number of frames, 15 | // to avoid including the caller 16 | func NewStackTrace(skip int) StackTrace { 17 | const depth = 32 18 | 19 | var pcs [depth]uintptr 20 | n := runtime.Callers(2+skip, pcs[:]) 21 | 22 | f := make(errors.StackTrace, n) 23 | for i := 0; i < n; i++ { 24 | f[i] = errors.Frame(pcs[i]) 25 | } 26 | 27 | return StackTrace{f} 28 | } 29 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/go-log.v1/doc.go: -------------------------------------------------------------------------------- 1 | // Package log is a generic logging library based on logrus (this may change in 2 | // the future), that minimize the exposure of src-d projects to logrus or any 3 | // other logging library, as well defines the standard for configuration and 4 | // usage of the logging libraries in the organization. 5 | package log // import "gopkg.in/src-d/go-log.v1" 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/src-d/go-log.v1/logger.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import "github.com/sirupsen/logrus" 4 | 5 | // Fields type, used to pass to `Logger.New`. 6 | type Fields map[string]interface{} 7 | 8 | // Logger represents a generic logger, based on logrus.Logger 9 | type Logger interface { 10 | // New returns a copy of the current logger, adding the given Fields. 11 | New(Fields) Logger 12 | // With returns a copy of the current logger, adding the given Fields. 13 | // Alias of New, must be used when is chained with any message function. 14 | With(Fields) Logger 15 | // Debugf logs a message at level Debug. 16 | Debugf(format string, args ...interface{}) 17 | // Infof logs a message at level Info. 18 | Infof(format string, args ...interface{}) 19 | // Warningf logs a message at level Warning. 20 | Warningf(format string, args ...interface{}) 21 | // Errorf logs an error with a message at level Error. 22 | Errorf(err error, format string, args ...interface{}) 23 | } 24 | 25 | type logger struct { 26 | logrus.Entry 27 | } 28 | 29 | func (l *logger) New(f Fields) Logger { 30 | e := l.WithFields(logrus.Fields(f)) 31 | return &logger{*e} 32 | } 33 | 34 | func (l *logger) With(f Fields) Logger { return l.New(f) } 35 | 36 | func (l *logger) Errorf(err error, format string, args ...interface{}) { 37 | l.WithError(err).Errorf(format, args...) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/gopkg.in/toqueteos/substring.v1/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Carlos Cobo 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/gopkg.in/toqueteos/substring.v1/lib.go: -------------------------------------------------------------------------------- 1 | package substring 2 | 3 | // reverse is a helper fn for Suffixes 4 | func reverse(b []byte) []byte { 5 | n := len(b) 6 | for i := 0; i < n/2; i++ { 7 | b[i], b[n-1-i] = b[n-1-i], b[i] 8 | } 9 | return b 10 | } 11 | --------------------------------------------------------------------------------