├── .gitattributes ├── .gitignore ├── README.md ├── client ├── configure ├── src │ ├── ogrt-cli.c │ ├── ogrt-cmdline.c │ ├── ogrt-cmdline.ggo │ ├── ogrt-cmdline.h.in │ ├── ogrt-log.h │ ├── ogrt-main.c │ ├── ogrt-main.h │ ├── ogrt-readso.c │ ├── ogrt-readso.h │ ├── ogrt-signature.c │ ├── ogrt-signature.h │ ├── ogrt-util.c │ ├── ogrt-util.h │ ├── ogrt.pb-c.c │ ├── ogrt.pb-c.h │ ├── stamp.s │ ├── stamp_hello.s │ ├── stamp_helloshared.s │ ├── test_main.c │ └── test_util.c ├── test │ ├── ogrt-test.h │ ├── test_processinfo.c │ ├── test_readso.c │ └── test_util.c ├── vendorize ├── waf ├── waf-bin ├── wrappers │ └── ld └── wscript ├── demo ├── README.md ├── config │ ├── elasticsearch.yml │ └── log4j2.properties ├── generate-jobs ├── generate-software ├── infra-destroy ├── infra-init └── setup.sh ├── generate-protocol ├── protocol └── ogrt.proto ├── server ├── Makefile ├── ogrt.conf ├── run.sh ├── src │ ├── ogrt-server.go │ ├── output │ │ ├── interface.go │ │ ├── json_elasticsearch3.go │ │ ├── json_elasticsearch5.go │ │ ├── json_file.go │ │ ├── json_over_tcp.go │ │ └── null.go │ ├── protocol │ │ └── ogrt.pb.go │ └── web.go ├── vendor │ ├── github.com │ │ ├── BurntSushi │ │ │ └── toml │ │ │ │ ├── COPYING │ │ │ │ ├── cmd │ │ │ │ ├── toml-test-decoder │ │ │ │ │ └── main.go │ │ │ │ ├── toml-test-encoder │ │ │ │ │ └── main.go │ │ │ │ └── tomlv │ │ │ │ │ └── main.go │ │ │ │ ├── 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 │ │ ├── dustin │ │ │ └── go-broadcast │ │ │ │ ├── LICENSE │ │ │ │ ├── broadcaster.go │ │ │ │ └── mux_observer.go │ │ ├── gin-gonic │ │ │ └── gin │ │ │ │ ├── LICENSE │ │ │ │ ├── auth.go │ │ │ │ ├── binding │ │ │ │ ├── binding.go │ │ │ │ ├── default_validator.go │ │ │ │ ├── example │ │ │ │ │ └── test.pb.go │ │ │ │ ├── form.go │ │ │ │ ├── form_mapping.go │ │ │ │ ├── json.go │ │ │ │ ├── protobuf.go │ │ │ │ └── xml.go │ │ │ │ ├── context.go │ │ │ │ ├── debug.go │ │ │ │ ├── deprecated.go │ │ │ │ ├── errors.go │ │ │ │ ├── examples │ │ │ │ ├── app-engine │ │ │ │ │ └── hello.go │ │ │ │ ├── basic │ │ │ │ │ └── main.go │ │ │ │ ├── realtime-advanced │ │ │ │ │ ├── main.go │ │ │ │ │ ├── rooms.go │ │ │ │ │ ├── routes.go │ │ │ │ │ └── stats.go │ │ │ │ └── realtime-chat │ │ │ │ │ ├── main.go │ │ │ │ │ ├── rooms.go │ │ │ │ │ └── template.go │ │ │ │ ├── fs.go │ │ │ │ ├── gin.go │ │ │ │ ├── ginS │ │ │ │ └── gins.go │ │ │ │ ├── logger.go │ │ │ │ ├── mode.go │ │ │ │ ├── path.go │ │ │ │ ├── recovery.go │ │ │ │ ├── render │ │ │ │ ├── data.go │ │ │ │ ├── html.go │ │ │ │ ├── json.go │ │ │ │ ├── redirect.go │ │ │ │ ├── render.go │ │ │ │ ├── text.go │ │ │ │ ├── xml.go │ │ │ │ └── yaml.go │ │ │ │ ├── response_writer.go │ │ │ │ ├── routergroup.go │ │ │ │ ├── tree.go │ │ │ │ └── utils.go │ │ ├── golang │ │ │ └── protobuf │ │ │ │ ├── proto │ │ │ │ ├── LICENSE │ │ │ │ ├── clone.go │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── equal.go │ │ │ │ ├── extensions.go │ │ │ │ ├── lib.go │ │ │ │ ├── message_set.go │ │ │ │ ├── pointer_reflect.go │ │ │ │ ├── pointer_unsafe.go │ │ │ │ ├── properties.go │ │ │ │ ├── proto3_proto │ │ │ │ │ └── proto3.pb.go │ │ │ │ ├── text.go │ │ │ │ └── text_parser.go │ │ │ │ └── ptypes │ │ │ │ └── any │ │ │ │ ├── LICENSE │ │ │ │ └── any.pb.go │ │ ├── influxdata │ │ │ └── influxdb │ │ │ │ ├── client │ │ │ │ ├── LICENSE │ │ │ │ ├── influxdb.go │ │ │ │ └── v2 │ │ │ │ │ ├── client.go │ │ │ │ │ └── udp.go │ │ │ │ ├── models │ │ │ │ ├── LICENSE │ │ │ │ ├── consistency.go │ │ │ │ ├── inline_fnv.go │ │ │ │ ├── inline_strconv_parse.go │ │ │ │ ├── points.go │ │ │ │ ├── rows.go │ │ │ │ ├── statistic.go │ │ │ │ └── time.go │ │ │ │ └── pkg │ │ │ │ └── escape │ │ │ │ ├── LICENSE │ │ │ │ ├── bytes.go │ │ │ │ └── strings.go │ │ ├── manucorporat │ │ │ ├── sse │ │ │ │ ├── LICENSE │ │ │ │ ├── sse-decoder.go │ │ │ │ ├── sse-encoder.go │ │ │ │ └── writer.go │ │ │ └── stats │ │ │ │ └── stats.go │ │ ├── mattn │ │ │ └── go-isatty │ │ │ │ ├── LICENSE │ │ │ │ ├── doc.go │ │ │ │ ├── isatty_appengine.go │ │ │ │ ├── isatty_bsd.go │ │ │ │ ├── isatty_linux.go │ │ │ │ ├── isatty_others.go │ │ │ │ ├── isatty_solaris.go │ │ │ │ └── isatty_windows.go │ │ ├── pkg │ │ │ └── errors │ │ │ │ ├── LICENSE │ │ │ │ ├── errors.go │ │ │ │ └── stack.go │ │ ├── rcrowley │ │ │ └── go-metrics │ │ │ │ ├── LICENSE │ │ │ │ ├── cmd │ │ │ │ ├── metrics-bench │ │ │ │ │ └── metrics-bench.go │ │ │ │ ├── metrics-example │ │ │ │ │ └── metrics-example.go │ │ │ │ └── never-read │ │ │ │ │ └── never-read.go │ │ │ │ ├── counter.go │ │ │ │ ├── debug.go │ │ │ │ ├── ewma.go │ │ │ │ ├── exp │ │ │ │ └── exp.go │ │ │ │ ├── gauge.go │ │ │ │ ├── gauge_float64.go │ │ │ │ ├── graphite.go │ │ │ │ ├── healthcheck.go │ │ │ │ ├── histogram.go │ │ │ │ ├── json.go │ │ │ │ ├── librato │ │ │ │ ├── client.go │ │ │ │ └── librato.go │ │ │ │ ├── log.go │ │ │ │ ├── meter.go │ │ │ │ ├── metrics.go │ │ │ │ ├── opentsdb.go │ │ │ │ ├── registry.go │ │ │ │ ├── runtime.go │ │ │ │ ├── runtime_cgo.go │ │ │ │ ├── runtime_gccpufraction.go │ │ │ │ ├── runtime_no_cgo.go │ │ │ │ ├── runtime_no_gccpufraction.go │ │ │ │ ├── sample.go │ │ │ │ ├── stathat │ │ │ │ └── stathat.go │ │ │ │ ├── syslog.go │ │ │ │ ├── timer.go │ │ │ │ └── writer.go │ │ ├── stathat │ │ │ └── go │ │ │ │ ├── LICENSE │ │ │ │ └── stathat.go │ │ ├── vrischmann │ │ │ └── go-metrics-influxdb │ │ │ │ ├── LICENSE │ │ │ │ └── influxdb.go │ │ └── wadey │ │ │ └── gocovmerge │ │ │ ├── LICENSE │ │ │ └── gocovmerge.go │ ├── golang.org │ │ └── x │ │ │ ├── net │ │ │ └── context │ │ │ │ ├── LICENSE │ │ │ │ ├── context.go │ │ │ │ ├── ctxhttp │ │ │ │ ├── ctxhttp.go │ │ │ │ └── ctxhttp_pre17.go │ │ │ │ ├── go17.go │ │ │ │ └── pre_go17.go │ │ │ ├── sync │ │ │ └── errgroup │ │ │ │ ├── LICENSE │ │ │ │ └── errgroup.go │ │ │ ├── sys │ │ │ └── unix │ │ │ │ ├── LICENSE │ │ │ │ ├── asm_darwin_386.s │ │ │ │ ├── asm_darwin_amd64.s │ │ │ │ ├── asm_darwin_arm.s │ │ │ │ ├── asm_darwin_arm64.s │ │ │ │ ├── asm_dragonfly_amd64.s │ │ │ │ ├── asm_freebsd_386.s │ │ │ │ ├── asm_freebsd_amd64.s │ │ │ │ ├── asm_freebsd_arm.s │ │ │ │ ├── asm_linux_386.s │ │ │ │ ├── asm_linux_amd64.s │ │ │ │ ├── asm_linux_arm.s │ │ │ │ ├── asm_linux_arm64.s │ │ │ │ ├── asm_linux_mips64x.s │ │ │ │ ├── asm_linux_mipsx.s │ │ │ │ ├── asm_linux_ppc64x.s │ │ │ │ ├── asm_linux_s390x.s │ │ │ │ ├── asm_netbsd_386.s │ │ │ │ ├── asm_netbsd_amd64.s │ │ │ │ ├── asm_netbsd_arm.s │ │ │ │ ├── asm_openbsd_386.s │ │ │ │ ├── asm_openbsd_amd64.s │ │ │ │ ├── asm_solaris_amd64.s │ │ │ │ ├── bluetooth_linux.go │ │ │ │ ├── constants.go │ │ │ │ ├── dirent.go │ │ │ │ ├── endian_big.go │ │ │ │ ├── endian_little.go │ │ │ │ ├── env_unix.go │ │ │ │ ├── env_unset.go │ │ │ │ ├── flock.go │ │ │ │ ├── flock_linux_32bit.go │ │ │ │ ├── gccgo.go │ │ │ │ ├── gccgo_c.c │ │ │ │ ├── gccgo_linux_amd64.go │ │ │ │ ├── gccgo_linux_sparc64.go │ │ │ │ ├── linux │ │ │ │ ├── mkall.go │ │ │ │ └── types.go │ │ │ │ ├── mkpost.go │ │ │ │ ├── openbsd_pledge.go │ │ │ │ ├── race.go │ │ │ │ ├── race0.go │ │ │ │ ├── sockcmsg_linux.go │ │ │ │ ├── sockcmsg_unix.go │ │ │ │ ├── str.go │ │ │ │ ├── syscall.go │ │ │ │ ├── syscall_bsd.go │ │ │ │ ├── syscall_darwin.go │ │ │ │ ├── syscall_darwin_386.go │ │ │ │ ├── syscall_darwin_amd64.go │ │ │ │ ├── syscall_darwin_arm.go │ │ │ │ ├── syscall_darwin_arm64.go │ │ │ │ ├── syscall_dragonfly.go │ │ │ │ ├── syscall_dragonfly_amd64.go │ │ │ │ ├── syscall_freebsd.go │ │ │ │ ├── syscall_freebsd_386.go │ │ │ │ ├── syscall_freebsd_amd64.go │ │ │ │ ├── syscall_freebsd_arm.go │ │ │ │ ├── syscall_linux.go │ │ │ │ ├── syscall_linux_386.go │ │ │ │ ├── syscall_linux_amd64.go │ │ │ │ ├── syscall_linux_amd64_gc.go │ │ │ │ ├── syscall_linux_arm.go │ │ │ │ ├── syscall_linux_arm64.go │ │ │ │ ├── syscall_linux_mips64x.go │ │ │ │ ├── syscall_linux_mipsx.go │ │ │ │ ├── syscall_linux_ppc64x.go │ │ │ │ ├── syscall_linux_s390x.go │ │ │ │ ├── syscall_linux_sparc64.go │ │ │ │ ├── syscall_netbsd.go │ │ │ │ ├── syscall_netbsd_386.go │ │ │ │ ├── syscall_netbsd_amd64.go │ │ │ │ ├── syscall_netbsd_arm.go │ │ │ │ ├── syscall_no_getwd.go │ │ │ │ ├── syscall_openbsd.go │ │ │ │ ├── syscall_openbsd_386.go │ │ │ │ ├── syscall_openbsd_amd64.go │ │ │ │ ├── syscall_solaris.go │ │ │ │ ├── syscall_solaris_amd64.go │ │ │ │ ├── syscall_unix.go │ │ │ │ ├── syscall_unix_gc.go │ │ │ │ ├── types_darwin.go │ │ │ │ ├── types_dragonfly.go │ │ │ │ ├── types_freebsd.go │ │ │ │ ├── types_netbsd.go │ │ │ │ ├── types_openbsd.go │ │ │ │ ├── types_solaris.go │ │ │ │ ├── zerrors_darwin_386.go │ │ │ │ ├── zerrors_darwin_amd64.go │ │ │ │ ├── zerrors_darwin_arm.go │ │ │ │ ├── zerrors_darwin_arm64.go │ │ │ │ ├── zerrors_dragonfly_amd64.go │ │ │ │ ├── zerrors_freebsd_386.go │ │ │ │ ├── zerrors_freebsd_amd64.go │ │ │ │ ├── zerrors_freebsd_arm.go │ │ │ │ ├── zerrors_linux_386.go │ │ │ │ ├── zerrors_linux_amd64.go │ │ │ │ ├── zerrors_linux_arm.go │ │ │ │ ├── zerrors_linux_arm64.go │ │ │ │ ├── zerrors_linux_mips.go │ │ │ │ ├── zerrors_linux_mips64.go │ │ │ │ ├── zerrors_linux_mips64le.go │ │ │ │ ├── zerrors_linux_mipsle.go │ │ │ │ ├── zerrors_linux_ppc64.go │ │ │ │ ├── zerrors_linux_ppc64le.go │ │ │ │ ├── zerrors_linux_s390x.go │ │ │ │ ├── zerrors_linux_sparc64.go │ │ │ │ ├── zerrors_netbsd_386.go │ │ │ │ ├── zerrors_netbsd_amd64.go │ │ │ │ ├── zerrors_netbsd_arm.go │ │ │ │ ├── zerrors_openbsd_386.go │ │ │ │ ├── zerrors_openbsd_amd64.go │ │ │ │ ├── zerrors_solaris_amd64.go │ │ │ │ ├── zsyscall_darwin_386.go │ │ │ │ ├── zsyscall_darwin_amd64.go │ │ │ │ ├── zsyscall_darwin_arm.go │ │ │ │ ├── zsyscall_darwin_arm64.go │ │ │ │ ├── zsyscall_dragonfly_amd64.go │ │ │ │ ├── zsyscall_freebsd_386.go │ │ │ │ ├── zsyscall_freebsd_amd64.go │ │ │ │ ├── zsyscall_freebsd_arm.go │ │ │ │ ├── zsyscall_linux_386.go │ │ │ │ ├── zsyscall_linux_amd64.go │ │ │ │ ├── zsyscall_linux_arm.go │ │ │ │ ├── zsyscall_linux_arm64.go │ │ │ │ ├── zsyscall_linux_mips.go │ │ │ │ ├── zsyscall_linux_mips64.go │ │ │ │ ├── zsyscall_linux_mips64le.go │ │ │ │ ├── zsyscall_linux_mipsle.go │ │ │ │ ├── zsyscall_linux_ppc64.go │ │ │ │ ├── zsyscall_linux_ppc64le.go │ │ │ │ ├── zsyscall_linux_s390x.go │ │ │ │ ├── zsyscall_linux_sparc64.go │ │ │ │ ├── zsyscall_netbsd_386.go │ │ │ │ ├── zsyscall_netbsd_amd64.go │ │ │ │ ├── zsyscall_netbsd_arm.go │ │ │ │ ├── zsyscall_openbsd_386.go │ │ │ │ ├── zsyscall_openbsd_amd64.go │ │ │ │ ├── zsyscall_solaris_amd64.go │ │ │ │ ├── zsysctl_openbsd.go │ │ │ │ ├── zsysnum_darwin_386.go │ │ │ │ ├── zsysnum_darwin_amd64.go │ │ │ │ ├── zsysnum_darwin_arm.go │ │ │ │ ├── zsysnum_darwin_arm64.go │ │ │ │ ├── zsysnum_dragonfly_amd64.go │ │ │ │ ├── zsysnum_freebsd_386.go │ │ │ │ ├── zsysnum_freebsd_amd64.go │ │ │ │ ├── zsysnum_freebsd_arm.go │ │ │ │ ├── zsysnum_linux_386.go │ │ │ │ ├── zsysnum_linux_amd64.go │ │ │ │ ├── zsysnum_linux_arm.go │ │ │ │ ├── zsysnum_linux_arm64.go │ │ │ │ ├── zsysnum_linux_mips.go │ │ │ │ ├── zsysnum_linux_mips64.go │ │ │ │ ├── zsysnum_linux_mips64le.go │ │ │ │ ├── zsysnum_linux_mipsle.go │ │ │ │ ├── zsysnum_linux_ppc64.go │ │ │ │ ├── zsysnum_linux_ppc64le.go │ │ │ │ ├── zsysnum_linux_s390x.go │ │ │ │ ├── zsysnum_linux_sparc64.go │ │ │ │ ├── zsysnum_netbsd_386.go │ │ │ │ ├── zsysnum_netbsd_amd64.go │ │ │ │ ├── zsysnum_netbsd_arm.go │ │ │ │ ├── zsysnum_openbsd_386.go │ │ │ │ ├── zsysnum_openbsd_amd64.go │ │ │ │ ├── zsysnum_solaris_amd64.go │ │ │ │ ├── ztypes_darwin_386.go │ │ │ │ ├── ztypes_darwin_amd64.go │ │ │ │ ├── ztypes_darwin_arm.go │ │ │ │ ├── ztypes_darwin_arm64.go │ │ │ │ ├── ztypes_dragonfly_amd64.go │ │ │ │ ├── ztypes_freebsd_386.go │ │ │ │ ├── ztypes_freebsd_amd64.go │ │ │ │ ├── ztypes_freebsd_arm.go │ │ │ │ ├── ztypes_linux_386.go │ │ │ │ ├── ztypes_linux_amd64.go │ │ │ │ ├── ztypes_linux_arm.go │ │ │ │ ├── ztypes_linux_arm64.go │ │ │ │ ├── ztypes_linux_mips.go │ │ │ │ ├── ztypes_linux_mips64.go │ │ │ │ ├── ztypes_linux_mips64le.go │ │ │ │ ├── ztypes_linux_mipsle.go │ │ │ │ ├── ztypes_linux_ppc64.go │ │ │ │ ├── ztypes_linux_ppc64le.go │ │ │ │ ├── ztypes_linux_s390x.go │ │ │ │ ├── ztypes_linux_sparc64.go │ │ │ │ ├── ztypes_netbsd_386.go │ │ │ │ ├── ztypes_netbsd_amd64.go │ │ │ │ ├── ztypes_netbsd_arm.go │ │ │ │ ├── ztypes_openbsd_386.go │ │ │ │ ├── ztypes_openbsd_amd64.go │ │ │ │ └── ztypes_solaris_amd64.go │ │ │ └── tools │ │ │ └── cover │ │ │ ├── LICENSE │ │ │ └── profile.go │ ├── gopkg.in │ │ ├── go-playground │ │ │ └── validator.v8 │ │ │ │ ├── LICENSE │ │ │ │ ├── baked_in.go │ │ │ │ ├── cache.go │ │ │ │ ├── doc.go │ │ │ │ ├── examples │ │ │ │ ├── custom │ │ │ │ │ └── custom.go │ │ │ │ ├── simple │ │ │ │ │ └── simple.go │ │ │ │ └── struct-level │ │ │ │ │ └── struct_level.go │ │ │ │ ├── regexes.go │ │ │ │ ├── util.go │ │ │ │ └── validator.go │ │ ├── olivere │ │ │ ├── elastic.v3 │ │ │ │ ├── LICENSE │ │ │ │ ├── backoff.go │ │ │ │ ├── backoff │ │ │ │ │ ├── backoff.go │ │ │ │ │ └── retry.go │ │ │ │ ├── bulk.go │ │ │ │ ├── bulk_delete_request.go │ │ │ │ ├── bulk_index_request.go │ │ │ │ ├── bulk_processor.go │ │ │ │ ├── bulk_request.go │ │ │ │ ├── bulk_update_request.go │ │ │ │ ├── canonicalize.go │ │ │ │ ├── clear_scroll.go │ │ │ │ ├── client.go │ │ │ │ ├── cluster-test │ │ │ │ │ └── cluster-test.go │ │ │ │ ├── cluster_health.go │ │ │ │ ├── cluster_state.go │ │ │ │ ├── cluster_stats.go │ │ │ │ ├── connection.go │ │ │ │ ├── count.go │ │ │ │ ├── decoder.go │ │ │ │ ├── delete.go │ │ │ │ ├── delete_by_query.go │ │ │ │ ├── delete_template.go │ │ │ │ ├── doc.go │ │ │ │ ├── errors.go │ │ │ │ ├── exists.go │ │ │ │ ├── explain.go │ │ │ │ ├── fetch_source_context.go │ │ │ │ ├── field_stats.go │ │ │ │ ├── geo_point.go │ │ │ │ ├── get.go │ │ │ │ ├── get_template.go │ │ │ │ ├── highlight.go │ │ │ │ ├── index.go │ │ │ │ ├── indices_analyze.go │ │ │ │ ├── indices_close.go │ │ │ │ ├── indices_create.go │ │ │ │ ├── indices_delete.go │ │ │ │ ├── indices_delete_template.go │ │ │ │ ├── indices_delete_warmer.go │ │ │ │ ├── indices_exists.go │ │ │ │ ├── indices_exists_template.go │ │ │ │ ├── indices_exists_type.go │ │ │ │ ├── indices_flush.go │ │ │ │ ├── indices_forcemerge.go │ │ │ │ ├── indices_get.go │ │ │ │ ├── indices_get_aliases.go │ │ │ │ ├── indices_get_mapping.go │ │ │ │ ├── indices_get_settings.go │ │ │ │ ├── indices_get_template.go │ │ │ │ ├── indices_get_warmer.go │ │ │ │ ├── indices_open.go │ │ │ │ ├── indices_put_alias.go │ │ │ │ ├── indices_put_mapping.go │ │ │ │ ├── indices_put_settings.go │ │ │ │ ├── indices_put_template.go │ │ │ │ ├── indices_put_warmer.go │ │ │ │ ├── indices_refresh.go │ │ │ │ ├── indices_stats.go │ │ │ │ ├── inner_hit.go │ │ │ │ ├── logger.go │ │ │ │ ├── mget.go │ │ │ │ ├── msearch.go │ │ │ │ ├── mtermvectors.go │ │ │ │ ├── nodes_info.go │ │ │ │ ├── nodes_stats.go │ │ │ │ ├── optimize.go │ │ │ │ ├── percolate.go │ │ │ │ ├── ping.go │ │ │ │ ├── plugins.go │ │ │ │ ├── query.go │ │ │ │ ├── reindex.go │ │ │ │ ├── reindexer.go │ │ │ │ ├── request.go │ │ │ │ ├── rescore.go │ │ │ │ ├── rescorer.go │ │ │ │ ├── response.go │ │ │ │ ├── retrier.go │ │ │ │ ├── scan.go │ │ │ │ ├── script.go │ │ │ │ ├── scroll.go │ │ │ │ ├── search.go │ │ │ │ ├── search_aggs.go │ │ │ │ ├── search_aggs_bucket_children.go │ │ │ │ ├── search_aggs_bucket_date_histogram.go │ │ │ │ ├── search_aggs_bucket_date_range.go │ │ │ │ ├── search_aggs_bucket_filter.go │ │ │ │ ├── search_aggs_bucket_filters.go │ │ │ │ ├── search_aggs_bucket_geo_distance.go │ │ │ │ ├── search_aggs_bucket_geohash_grid.go │ │ │ │ ├── search_aggs_bucket_global.go │ │ │ │ ├── search_aggs_bucket_histogram.go │ │ │ │ ├── search_aggs_bucket_missing.go │ │ │ │ ├── search_aggs_bucket_nested.go │ │ │ │ ├── search_aggs_bucket_range.go │ │ │ │ ├── search_aggs_bucket_reverse_nested.go │ │ │ │ ├── search_aggs_bucket_sampler.go │ │ │ │ ├── search_aggs_bucket_significant_terms.go │ │ │ │ ├── search_aggs_bucket_terms.go │ │ │ │ ├── search_aggs_metrics_avg.go │ │ │ │ ├── search_aggs_metrics_cardinality.go │ │ │ │ ├── search_aggs_metrics_extended_stats.go │ │ │ │ ├── search_aggs_metrics_geo_bounds.go │ │ │ │ ├── search_aggs_metrics_max.go │ │ │ │ ├── search_aggs_metrics_min.go │ │ │ │ ├── search_aggs_metrics_percentile_ranks.go │ │ │ │ ├── search_aggs_metrics_percentiles.go │ │ │ │ ├── search_aggs_metrics_stats.go │ │ │ │ ├── search_aggs_metrics_sum.go │ │ │ │ ├── search_aggs_metrics_top_hits.go │ │ │ │ ├── search_aggs_metrics_value_count.go │ │ │ │ ├── search_aggs_pipeline_avg_bucket.go │ │ │ │ ├── search_aggs_pipeline_bucket_script.go │ │ │ │ ├── search_aggs_pipeline_bucket_selector.go │ │ │ │ ├── search_aggs_pipeline_cumulative_sum.go │ │ │ │ ├── search_aggs_pipeline_derivative.go │ │ │ │ ├── search_aggs_pipeline_max_bucket.go │ │ │ │ ├── search_aggs_pipeline_min_bucket.go │ │ │ │ ├── search_aggs_pipeline_mov_avg.go │ │ │ │ ├── search_aggs_pipeline_serial_diff.go │ │ │ │ ├── search_aggs_pipeline_stats_bucket.go │ │ │ │ ├── search_aggs_pipeline_sum_bucket.go │ │ │ │ ├── search_queries_bool.go │ │ │ │ ├── search_queries_boosting.go │ │ │ │ ├── search_queries_common_terms.go │ │ │ │ ├── search_queries_constant_score.go │ │ │ │ ├── search_queries_dis_max.go │ │ │ │ ├── search_queries_exists.go │ │ │ │ ├── search_queries_fsq.go │ │ │ │ ├── search_queries_fsq_score_funcs.go │ │ │ │ ├── search_queries_fuzzy.go │ │ │ │ ├── search_queries_geo_bounding_box.go │ │ │ │ ├── search_queries_geo_distance.go │ │ │ │ ├── search_queries_geo_polygon.go │ │ │ │ ├── search_queries_has_child.go │ │ │ │ ├── search_queries_has_parent.go │ │ │ │ ├── search_queries_ids.go │ │ │ │ ├── search_queries_indices.go │ │ │ │ ├── search_queries_match.go │ │ │ │ ├── search_queries_match_all.go │ │ │ │ ├── search_queries_missing.go │ │ │ │ ├── search_queries_more_like_this.go │ │ │ │ ├── search_queries_multi_match.go │ │ │ │ ├── search_queries_nested.go │ │ │ │ ├── search_queries_not.go │ │ │ │ ├── search_queries_prefix.go │ │ │ │ ├── search_queries_query_string.go │ │ │ │ ├── search_queries_range.go │ │ │ │ ├── search_queries_raw_string.go │ │ │ │ ├── search_queries_regexp.go │ │ │ │ ├── search_queries_script.go │ │ │ │ ├── search_queries_simple_query_string.go │ │ │ │ ├── search_queries_template_query.go │ │ │ │ ├── search_queries_term.go │ │ │ │ ├── search_queries_terms.go │ │ │ │ ├── search_queries_type.go │ │ │ │ ├── search_queries_wildcard.go │ │ │ │ ├── search_request.go │ │ │ │ ├── search_source.go │ │ │ │ ├── search_template.go │ │ │ │ ├── sort.go │ │ │ │ ├── suggest.go │ │ │ │ ├── suggest_field.go │ │ │ │ ├── suggester.go │ │ │ │ ├── suggester_completion.go │ │ │ │ ├── suggester_completion_fuzzy.go │ │ │ │ ├── suggester_context.go │ │ │ │ ├── suggester_context_category.go │ │ │ │ ├── suggester_context_geo.go │ │ │ │ ├── suggester_phrase.go │ │ │ │ ├── suggester_term.go │ │ │ │ ├── tasks_cancel.go │ │ │ │ ├── tasks_list.go │ │ │ │ ├── termvectors.go │ │ │ │ ├── update.go │ │ │ │ ├── update_by_query.go │ │ │ │ └── uritemplates │ │ │ │ │ ├── uritemplates.go │ │ │ │ │ └── utils.go │ │ │ └── elastic.v5 │ │ │ │ ├── LICENSE │ │ │ │ ├── acknowledged_response.go │ │ │ │ ├── backoff.go │ │ │ │ ├── bulk.go │ │ │ │ ├── bulk_delete_request.go │ │ │ │ ├── bulk_index_request.go │ │ │ │ ├── bulk_processor.go │ │ │ │ ├── bulk_request.go │ │ │ │ ├── bulk_update_request.go │ │ │ │ ├── canonicalize.go │ │ │ │ ├── clear_scroll.go │ │ │ │ ├── client.go │ │ │ │ ├── cluster-test │ │ │ │ └── cluster-test.go │ │ │ │ ├── cluster_health.go │ │ │ │ ├── cluster_state.go │ │ │ │ ├── cluster_stats.go │ │ │ │ ├── connection.go │ │ │ │ ├── count.go │ │ │ │ ├── decoder.go │ │ │ │ ├── delete.go │ │ │ │ ├── delete_by_query.go │ │ │ │ ├── delete_template.go │ │ │ │ ├── doc.go │ │ │ │ ├── errors.go │ │ │ │ ├── exists.go │ │ │ │ ├── explain.go │ │ │ │ ├── fetch_source_context.go │ │ │ │ ├── field_stats.go │ │ │ │ ├── geo_point.go │ │ │ │ ├── get.go │ │ │ │ ├── get_template.go │ │ │ │ ├── highlight.go │ │ │ │ ├── index.go │ │ │ │ ├── indices_analyze.go │ │ │ │ ├── indices_close.go │ │ │ │ ├── indices_create.go │ │ │ │ ├── indices_delete.go │ │ │ │ ├── indices_delete_template.go │ │ │ │ ├── indices_exists.go │ │ │ │ ├── indices_exists_template.go │ │ │ │ ├── indices_exists_type.go │ │ │ │ ├── indices_flush.go │ │ │ │ ├── indices_forcemerge.go │ │ │ │ ├── indices_get.go │ │ │ │ ├── indices_get_aliases.go │ │ │ │ ├── indices_get_field_mapping.go │ │ │ │ ├── indices_get_mapping.go │ │ │ │ ├── indices_get_settings.go │ │ │ │ ├── indices_get_template.go │ │ │ │ ├── indices_open.go │ │ │ │ ├── indices_put_alias.go │ │ │ │ ├── indices_put_mapping.go │ │ │ │ ├── indices_put_settings.go │ │ │ │ ├── indices_put_template.go │ │ │ │ ├── indices_refresh.go │ │ │ │ ├── indices_rollover.go │ │ │ │ ├── indices_shrink.go │ │ │ │ ├── indices_stats.go │ │ │ │ ├── ingest_delete_pipeline.go │ │ │ │ ├── ingest_get_pipeline.go │ │ │ │ ├── ingest_put_pipeline.go │ │ │ │ ├── ingest_simulate_pipeline.go │ │ │ │ ├── inner_hit.go │ │ │ │ ├── logger.go │ │ │ │ ├── mget.go │ │ │ │ ├── msearch.go │ │ │ │ ├── mtermvectors.go │ │ │ │ ├── nodes_info.go │ │ │ │ ├── nodes_stats.go │ │ │ │ ├── ping.go │ │ │ │ ├── plugins.go │ │ │ │ ├── put_template.go │ │ │ │ ├── query.go │ │ │ │ ├── recipes │ │ │ │ ├── bulk_insert │ │ │ │ │ └── bulk_insert.go │ │ │ │ ├── connect │ │ │ │ │ └── connect.go │ │ │ │ └── sliced_scroll │ │ │ │ │ └── sliced_scroll.go │ │ │ │ ├── reindex.go │ │ │ │ ├── request.go │ │ │ │ ├── rescore.go │ │ │ │ ├── rescorer.go │ │ │ │ ├── response.go │ │ │ │ ├── retrier.go │ │ │ │ ├── retry.go │ │ │ │ ├── script.go │ │ │ │ ├── scroll.go │ │ │ │ ├── search.go │ │ │ │ ├── search_aggs.go │ │ │ │ ├── search_aggs_bucket_children.go │ │ │ │ ├── search_aggs_bucket_date_histogram.go │ │ │ │ ├── search_aggs_bucket_date_range.go │ │ │ │ ├── search_aggs_bucket_filter.go │ │ │ │ ├── search_aggs_bucket_filters.go │ │ │ │ ├── search_aggs_bucket_geo_distance.go │ │ │ │ ├── search_aggs_bucket_geohash_grid.go │ │ │ │ ├── search_aggs_bucket_global.go │ │ │ │ ├── search_aggs_bucket_histogram.go │ │ │ │ ├── search_aggs_bucket_missing.go │ │ │ │ ├── search_aggs_bucket_nested.go │ │ │ │ ├── search_aggs_bucket_range.go │ │ │ │ ├── search_aggs_bucket_reverse_nested.go │ │ │ │ ├── search_aggs_bucket_sampler.go │ │ │ │ ├── search_aggs_bucket_significant_terms.go │ │ │ │ ├── search_aggs_bucket_terms.go │ │ │ │ ├── search_aggs_matrix_stats.go │ │ │ │ ├── search_aggs_metrics_avg.go │ │ │ │ ├── search_aggs_metrics_cardinality.go │ │ │ │ ├── search_aggs_metrics_extended_stats.go │ │ │ │ ├── search_aggs_metrics_geo_bounds.go │ │ │ │ ├── search_aggs_metrics_max.go │ │ │ │ ├── search_aggs_metrics_min.go │ │ │ │ ├── search_aggs_metrics_percentile_ranks.go │ │ │ │ ├── search_aggs_metrics_percentiles.go │ │ │ │ ├── search_aggs_metrics_stats.go │ │ │ │ ├── search_aggs_metrics_sum.go │ │ │ │ ├── search_aggs_metrics_top_hits.go │ │ │ │ ├── search_aggs_metrics_value_count.go │ │ │ │ ├── search_aggs_pipeline_avg_bucket.go │ │ │ │ ├── search_aggs_pipeline_bucket_script.go │ │ │ │ ├── search_aggs_pipeline_bucket_selector.go │ │ │ │ ├── search_aggs_pipeline_cumulative_sum.go │ │ │ │ ├── search_aggs_pipeline_derivative.go │ │ │ │ ├── search_aggs_pipeline_max_bucket.go │ │ │ │ ├── search_aggs_pipeline_min_bucket.go │ │ │ │ ├── search_aggs_pipeline_mov_avg.go │ │ │ │ ├── search_aggs_pipeline_percentiles_bucket.go │ │ │ │ ├── search_aggs_pipeline_serial_diff.go │ │ │ │ ├── search_aggs_pipeline_stats_bucket.go │ │ │ │ ├── search_aggs_pipeline_sum_bucket.go │ │ │ │ ├── search_collapse_builder.go │ │ │ │ ├── search_queries_bool.go │ │ │ │ ├── search_queries_boosting.go │ │ │ │ ├── search_queries_common_terms.go │ │ │ │ ├── search_queries_constant_score.go │ │ │ │ ├── search_queries_dis_max.go │ │ │ │ ├── search_queries_exists.go │ │ │ │ ├── search_queries_fsq.go │ │ │ │ ├── search_queries_fsq_score_funcs.go │ │ │ │ ├── search_queries_fuzzy.go │ │ │ │ ├── search_queries_geo_bounding_box.go │ │ │ │ ├── search_queries_geo_distance.go │ │ │ │ ├── search_queries_geo_polygon.go │ │ │ │ ├── search_queries_has_child.go │ │ │ │ ├── search_queries_has_parent.go │ │ │ │ ├── search_queries_ids.go │ │ │ │ ├── search_queries_indices.go │ │ │ │ ├── search_queries_match.go │ │ │ │ ├── search_queries_match_all.go │ │ │ │ ├── search_queries_more_like_this.go │ │ │ │ ├── search_queries_multi_match.go │ │ │ │ ├── search_queries_nested.go │ │ │ │ ├── search_queries_parent_id.go │ │ │ │ ├── search_queries_percolator.go │ │ │ │ ├── search_queries_prefix.go │ │ │ │ ├── search_queries_query_string.go │ │ │ │ ├── search_queries_range.go │ │ │ │ ├── search_queries_raw_string.go │ │ │ │ ├── search_queries_regexp.go │ │ │ │ ├── search_queries_script.go │ │ │ │ ├── search_queries_simple_query_string.go │ │ │ │ ├── search_queries_slice.go │ │ │ │ ├── search_queries_term.go │ │ │ │ ├── search_queries_terms.go │ │ │ │ ├── search_queries_type.go │ │ │ │ ├── search_queries_wildcard.go │ │ │ │ ├── search_request.go │ │ │ │ ├── search_source.go │ │ │ │ ├── search_terms_lookup.go │ │ │ │ ├── snapshot_create.go │ │ │ │ ├── snapshot_create_repository.go │ │ │ │ ├── snapshot_delete_repository.go │ │ │ │ ├── snapshot_get_repository.go │ │ │ │ ├── snapshot_verify_repository.go │ │ │ │ ├── sort.go │ │ │ │ ├── suggest.go │ │ │ │ ├── suggest_field.go │ │ │ │ ├── suggester.go │ │ │ │ ├── suggester_completion.go │ │ │ │ ├── suggester_completion_fuzzy.go │ │ │ │ ├── suggester_context.go │ │ │ │ ├── suggester_context_category.go │ │ │ │ ├── suggester_context_geo.go │ │ │ │ ├── suggester_phrase.go │ │ │ │ ├── suggester_term.go │ │ │ │ ├── tasks_cancel.go │ │ │ │ ├── tasks_list.go │ │ │ │ ├── termvectors.go │ │ │ │ ├── update.go │ │ │ │ ├── update_by_query.go │ │ │ │ └── uritemplates │ │ │ │ ├── uritemplates.go │ │ │ │ └── utils.go │ │ └── yaml.v2 │ │ │ ├── LICENSE │ │ │ ├── apic.go │ │ │ ├── decode.go │ │ │ ├── emitterc.go │ │ │ ├── encode.go │ │ │ ├── parserc.go │ │ │ ├── readerc.go │ │ │ ├── resolve.go │ │ │ ├── scannerc.go │ │ │ ├── sorter.go │ │ │ ├── writerc.go │ │ │ ├── yaml.go │ │ │ ├── yamlh.go │ │ │ └── yamlprivateh.go │ └── manifest └── web │ ├── css │ └── minimal.css │ ├── es.html │ ├── index.html │ └── js │ ├── elasticsearch.js │ └── elasticsearch.min.js └── talks ├── README.md ├── fosdem2017 ├── config │ ├── elasticsearch.yml │ └── log4j2.properties ├── generate-jobs ├── generate-software ├── infra-destroy ├── infra-init └── setup.sh └── hpckp16 ├── infra-destroy └── infra-init /.gitattributes: -------------------------------------------------------------------------------- 1 | server/vendor/* linguist-vendored 2 | server/web/js/elasticsearch*.js linguist-vendored 3 | client/waf-bin linguist-vendored 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | server/ogrt-server.log 2 | client/build 3 | client/.*waf* 4 | client/Makefile 5 | client/vendor 6 | server/dist 7 | server/.GOPATH 8 | server/bin 9 | -------------------------------------------------------------------------------- /client/src/ogrt-cmdline.ggo: -------------------------------------------------------------------------------- 1 | package "ogrt" 2 | 3 | defmode "link-info" 4 | modeoption "generate-signature" - "generate signature object file" mode="link-info" optional 5 | modeoption "show-signature" - "show signature of ELF" mode="link-info" string typestr="file" optional 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /client/src/ogrt-log.h: -------------------------------------------------------------------------------- 1 | #ifndef OGRT_LOG_H_INCLUDED 2 | #define OGRT_LOG_H_INCLUDED 3 | 4 | /* definitions */ 5 | #define _GNU_SOURCE 6 | 7 | /* includes */ 8 | #include 9 | #include 10 | #include "ogrt-main.h" 11 | 12 | #define OGRT_LOG_NOTHING (0) 13 | #define OGRT_LOG_FATAL (1) 14 | #define OGRT_LOG_ERR (2) 15 | #define OGRT_LOG_WARN (3) 16 | #define OGRT_LOG_INFO (4) 17 | #define OGRT_LOG_DBG (5) 18 | 19 | #define Log(level, ...) do { \ 20 | if (level <= ogrt_log_level) { \ 21 | fprintf(ogrt_log_file,"%s: ", CMDLINE_PARSER_PACKAGE); \ 22 | fprintf(ogrt_log_file, __VA_ARGS__); \ 23 | fflush(ogrt_log_file); \ 24 | } \ 25 | } while (0) 26 | 27 | extern FILE *ogrt_log_file; 28 | extern int ogrt_log_level; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /client/src/ogrt-main.h: -------------------------------------------------------------------------------- 1 | #ifndef OGRT_H_INCLUDED 2 | #define OGRT_H_INCLUDED 3 | 4 | #define _GNU_SOURCE 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include "ogrt.pb-c.h" 23 | #include "ogrt-readso.h" 24 | #include "ogrt-log.h" 25 | #include "ogrt-util.h" 26 | #include "ogrt-cmdline.h" 27 | #include "ogrt-signature.h" 28 | #include "config.h" 29 | 30 | /** ELF signature configuration */ 31 | #define OGRT_ELF_SECTION_NAME (".note.ogrt.info") 32 | #define OGRT_ELF_NOTE_TYPE (0x4f475254) 33 | 34 | /** function prototypes */ 35 | int ogrt_prepare_sendbuffer(const int message_type, const int message_length, char **buffer_begin, void **payload); 36 | bool ogrt_send_processinfo(); 37 | int ogrt_preload_init_hook(); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /client/src/ogrt-readso.h: -------------------------------------------------------------------------------- 1 | #ifndef OGRT_READSO_H_INCLUDED 2 | #define OGRT_READSO_H_INCLUDED 3 | 4 | /* definitions */ 5 | #define _GNU_SOURCE 6 | 7 | #define OGRT_STAMP_SUPPORTED_VERSION (0x01) 8 | 9 | /* includes */ 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include "ogrt-log.h" 16 | #include "ogrt-util.h" 17 | 18 | /* data structures */ 19 | struct elf_note { 20 | int32_t name_size; 21 | int32_t desc_size; 22 | int32_t type; 23 | uint8_t data[1]; 24 | } __attribute__((packed)); 25 | typedef struct elf_note elf_note; 26 | 27 | struct ogrt_note { 28 | char name[8]; /* "OGRT" plus null terminator, plus padding to 4 byte boundary */ 29 | uint8_t version; 30 | char uuid[37]; 31 | } __attribute__((packed)); 32 | typedef struct ogrt_note ogrt_note; 33 | 34 | struct so_infos { 35 | int32_t size; 36 | int32_t index; 37 | OGRT__SharedObject shared_objects[1]; 38 | }; 39 | typedef struct so_infos so_infos; 40 | 41 | /* function prototypes */ 42 | int ogrt_read_signature(const char *note, uint8_t *ret_version, char **ret_signature); 43 | int handle_program_header(struct dl_phdr_info *info, size_t size, void *data); 44 | so_infos *ogrt_get_loaded_so(); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /client/src/ogrt-signature.h: -------------------------------------------------------------------------------- 1 | extern char template_signature[]; 2 | extern unsigned int template_signature_len; 3 | -------------------------------------------------------------------------------- /client/src/ogrt-util.h: -------------------------------------------------------------------------------- 1 | #ifndef OGRT_FILEUTIL_H_INCLUDED 2 | #define OGRT_FILEUTIL_H_INCLUDED 3 | 4 | /* definitions */ 5 | #define _GNU_SOURCE 6 | 7 | /* includes */ 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "ogrt-log.h" 19 | 20 | /* function prototypes */ 21 | bool ogrt_env_enabled(char *env_var); 22 | char *ogrt_normalize_path(const char *path); 23 | char *ogrt_get_binpath(const pid_t pid); 24 | char *ogrt_get_cmdline(const pid_t pid); 25 | char *ogrt_get_username(); 26 | char *ogrt_get_hostname(); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /client/src/stamp.s: -------------------------------------------------------------------------------- 1 | .section ".note.ogrt.info", "a" 2 | .p2align 2 3 | .long 1f - 0f # name size (not including padding) 4 | .long 3f - 2f # desc size (not including padding) 5 | .long 0x4F475254 # type 6 | 0: .asciz "OGRT" # name 7 | 1: .p2align 2 8 | 2: .byte 0x01 #version 9 | .asciz "AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA" # uuid 10 | 3: .p2align 2 11 | 12 | -------------------------------------------------------------------------------- /client/src/stamp_hello.s: -------------------------------------------------------------------------------- 1 | .section ".note.ogrt.info", "a" 2 | .p2align 2 3 | .long 1f - 0f # name size (not including padding) 4 | .long 3f - 2f # desc size (not including padding) 5 | .long 0x4F475254 # type 6 | 0: .asciz "OG" # name 7 | 1: .p2align 2 8 | 2: .asciz "hello from the stamp" # desc 9 | 3: .p2align 2 10 | 11 | -------------------------------------------------------------------------------- /client/src/stamp_helloshared.s: -------------------------------------------------------------------------------- 1 | .section ".note.ogrt.info", "a" 2 | .p2align 2 3 | .long 1f - 0f # name size (not including padding) 4 | .long 3f - 2f # desc size (not including padding) 5 | .long 0x4F475254 # type 6 | 0: .asciz "OG" # name 7 | 1: .p2align 2 8 | 2: .asciz "hello from the shared stamp" # desc 9 | 3: .p2align 2 10 | 11 | -------------------------------------------------------------------------------- /client/src/test_main.c: -------------------------------------------------------------------------------- 1 | #include "ogrt-main.h" 2 | #include "ogrt-test.h" 3 | 4 | TEST_INIT 5 | 6 | TEST_FUNC(ogrt_preload_init_hook, "test process info") 7 | ogrt_preload_init_hook(); 8 | TEST_END 9 | 10 | -------------------------------------------------------------------------------- /client/src/test_util.c: -------------------------------------------------------------------------------- 1 | #include "ogrt-util.h" 2 | #include "ogrt-test.h" 3 | 4 | TEST_INIT 5 | 6 | TEST_FUNC(ogrt_get_hostname, "check for hostname") 7 | printf("%s", ogrt_get_hostname()); 8 | TEST_END 9 | 10 | TEST_FUNC(ogrt_get_username, "check for username") 11 | printf("%s", ogrt_get_username()); 12 | TEST_END 13 | -------------------------------------------------------------------------------- /client/test/ogrt-test.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define TEST_START(name, description) void __attribute__((constructor)) test_##name(void) {\ 4 | printf("[T: %s] %s: ", __func__, description); 5 | #define TEST_END printf("\n"); } 6 | 7 | #define TEST_INIT int main() {} 8 | 9 | #define TEST_PASS printf("[PASS]"); 10 | #define TEST_FAIL(reason) printf("%s [FAIL]", reason); exit(-1); 11 | 12 | 13 | -------------------------------------------------------------------------------- /client/test/test_processinfo.c: -------------------------------------------------------------------------------- 1 | #include "ogrt-test.h" 2 | 3 | #include "../src/ogrt-main.h" 4 | 5 | TEST_INIT 6 | 7 | TEST_START(ogrt_send_processinfo, "run processinfo") 8 | { 9 | ogrt_send_processinfo(); 10 | TEST_PASS; 11 | } 12 | TEST_END 13 | 14 | -------------------------------------------------------------------------------- /client/test/test_readso.c: -------------------------------------------------------------------------------- 1 | #include "ogrt-test.h" 2 | 3 | #include "../src/ogrt-readso.h" 4 | 5 | TEST_INIT 6 | 7 | TEST_START(ogrt_read_signature, "read signature") 8 | { 9 | assert(1 == 1); 10 | // TEST_FAIL("not implemented yet"); 11 | TEST_PASS; 12 | } 13 | TEST_END 14 | 15 | -------------------------------------------------------------------------------- /client/test/test_util.c: -------------------------------------------------------------------------------- 1 | #include "ogrt-test.h" 2 | 3 | #include "../src/ogrt-util.h" 4 | #include 5 | 6 | TEST_INIT 7 | 8 | TEST_START(ogrt_get_hostname, "check if hostname is not null") 9 | { 10 | char *hostname = ogrt_get_hostname(); 11 | assert(hostname != NULL); 12 | free(hostname); 13 | TEST_PASS; 14 | } 15 | TEST_END 16 | 17 | TEST_START(ogrt_get_username, "check if username is not null") 18 | { 19 | char *username = ogrt_get_username(); 20 | assert(username != NULL); 21 | free(username); 22 | TEST_PASS; 23 | } 24 | TEST_END 25 | 26 | TEST_START(ogrt_get_cmdline, "check if cmdline is not null") 27 | { 28 | char *cmdline = ogrt_get_cmdline(getpid()); 29 | assert(cmdline != NULL); 30 | free(cmdline); 31 | TEST_PASS; 32 | } 33 | TEST_END 34 | -------------------------------------------------------------------------------- /client/waf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ -r vendor/install ]]; then 4 | export PATH="$(pwd)/vendor/install/bin:$PATH" 5 | export CPATH="$(pwd)/vendor/install/include:$CPATH" 6 | export CPATH="$(pwd)/vendor/install/include/libelf:$CPATH" 7 | export LIBRARY_PATH="$(pwd)/vendor/install/lib:$LIBRARY_PATH" 8 | export LD_LIBRARY_PATH="$(pwd)/vendor/install/lib:$LD_LIBRARY_PATH" 9 | export PKG_CONFIG_PATH="$(pwd)/vendor/install/lib/pkgconfig:$PKG_CONFIG_PATH" 10 | fi 11 | 12 | ./waf-bin $@ 13 | 14 | -------------------------------------------------------------------------------- /client/waf-bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/georg-rath/ogrt/d1adf2eeaf93bb6c9bf980d91f3e470c89e77ee6/client/waf-bin -------------------------------------------------------------------------------- /client/wrappers/ld: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## OGRT Linker Wrapper 4 | # 5 | # Generate a signature object file and append it 6 | # to the arguments to ld. 7 | # This script is heavily influenced by a ld hardening 8 | # script I found somewhere in the interwebs. 9 | ### 10 | 11 | function is_debug() { 12 | [[ $OGRT_DEBUG == 1 || $OGRT_DEBUG == "yes" || $OGRT_DEBUG == "true" ]] 13 | } 14 | 15 | unwrapped=false 16 | self=false 17 | IFS=: read -ra path <<< "$PATH"; 18 | for p in "${path[@]}"; do 19 | binary="$p/${0##*/}" 20 | if $self && [[ -x "$binary" ]]; then 21 | unwrapped="$binary" 22 | break 23 | elif [[ "$binary" -ef "$0" ]]; then 24 | self=true 25 | fi 26 | done 27 | 28 | # no arguments, so do nothing 29 | if [[ ${#@} -eq 0 ]]; then 30 | exec "$unwrapped" 31 | fi 32 | 33 | # if ogrt is in path - inject signature to arguments 34 | if [[ $(command -v ogrt) ]]; then 35 | sigfile=$(mktemp) 36 | if [[ $? == 0 ]]; then 37 | # generate signature file 38 | ogrt --generate-signature > $sigfile 39 | [[ $? == 0 ]] && arguments+=( $sigfile ) && is_debug && echo "OGRT: appended signature $sigfile to argument list" 40 | fi 41 | fi 42 | 43 | exec "$unwrapped" "${arguments[@]}" "$@" 44 | 45 | # delete signature file if we are not in debug mode 46 | [[ -r $sigfile ]] && !is_debug && rm $sigfile 47 | -------------------------------------------------------------------------------- /demo/README.md: -------------------------------------------------------------------------------- 1 | # Demo 2 | 3 | These files create an ElasticSearch backend for OGRT and 4 | some example programs, with which you can play around. 5 | 6 | 1. Install the client into the demo directory 7 | ``` 8 | cd ../client 9 | ./vendorize 10 | ./configure --prefix=$(pwd)/../demo/ogrt 11 | make install 12 | ``` 13 | 14 | 2. Spin up the ElasticSearch infrastructure (requires Docker) 15 | ``` 16 | ./infra-init 17 | ``` 18 | 19 | 3. Add an ElasticSearch output to the servers ogrt.conf 20 | ``` 21 | [Outputs.ElasticSearch] 22 | Type = "JsonElasticSearch5" 23 | Workers = 2 24 | Params = "http:localhost:9200:ogrt" 25 | ``` 26 | 27 | 4. Start ogrt-server 28 | 29 | 5. Generate a software tree 30 | ``` 31 | ./generate-software 32 | ``` 33 | 34 | 6. Enable OGRT 35 | ``` 36 | . setup.sh 37 | ``` 38 | 39 | 7. Push example jobs to ElasticSearch 40 | ``` 41 | ./generate-jobs 42 | ``` 43 | 8. Check OGRT Web Interface on http://localhost:8080/web/ to see if 44 | server received messages 45 | 46 | 9. Check Kibana on http://localhost:5601/ for the data. The index name 47 | is 'ogrt' 48 | 49 | 50 | -------------------------------------------------------------------------------- /demo/config/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | http.host: 0.0.0.0 2 | 3 | http.cors.enabled : true 4 | http.cors.allow-origin: "/.*/" 5 | http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE 6 | http.cors.allow-headers : "X-Requested-With,X-Auth-Token,Content-Type, Content-Length, Authorization" 7 | -------------------------------------------------------------------------------- /demo/config/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | 3 | appender.console.type = Console 4 | appender.console.name = console 5 | appender.console.layout.type = PatternLayout 6 | appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n 7 | 8 | rootLogger.level = info 9 | rootLogger.appenderRef.console.ref = console 10 | -------------------------------------------------------------------------------- /demo/generate-jobs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # run example programs 3 | # you need to initialize OGRT (source setup.sh) first 4 | 5 | progs=( sw/R/R sw/python/python sw/bwa/bwa sw/samtools/samtools sw/java/java sw/blast/blast ) 6 | 7 | for i in {1..100}; do 8 | export JOBID=$i 9 | 10 | rand=$[$RANDOM % 6] 11 | ${progs[$rand]} > /dev/null 12 | ls > /dev/null 13 | done 14 | -------------------------------------------------------------------------------- /demo/generate-software: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # generate example program stubs that randomly 3 | # link to library A or B 4 | 5 | cat > prog.c < 7 | int main() { printf("I am a dummy()\n"); libfunc(); } 8 | EOM 9 | cat > lib.c < 11 | void libfunc() { printf("libfunc()\n"); } 12 | EOM 13 | 14 | progs=( R python bwa samtools java blast ) 15 | libs=( liba libb ) 16 | 17 | for lib in "${libs[@]}"; do 18 | libdir="sw/$lib/" 19 | export LIBRARY_PATH=$libdir:$LIBRARY_PATH 20 | libso="sw/$lib/${lib}.so" 21 | mkdir -p "$libdir" 22 | gcc -shared -fPIC -o "$libso" lib.c 23 | done 24 | 25 | for prog in "${progs[@]}"; do 26 | rand=$[$RANDOM % 2] 27 | progdir="sw/$prog/" 28 | prog="$progdir/$prog" 29 | libso="${libs[$rand]}.so" 30 | mkdir -p "$progdir" 31 | gcc -o "$prog" prog.c "-l:$libso" 32 | done 33 | 34 | rm prog.c lib.c 35 | -------------------------------------------------------------------------------- /demo/infra-destroy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker rm -f ogrt-fosdem17-es 4 | docker rm -f ogrt-fosdem17-kibana 5 | -------------------------------------------------------------------------------- /demo/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export LD_PRELOAD=$(pwd)/ogrt/lib/libogrt.so 4 | export OGRT_ACTIVE=1 5 | export OGRT_SILENT=1 6 | export PATH=$(pwd)/ogrt/bin/:$PATH 7 | export LD_LIBRARY_PATH=$(pwd)/sw/liba/:$(pwd)/sw/libb/:$LD_LIBRARY_PATH 8 | -------------------------------------------------------------------------------- /generate-protocol: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ## Script to generate protocol definitions 3 | set -euo pipefail 4 | 5 | function is_available() { 6 | command -v $1 >/dev/null 2>&1 || { echo >&2 "$1 not available."; exit 1; } 7 | } 8 | 9 | is_available "protoc" 10 | is_available "protoc-c" 11 | 12 | protoc --go_out server/src protocol/ogrt.proto 13 | protoc-c --c_out client/src/ protocol/ogrt.proto 14 | 15 | # copy C source into right location 16 | mv client/src/protocol/* client/src/ 17 | rmdir client/src/protocol 18 | sed -i 's|#include "protocol/ogrt.pb-c.h"|#include "ogrt.pb-c.h"|' client/src/ogrt.pb-c.c 19 | -------------------------------------------------------------------------------- /protocol/ogrt.proto: -------------------------------------------------------------------------------- 1 | package OGRT; 2 | 3 | enum MessageType { 4 | JobStartMsg = 10; 5 | JobEndMsg = 11; 6 | ProcessInfoMsg = 12; 7 | SharedObjectMsg = 13; 8 | ForkMsg = 14; 9 | ExecveMsg = 15; 10 | } 11 | 12 | message JobStart { 13 | required string job_id = 100; 14 | required int64 start_time = 101; 15 | } 16 | 17 | message JobEnd { 18 | required string job_id = 200; 19 | required int64 end_time = 201; 20 | } 21 | 22 | message SharedObject { 23 | required string path = 400; 24 | optional string signature = 401; 25 | } 26 | 27 | message Module { 28 | required string name = 700; 29 | } 30 | 31 | message ProcessInfo { 32 | required string binpath = 300; 33 | required int32 pid = 301; 34 | required int32 parent_pid = 302; 35 | required int64 time = 303; 36 | optional string signature = 304; 37 | optional string job_id = 305; 38 | optional string username = 306; 39 | optional string hostname = 307; 40 | optional string cmdline = 308; 41 | repeated string environment_variables = 309; 42 | repeated string arguments = 310; 43 | repeated SharedObject shared_objects = 311; 44 | repeated Module loaded_modules = 312; 45 | } 46 | 47 | message JobInfo { 48 | required string job_id = 400; 49 | repeated ProcessInfo processes = 401; 50 | } 51 | -------------------------------------------------------------------------------- /server/ogrt.conf: -------------------------------------------------------------------------------- 1 | ### 2 | ## OGRT Configuration 3 | ### 4 | ## Format of this config file is TOML. 5 | #### 6 | 7 | Address = "" 8 | Port = 7971 9 | MaxReceiveBuffer = 262144 10 | DebugEndpoint = false 11 | PrintMetrics = 0 12 | WebAPI = true 13 | # by default it listens on 0.0.0.0:8080 14 | # supply another listen string here if you want to change that 15 | # WebAPIAddress = ":9765" 16 | 17 | # ship ogrt-server metrics to InfluxDB 18 | # [InfluxMetrics] 19 | # Interval = 10 20 | # URL = "http://blah" 21 | # Database = "testdb" 22 | # User = "testuser" 23 | # Password = "testpass" 24 | 25 | 26 | ## Outputs - multiple definitions allowed 27 | ## This example writes to three outputs. 28 | # 29 | # [Outputs] 30 | # 31 | # [Outputs.Splunk] 32 | # Type = "JsonOverTcp" 33 | # Params = "tcp:splunk:18255" 34 | # Workers = 1 35 | # 36 | # [Outputs.ElasticSearch] 37 | # Type = "JsonElasticSearch" 38 | # Params = "http:elasticsearch:9200:index" 39 | # Workers = 1 40 | # 41 | # [Outputs.Local] 42 | # Type = "JsonFile" 43 | # Params = "/tmp/ogrt_jobs/" 44 | # Workers = 1 45 | 46 | [Outputs] 47 | 48 | #[Outputs.file] 49 | ## DO NOT USE THIS IN PRODUCTION 50 | #Type = "JsonFile" 51 | #Params = "/tmp/ogrt_jobs/" 52 | #Workers = 1 # more than one worker will make this output crash 53 | 54 | [Outputs.Null] 55 | # DO NOT USE THIS IN PRODUCTION 56 | Type = "Null" 57 | Workers = 3 58 | 59 | #[Outputs.ElasticSearch] 60 | #Type = "JsonElasticSearch5" 61 | #Workers = 2 62 | #Params = "http:localhost:9200:ogrt" 63 | 64 | 65 | -------------------------------------------------------------------------------- /server/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export GOPATH=$(pwd):$GOPATH 3 | go run src/ogrt-server.go src/web.go 4 | 5 | -------------------------------------------------------------------------------- /server/src/output/interface.go: -------------------------------------------------------------------------------- 1 | package output 2 | 3 | import ( 4 | "github.com/georg-rath/ogrt/src/protocol" 5 | ) 6 | 7 | type OGWriter interface { 8 | PersistJobStart(msg *OGRT.JobStart) 9 | PersistJobEnd(msg *OGRT.JobEnd) 10 | PersistProcessInfo(msg *OGRT.ProcessInfo) 11 | Open(params string) 12 | Close() 13 | } 14 | -------------------------------------------------------------------------------- /server/src/output/json_elasticsearch3.go: -------------------------------------------------------------------------------- 1 | package output 2 | 3 | import ( 4 | "github.com/georg-rath/ogrt/src/protocol" 5 | "log" 6 | "strings" 7 | 8 | "gopkg.in/olivere/elastic.v3" 9 | ) 10 | 11 | type JsonElasticSearch3Output struct { 12 | OGWriter 13 | client *elastic.Client 14 | index string 15 | } 16 | 17 | func (fw *JsonElasticSearch3Output) Open(params string) { 18 | param_split := strings.Split(params, ":") 19 | if len(param_split) != 4 { 20 | panic("Wrong parameter specification for JsonOverElasticSearch - did you supply it in the format \"protocol:host:port:index\"?") 21 | } 22 | protocol := param_split[0] 23 | host := param_split[1] 24 | port := param_split[2] 25 | index := param_split[3] 26 | 27 | fw.index = index 28 | 29 | client, err := elastic.NewClient(elastic.SetURL(protocol+"://"+host+":"+port), elastic.SetSniff(false)) 30 | if err != nil { 31 | log.Fatal(err, ". Did you use the right version of ElasticSearch? I am expecting version 3.") 32 | } 33 | fw.client = client 34 | } 35 | 36 | func (fw *JsonElasticSearch3Output) PersistJobStart(job_start *OGRT.JobStart) { 37 | } 38 | 39 | func (fw *JsonElasticSearch3Output) PersistJobEnd(job_end *OGRT.JobEnd) { 40 | } 41 | 42 | func (fw *JsonElasticSearch3Output) PersistProcessInfo(process_info *OGRT.ProcessInfo) { 43 | // set time to milliseconds 44 | *process_info.Time = *process_info.Time * int64(1000) 45 | _, err := fw.client.Index().Index(fw.index).Type("process").BodyJson(process_info).Do() 46 | if err != nil { 47 | log.Println("Could not index JSON in ElasticSearch: ", err) 48 | } 49 | } 50 | 51 | func (fw *JsonElasticSearch3Output) Close() { 52 | } 53 | -------------------------------------------------------------------------------- /server/src/output/json_file.go: -------------------------------------------------------------------------------- 1 | package output 2 | 3 | import ( 4 | "encoding/json" 5 | "github.com/georg-rath/ogrt/src/protocol" 6 | "io/ioutil" 7 | "log" 8 | "os" 9 | "path" 10 | "sync" 11 | ) 12 | 13 | type JsonFileOutput struct { 14 | OGWriter 15 | path string 16 | mu sync.Mutex 17 | } 18 | 19 | func (fw *JsonFileOutput) Open(params string) { 20 | if len(params) == 0 { 21 | log.Panic("Please specify an output path for the JsonFile output") 22 | } 23 | fw.path = params 24 | if _, err := os.Stat(fw.path); err != nil { 25 | if os.IsNotExist(err) { 26 | os.Mkdir(fw.path, 0700) 27 | } else { 28 | log.Panic(err) 29 | } 30 | } 31 | } 32 | 33 | func (fw *JsonFileOutput) PersistJobStart(job_start *OGRT.JobStart) { 34 | } 35 | 36 | func (fw *JsonFileOutput) PersistJobEnd(job_end *OGRT.JobEnd) { 37 | } 38 | 39 | func (fw *JsonFileOutput) PersistProcessInfo(process_info *OGRT.ProcessInfo) { 40 | filepath := path.Join(fw.path, process_info.GetJobId()) 41 | var job_info OGRT.JobInfo 42 | fw.mu.Lock() 43 | json_bytes, err := ioutil.ReadFile(filepath) 44 | if err == nil { 45 | err = json.Unmarshal(json_bytes, &job_info) 46 | if err != nil { 47 | log.Panic(err) 48 | } 49 | } else { 50 | jid := process_info.GetJobId() 51 | job_info.JobId = &jid 52 | } 53 | job_info.Processes = append(job_info.Processes, process_info) 54 | 55 | b, err := json.Marshal(job_info) 56 | if err != nil { 57 | log.Panic(err) 58 | } 59 | 60 | file, err := os.Create(filepath) 61 | if _, err := file.Write(b); err != nil { 62 | log.Panic(err) 63 | } 64 | file.Close() 65 | fw.mu.Unlock() 66 | } 67 | 68 | func (fw *JsonFileOutput) Close() { 69 | } 70 | -------------------------------------------------------------------------------- /server/src/output/json_over_tcp.go: -------------------------------------------------------------------------------- 1 | package output 2 | 3 | import ( 4 | "encoding/json" 5 | "github.com/georg-rath/ogrt/src/protocol" 6 | "log" 7 | "net" 8 | "strings" 9 | ) 10 | 11 | type JsonOverTcpOutput struct { 12 | OGWriter 13 | encoder *json.Encoder 14 | } 15 | 16 | func (fw *JsonOverTcpOutput) Open(params string) { 17 | param_split := strings.Split(params, ":") 18 | if len(param_split) != 3 { 19 | panic("Wrong parameter specification for JsonOverTcp - did you supply it in the format \"protocol:host:port\"?") 20 | } 21 | 22 | protocol := param_split[0] 23 | host := param_split[1] 24 | port := param_split[2] 25 | 26 | connex, err := net.Dial(protocol, host+":"+port) 27 | if err != nil { 28 | log.Fatal(err) 29 | } 30 | fw.encoder = json.NewEncoder(connex) 31 | } 32 | 33 | func (fw *JsonOverTcpOutput) PersistJobStart(job_start *OGRT.JobStart) { 34 | } 35 | 36 | func (fw *JsonOverTcpOutput) PersistJobEnd(job_end *OGRT.JobEnd) { 37 | } 38 | 39 | func (fw *JsonOverTcpOutput) PersistProcessInfo(process_info *OGRT.ProcessInfo) { 40 | err := fw.encoder.Encode(process_info) 41 | if err != nil { 42 | log.Println("Could not send JSON over TCP: ", err) 43 | } 44 | } 45 | 46 | func (fw *JsonOverTcpOutput) Close() { 47 | } 48 | -------------------------------------------------------------------------------- /server/src/output/null.go: -------------------------------------------------------------------------------- 1 | package output 2 | 3 | import ( 4 | "github.com/georg-rath/ogrt/src/protocol" 5 | ) 6 | 7 | type NullOutput struct { 8 | OGWriter 9 | } 10 | 11 | func (fw *NullOutput) Open(params string) { 12 | } 13 | 14 | func (fw *NullOutput) PersistJobStart(job_start *OGRT.JobStart) { 15 | } 16 | 17 | func (fw *NullOutput) PersistJobEnd(job_end *OGRT.JobEnd) { 18 | } 19 | 20 | func (fw *NullOutput) PersistProcessInfo(process_info *OGRT.ProcessInfo) { 21 | } 22 | 23 | func (fw *NullOutput) Close() { 24 | } 25 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/github.com/BurntSushi/toml/cmd/tomlv/main.go: -------------------------------------------------------------------------------- 1 | // Command tomlv validates TOML documents and prints each key's type. 2 | package main 3 | 4 | import ( 5 | "flag" 6 | "fmt" 7 | "log" 8 | "os" 9 | "path" 10 | "strings" 11 | "text/tabwriter" 12 | 13 | "github.com/BurntSushi/toml" 14 | ) 15 | 16 | var ( 17 | flagTypes = false 18 | ) 19 | 20 | func init() { 21 | log.SetFlags(0) 22 | 23 | flag.BoolVar(&flagTypes, "types", flagTypes, 24 | "When set, the types of every defined key will be shown.") 25 | 26 | flag.Usage = usage 27 | flag.Parse() 28 | } 29 | 30 | func usage() { 31 | log.Printf("Usage: %s toml-file [ toml-file ... ]\n", 32 | path.Base(os.Args[0])) 33 | flag.PrintDefaults() 34 | 35 | os.Exit(1) 36 | } 37 | 38 | func main() { 39 | if flag.NArg() < 1 { 40 | flag.Usage() 41 | } 42 | for _, f := range flag.Args() { 43 | var tmp interface{} 44 | md, err := toml.DecodeFile(f, &tmp) 45 | if err != nil { 46 | log.Fatalf("Error in '%s': %s", f, err) 47 | } 48 | if flagTypes { 49 | printTypes(md) 50 | } 51 | } 52 | } 53 | 54 | func printTypes(md toml.MetaData) { 55 | tabw := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0) 56 | for _, key := range md.Keys() { 57 | fmt.Fprintf(tabw, "%s%s\t%s\n", 58 | strings.Repeat(" ", len(key)-1), key, md.Type(key...)) 59 | } 60 | tabw.Flush() 61 | } 62 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/github.com/dustin/go-broadcast/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Dustin Sallings 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 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Manuel Martínez-Almeida 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 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/binding/default_validator.go: -------------------------------------------------------------------------------- 1 | package binding 2 | 3 | import ( 4 | "reflect" 5 | "sync" 6 | 7 | "gopkg.in/go-playground/validator.v8" 8 | ) 9 | 10 | type defaultValidator struct { 11 | once sync.Once 12 | validate *validator.Validate 13 | } 14 | 15 | var _ StructValidator = &defaultValidator{} 16 | 17 | func (v *defaultValidator) ValidateStruct(obj interface{}) error { 18 | if kindOfData(obj) == reflect.Struct { 19 | v.lazyinit() 20 | if err := v.validate.Struct(obj); err != nil { 21 | return error(err) 22 | } 23 | } 24 | return nil 25 | } 26 | 27 | func (v *defaultValidator) lazyinit() { 28 | v.once.Do(func() { 29 | config := &validator.Config{TagName: "binding"} 30 | v.validate = validator.New(config) 31 | }) 32 | } 33 | 34 | func kindOfData(data interface{}) reflect.Kind { 35 | value := reflect.ValueOf(data) 36 | valueType := value.Kind() 37 | if valueType == reflect.Ptr { 38 | valueType = value.Elem().Kind() 39 | } 40 | return valueType 41 | } 42 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/binding/form.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import "net/http" 8 | 9 | type formBinding struct{} 10 | type formPostBinding struct{} 11 | type formMultipartBinding struct{} 12 | 13 | func (formBinding) Name() string { 14 | return "form" 15 | } 16 | 17 | func (formBinding) Bind(req *http.Request, obj interface{}) error { 18 | if err := req.ParseForm(); err != nil { 19 | return err 20 | } 21 | req.ParseMultipartForm(32 << 10) // 32 MB 22 | if err := mapForm(obj, req.Form); err != nil { 23 | return err 24 | } 25 | return validate(obj) 26 | } 27 | 28 | func (formPostBinding) Name() string { 29 | return "form-urlencoded" 30 | } 31 | 32 | func (formPostBinding) Bind(req *http.Request, obj interface{}) error { 33 | if err := req.ParseForm(); err != nil { 34 | return err 35 | } 36 | if err := mapForm(obj, req.PostForm); err != nil { 37 | return err 38 | } 39 | return validate(obj) 40 | } 41 | 42 | func (formMultipartBinding) Name() string { 43 | return "multipart/form-data" 44 | } 45 | 46 | func (formMultipartBinding) Bind(req *http.Request, obj interface{}) error { 47 | if err := req.ParseMultipartForm(32 << 10); err != nil { 48 | return err 49 | } 50 | if err := mapForm(obj, req.MultipartForm.Value); err != nil { 51 | return err 52 | } 53 | return validate(obj) 54 | } 55 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/binding/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "encoding/json" 9 | 10 | "net/http" 11 | ) 12 | 13 | type jsonBinding struct{} 14 | 15 | func (jsonBinding) Name() string { 16 | return "json" 17 | } 18 | 19 | func (jsonBinding) Bind(req *http.Request, obj interface{}) error { 20 | decoder := json.NewDecoder(req.Body) 21 | if err := decoder.Decode(obj); err != nil { 22 | return err 23 | } 24 | return validate(obj) 25 | } 26 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/binding/protobuf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "github.com/golang/protobuf/proto" 9 | 10 | "io/ioutil" 11 | "net/http" 12 | ) 13 | 14 | type protobufBinding struct{} 15 | 16 | func (protobufBinding) Name() string { 17 | return "protobuf" 18 | } 19 | 20 | func (protobufBinding) Bind(req *http.Request, obj interface{}) error { 21 | 22 | buf, err := ioutil.ReadAll(req.Body) 23 | if err != nil { 24 | return err 25 | } 26 | 27 | if err = proto.Unmarshal(buf, obj.(proto.Message)); err != nil { 28 | return err 29 | } 30 | 31 | //Here it's same to return validate(obj), but util now we cann't add `binding:""` to the struct 32 | //which automatically generate by gen-proto 33 | return nil 34 | //return validate(obj) 35 | } 36 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/binding/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "encoding/xml" 9 | "net/http" 10 | ) 11 | 12 | type xmlBinding struct{} 13 | 14 | func (xmlBinding) Name() string { 15 | return "xml" 16 | } 17 | 18 | func (xmlBinding) Bind(req *http.Request, obj interface{}) error { 19 | decoder := xml.NewDecoder(req.Body) 20 | if err := decoder.Decode(obj); err != nil { 21 | return err 22 | } 23 | return validate(obj) 24 | } 25 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/deprecated.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import "log" 8 | 9 | func (c *Context) GetCookie(name string) (string, error) { 10 | log.Println("GetCookie() method is deprecated. Use Cookie() instead.") 11 | return c.Cookie(name) 12 | } 13 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/examples/app-engine/hello.go: -------------------------------------------------------------------------------- 1 | package hello 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | "net/http" 6 | ) 7 | 8 | // This function's name is a must. App Engine uses it to drive the requests properly. 9 | func init() { 10 | // Starts a new Gin instance with no middle-ware 11 | r := gin.New() 12 | 13 | // Define your handlers 14 | r.GET("/", func(c *gin.Context) { 15 | c.String(200, "Hello World!") 16 | }) 17 | r.GET("/ping", func(c *gin.Context) { 18 | c.String(200, "pong") 19 | }) 20 | 21 | // Handle all requests using net/http 22 | http.Handle("/", r) 23 | } 24 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/examples/basic/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | ) 6 | 7 | var DB = make(map[string]string) 8 | 9 | func main() { 10 | r := gin.Default() 11 | 12 | // Ping test 13 | r.GET("/ping", func(c *gin.Context) { 14 | c.String(200, "pong") 15 | }) 16 | 17 | // Get user value 18 | r.GET("/user/:name", func(c *gin.Context) { 19 | user := c.Params.ByName("name") 20 | value, ok := DB[user] 21 | if ok { 22 | c.JSON(200, gin.H{"user": user, "value": value}) 23 | } else { 24 | c.JSON(200, gin.H{"user": user, "status": "no value"}) 25 | } 26 | }) 27 | 28 | // Authorized group (uses gin.BasicAuth() middleware) 29 | // Same than: 30 | // authorized := r.Group("/") 31 | // authorized.Use(gin.BasicAuth(gin.Credentials{ 32 | // "foo": "bar", 33 | // "manu": "123", 34 | //})) 35 | authorized := r.Group("/", gin.BasicAuth(gin.Accounts{ 36 | "foo": "bar", // user:foo password:bar 37 | "manu": "123", // user:manu password:123 38 | })) 39 | 40 | authorized.POST("admin", func(c *gin.Context) { 41 | user := c.MustGet(gin.AuthUserKey).(string) 42 | 43 | // Parse JSON 44 | var json struct { 45 | Value string `json:"value" binding:"required"` 46 | } 47 | 48 | if c.Bind(&json) == nil { 49 | DB[user] = json.Value 50 | c.JSON(200, gin.H{"status": "ok"}) 51 | } 52 | }) 53 | 54 | // Listen and Server in 0.0.0.0:8080 55 | r.Run(":8080") 56 | } 57 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/examples/realtime-advanced/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | 7 | "github.com/gin-gonic/gin" 8 | ) 9 | 10 | func main() { 11 | ConfigRuntime() 12 | StartWorkers() 13 | StartGin() 14 | } 15 | 16 | func ConfigRuntime() { 17 | nuCPU := runtime.NumCPU() 18 | runtime.GOMAXPROCS(nuCPU) 19 | fmt.Printf("Running with %d CPUs\n", nuCPU) 20 | } 21 | 22 | func StartWorkers() { 23 | go statsWorker() 24 | } 25 | 26 | func StartGin() { 27 | gin.SetMode(gin.ReleaseMode) 28 | 29 | router := gin.New() 30 | router.Use(rateLimit, gin.Recovery()) 31 | router.LoadHTMLGlob("resources/*.templ.html") 32 | router.Static("/static", "resources/static") 33 | router.GET("/", index) 34 | router.GET("/room/:roomid", roomGET) 35 | router.POST("/room-post/:roomid", roomPOST) 36 | router.GET("/stream/:roomid", streamRoom) 37 | 38 | router.Run(":80") 39 | } 40 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/examples/realtime-advanced/rooms.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/dustin/go-broadcast" 4 | 5 | var roomChannels = make(map[string]broadcast.Broadcaster) 6 | 7 | func openListener(roomid string) chan interface{} { 8 | listener := make(chan interface{}) 9 | room(roomid).Register(listener) 10 | return listener 11 | } 12 | 13 | func closeListener(roomid string, listener chan interface{}) { 14 | room(roomid).Unregister(listener) 15 | close(listener) 16 | } 17 | 18 | func room(roomid string) broadcast.Broadcaster { 19 | b, ok := roomChannels[roomid] 20 | if !ok { 21 | b = broadcast.NewBroadcaster(10) 22 | roomChannels[roomid] = b 23 | } 24 | return b 25 | } 26 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/examples/realtime-advanced/stats.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "runtime" 5 | "sync" 6 | "time" 7 | 8 | "github.com/manucorporat/stats" 9 | ) 10 | 11 | var ips = stats.New() 12 | var messages = stats.New() 13 | var users = stats.New() 14 | var mutexStats sync.RWMutex 15 | var savedStats map[string]uint64 16 | 17 | func statsWorker() { 18 | c := time.Tick(1 * time.Second) 19 | var lastMallocs uint64 20 | var lastFrees uint64 21 | for range c { 22 | var stats runtime.MemStats 23 | runtime.ReadMemStats(&stats) 24 | 25 | mutexStats.Lock() 26 | savedStats = map[string]uint64{ 27 | "timestamp": uint64(time.Now().Unix()), 28 | "HeapInuse": stats.HeapInuse, 29 | "StackInuse": stats.StackInuse, 30 | "Mallocs": (stats.Mallocs - lastMallocs), 31 | "Frees": (stats.Frees - lastFrees), 32 | "Inbound": uint64(messages.Get("inbound")), 33 | "Outbound": uint64(messages.Get("outbound")), 34 | "Connected": connectedUsers(), 35 | } 36 | lastMallocs = stats.Mallocs 37 | lastFrees = stats.Frees 38 | messages.Reset() 39 | mutexStats.Unlock() 40 | } 41 | } 42 | 43 | func connectedUsers() uint64 { 44 | connected := users.Get("connected") - users.Get("disconnected") 45 | if connected < 0 { 46 | return 0 47 | } 48 | return uint64(connected) 49 | } 50 | 51 | func Stats() map[string]uint64 { 52 | mutexStats.RLock() 53 | defer mutexStats.RUnlock() 54 | 55 | return savedStats 56 | } 57 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/examples/realtime-chat/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "math/rand" 7 | 8 | "github.com/gin-gonic/gin" 9 | ) 10 | 11 | func main() { 12 | router := gin.Default() 13 | router.SetHTMLTemplate(html) 14 | 15 | router.GET("/room/:roomid", roomGET) 16 | router.POST("/room/:roomid", roomPOST) 17 | router.DELETE("/room/:roomid", roomDELETE) 18 | router.GET("/stream/:roomid", stream) 19 | 20 | router.Run(":8080") 21 | } 22 | 23 | func stream(c *gin.Context) { 24 | roomid := c.Param("roomid") 25 | listener := openListener(roomid) 26 | defer closeListener(roomid, listener) 27 | 28 | c.Stream(func(w io.Writer) bool { 29 | c.SSEvent("message", <-listener) 30 | return true 31 | }) 32 | } 33 | 34 | func roomGET(c *gin.Context) { 35 | roomid := c.Param("roomid") 36 | userid := fmt.Sprint(rand.Int31()) 37 | c.HTML(200, "chat_room", gin.H{ 38 | "roomid": roomid, 39 | "userid": userid, 40 | }) 41 | } 42 | 43 | func roomPOST(c *gin.Context) { 44 | roomid := c.Param("roomid") 45 | userid := c.PostForm("user") 46 | message := c.PostForm("message") 47 | room(roomid).Submit(userid + ": " + message) 48 | 49 | c.JSON(200, gin.H{ 50 | "status": "success", 51 | "message": message, 52 | }) 53 | } 54 | 55 | func roomDELETE(c *gin.Context) { 56 | roomid := c.Param("roomid") 57 | deleteBroadcast(roomid) 58 | } 59 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/examples/realtime-chat/rooms.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/dustin/go-broadcast" 4 | 5 | var roomChannels = make(map[string]broadcast.Broadcaster) 6 | 7 | func openListener(roomid string) chan interface{} { 8 | listener := make(chan interface{}) 9 | room(roomid).Register(listener) 10 | return listener 11 | } 12 | 13 | func closeListener(roomid string, listener chan interface{}) { 14 | room(roomid).Unregister(listener) 15 | close(listener) 16 | } 17 | 18 | func deleteBroadcast(roomid string) { 19 | b, ok := roomChannels[roomid] 20 | if ok { 21 | b.Close() 22 | delete(roomChannels, roomid) 23 | } 24 | } 25 | 26 | func room(roomid string) broadcast.Broadcaster { 27 | b, ok := roomChannels[roomid] 28 | if !ok { 29 | b = broadcast.NewBroadcaster(10) 30 | roomChannels[roomid] = b 31 | } 32 | return b 33 | } 34 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/examples/realtime-chat/template.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "html/template" 4 | 5 | var html = template.Must(template.New("chat_room").Parse(` 6 | 7 | 8 | {{.roomid}} 9 | 10 | 11 | 12 | 33 | 34 | 35 |

Welcome to {{.roomid}} room

36 |
37 |
38 | User: 39 | Message: 40 | 41 |
42 | 43 | 44 | `)) 45 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/fs.go: -------------------------------------------------------------------------------- 1 | package gin 2 | 3 | import ( 4 | "net/http" 5 | "os" 6 | ) 7 | 8 | type ( 9 | onlyfilesFS struct { 10 | fs http.FileSystem 11 | } 12 | neuteredReaddirFile struct { 13 | http.File 14 | } 15 | ) 16 | 17 | // Dir returns a http.Filesystem that can be used by http.FileServer(). It is used interally 18 | // in router.Static(). 19 | // if listDirectory == true, then it works the same as http.Dir() otherwise it returns 20 | // a filesystem that prevents http.FileServer() to list the directory files. 21 | func Dir(root string, listDirectory bool) http.FileSystem { 22 | fs := http.Dir(root) 23 | if listDirectory { 24 | return fs 25 | } 26 | return &onlyfilesFS{fs} 27 | } 28 | 29 | // Conforms to http.Filesystem 30 | func (fs onlyfilesFS) Open(name string) (http.File, error) { 31 | f, err := fs.fs.Open(name) 32 | if err != nil { 33 | return nil, err 34 | } 35 | return neuteredReaddirFile{f}, nil 36 | } 37 | 38 | // Overrides the http.File default implementation 39 | func (f neuteredReaddirFile) Readdir(count int) ([]os.FileInfo, error) { 40 | // this disables directory listing 41 | return nil, nil 42 | } 43 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/mode.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "io" 9 | "os" 10 | 11 | "github.com/gin-gonic/gin/binding" 12 | ) 13 | 14 | const ENV_GIN_MODE = "GIN_MODE" 15 | 16 | const ( 17 | DebugMode string = "debug" 18 | ReleaseMode string = "release" 19 | TestMode string = "test" 20 | ) 21 | const ( 22 | debugCode = iota 23 | releaseCode 24 | testCode 25 | ) 26 | 27 | // DefaultWriter is the default io.Writer used the Gin for debug output and 28 | // middleware output like Logger() or Recovery(). 29 | // Note that both Logger and Recovery provides custom ways to configure their 30 | // output io.Writer. 31 | // To support coloring in Windows use: 32 | // import "github.com/mattn/go-colorable" 33 | // gin.DefaultWriter = colorable.NewColorableStdout() 34 | var DefaultWriter io.Writer = os.Stdout 35 | var DefaultErrorWriter io.Writer = os.Stderr 36 | 37 | var ginMode = debugCode 38 | var modeName = DebugMode 39 | 40 | func init() { 41 | mode := os.Getenv(ENV_GIN_MODE) 42 | if len(mode) == 0 { 43 | SetMode(DebugMode) 44 | } else { 45 | SetMode(mode) 46 | } 47 | } 48 | 49 | func SetMode(value string) { 50 | switch value { 51 | case DebugMode: 52 | ginMode = debugCode 53 | case ReleaseMode: 54 | ginMode = releaseCode 55 | case TestMode: 56 | ginMode = testCode 57 | default: 58 | panic("gin mode unknown: " + value) 59 | } 60 | modeName = value 61 | } 62 | 63 | func DisableBindValidation() { 64 | binding.Validator = nil 65 | } 66 | 67 | func Mode() string { 68 | return modeName 69 | } 70 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/render/data.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | type Data struct { 10 | ContentType string 11 | Data []byte 12 | } 13 | 14 | func (r Data) Render(w http.ResponseWriter) error { 15 | if len(r.ContentType) > 0 { 16 | w.Header()["Content-Type"] = []string{r.ContentType} 17 | } 18 | w.Write(r.Data) 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/render/html.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "html/template" 9 | "net/http" 10 | ) 11 | 12 | type ( 13 | HTMLRender interface { 14 | Instance(string, interface{}) Render 15 | } 16 | 17 | HTMLProduction struct { 18 | Template *template.Template 19 | } 20 | 21 | HTMLDebug struct { 22 | Files []string 23 | Glob string 24 | } 25 | 26 | HTML struct { 27 | Template *template.Template 28 | Name string 29 | Data interface{} 30 | } 31 | ) 32 | 33 | var htmlContentType = []string{"text/html; charset=utf-8"} 34 | 35 | func (r HTMLProduction) Instance(name string, data interface{}) Render { 36 | return HTML{ 37 | Template: r.Template, 38 | Name: name, 39 | Data: data, 40 | } 41 | } 42 | 43 | func (r HTMLDebug) Instance(name string, data interface{}) Render { 44 | return HTML{ 45 | Template: r.loadTemplate(), 46 | Name: name, 47 | Data: data, 48 | } 49 | } 50 | func (r HTMLDebug) loadTemplate() *template.Template { 51 | if len(r.Files) > 0 { 52 | return template.Must(template.ParseFiles(r.Files...)) 53 | } 54 | if len(r.Glob) > 0 { 55 | return template.Must(template.ParseGlob(r.Glob)) 56 | } 57 | panic("the HTML debug render was created without files or glob pattern") 58 | } 59 | 60 | func (r HTML) Render(w http.ResponseWriter) error { 61 | writeContentType(w, htmlContentType) 62 | if len(r.Name) == 0 { 63 | return r.Template.Execute(w, r.Data) 64 | } 65 | return r.Template.ExecuteTemplate(w, r.Name, r.Data) 66 | } 67 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/render/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "encoding/json" 9 | "net/http" 10 | ) 11 | 12 | type ( 13 | JSON struct { 14 | Data interface{} 15 | } 16 | 17 | IndentedJSON struct { 18 | Data interface{} 19 | } 20 | ) 21 | 22 | var jsonContentType = []string{"application/json; charset=utf-8"} 23 | 24 | func (r JSON) Render(w http.ResponseWriter) error { 25 | return WriteJSON(w, r.Data) 26 | } 27 | 28 | func (r IndentedJSON) Render(w http.ResponseWriter) error { 29 | writeContentType(w, jsonContentType) 30 | jsonBytes, err := json.MarshalIndent(r.Data, "", " ") 31 | if err != nil { 32 | return err 33 | } 34 | w.Write(jsonBytes) 35 | return nil 36 | } 37 | 38 | func WriteJSON(w http.ResponseWriter, obj interface{}) error { 39 | writeContentType(w, jsonContentType) 40 | return json.NewEncoder(w).Encode(obj) 41 | } 42 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/render/redirect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "net/http" 10 | ) 11 | 12 | type Redirect struct { 13 | Code int 14 | Request *http.Request 15 | Location string 16 | } 17 | 18 | func (r Redirect) Render(w http.ResponseWriter) error { 19 | if (r.Code < 300 || r.Code > 308) && r.Code != 201 { 20 | panic(fmt.Sprintf("Cannot redirect with status code %d", r.Code)) 21 | } 22 | http.Redirect(w, r.Request, r.Location, r.Code) 23 | return nil 24 | } 25 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/render/render.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | type Render interface { 10 | Render(http.ResponseWriter) error 11 | } 12 | 13 | var ( 14 | _ Render = JSON{} 15 | _ Render = IndentedJSON{} 16 | _ Render = XML{} 17 | _ Render = String{} 18 | _ Render = Redirect{} 19 | _ Render = Data{} 20 | _ Render = HTML{} 21 | _ HTMLRender = HTMLDebug{} 22 | _ HTMLRender = HTMLProduction{} 23 | _ Render = YAML{} 24 | ) 25 | 26 | func writeContentType(w http.ResponseWriter, value []string) { 27 | header := w.Header() 28 | if val := header["Content-Type"]; len(val) == 0 { 29 | header["Content-Type"] = value 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/render/text.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | "net/http" 11 | ) 12 | 13 | type String struct { 14 | Format string 15 | Data []interface{} 16 | } 17 | 18 | var plainContentType = []string{"text/plain; charset=utf-8"} 19 | 20 | func (r String) Render(w http.ResponseWriter) error { 21 | WriteString(w, r.Format, r.Data) 22 | return nil 23 | } 24 | 25 | func WriteString(w http.ResponseWriter, format string, data []interface{}) { 26 | writeContentType(w, plainContentType) 27 | 28 | if len(data) > 0 { 29 | fmt.Fprintf(w, format, data...) 30 | } else { 31 | io.WriteString(w, format) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/render/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "encoding/xml" 9 | "net/http" 10 | ) 11 | 12 | type XML struct { 13 | Data interface{} 14 | } 15 | 16 | var xmlContentType = []string{"application/xml; charset=utf-8"} 17 | 18 | func (r XML) Render(w http.ResponseWriter) error { 19 | writeContentType(w, xmlContentType) 20 | return xml.NewEncoder(w).Encode(r.Data) 21 | } 22 | -------------------------------------------------------------------------------- /server/vendor/github.com/gin-gonic/gin/render/yaml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "gopkg.in/yaml.v2" 11 | ) 12 | 13 | type YAML struct { 14 | Data interface{} 15 | } 16 | 17 | var yamlContentType = []string{"application/x-yaml; charset=utf-8"} 18 | 19 | func (r YAML) Render(w http.ResponseWriter) error { 20 | writeContentType(w, yamlContentType) 21 | 22 | bytes, err := yaml.Marshal(r.Data) 23 | if err != nil { 24 | return err 25 | } 26 | 27 | w.Write(bytes) 28 | return nil 29 | } 30 | -------------------------------------------------------------------------------- /server/vendor/github.com/golang/protobuf/proto/LICENSE: -------------------------------------------------------------------------------- 1 | Go support for Protocol Buffers - Google's data interchange format 2 | 3 | Copyright 2010 The Go Authors. All rights reserved. 4 | https://github.com/golang/protobuf 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following disclaimer 14 | in the documentation and/or other materials provided with the 15 | distribution. 16 | * Neither the name of Google Inc. nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /server/vendor/github.com/golang/protobuf/ptypes/any/LICENSE: -------------------------------------------------------------------------------- 1 | Go support for Protocol Buffers - Google's data interchange format 2 | 3 | Copyright 2010 The Go Authors. All rights reserved. 4 | https://github.com/golang/protobuf 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are 8 | met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following disclaimer 14 | in the documentation and/or other materials provided with the 15 | distribution. 16 | * Neither the name of Google Inc. nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /server/vendor/github.com/influxdata/influxdb/client/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2016 Errplane Inc. 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 | -------------------------------------------------------------------------------- /server/vendor/github.com/influxdata/influxdb/models/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2016 Errplane Inc. 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 | -------------------------------------------------------------------------------- /server/vendor/github.com/influxdata/influxdb/models/consistency.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "errors" 5 | "strings" 6 | ) 7 | 8 | // ConsistencyLevel represent a required replication criteria before a write can 9 | // be returned as successful. 10 | // 11 | // The consistency level is handled in open-source InfluxDB but only applicable to clusters. 12 | type ConsistencyLevel int 13 | 14 | const ( 15 | // ConsistencyLevelAny allows for hinted handoff, potentially no write happened yet. 16 | ConsistencyLevelAny ConsistencyLevel = iota 17 | 18 | // ConsistencyLevelOne requires at least one data node acknowledged a write. 19 | ConsistencyLevelOne 20 | 21 | // ConsistencyLevelQuorum requires a quorum of data nodes to acknowledge a write. 22 | ConsistencyLevelQuorum 23 | 24 | // ConsistencyLevelAll requires all data nodes to acknowledge a write. 25 | ConsistencyLevelAll 26 | ) 27 | 28 | var ( 29 | // ErrInvalidConsistencyLevel is returned when parsing the string version 30 | // of a consistency level. 31 | ErrInvalidConsistencyLevel = errors.New("invalid consistency level") 32 | ) 33 | 34 | // ParseConsistencyLevel converts a consistency level string to the corresponding ConsistencyLevel const. 35 | func ParseConsistencyLevel(level string) (ConsistencyLevel, error) { 36 | switch strings.ToLower(level) { 37 | case "any": 38 | return ConsistencyLevelAny, nil 39 | case "one": 40 | return ConsistencyLevelOne, nil 41 | case "quorum": 42 | return ConsistencyLevelQuorum, nil 43 | case "all": 44 | return ConsistencyLevelAll, nil 45 | default: 46 | return 0, ErrInvalidConsistencyLevel 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /server/vendor/github.com/influxdata/influxdb/models/inline_fnv.go: -------------------------------------------------------------------------------- 1 | package models // import "github.com/influxdata/influxdb/models" 2 | 3 | // from stdlib hash/fnv/fnv.go 4 | const ( 5 | prime64 = 1099511628211 6 | offset64 = 14695981039346656037 7 | ) 8 | 9 | // InlineFNV64a is an alloc-free port of the standard library's fnv64a. 10 | // See https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function. 11 | type InlineFNV64a uint64 12 | 13 | // NewInlineFNV64a returns a new instance of InlineFNV64a. 14 | func NewInlineFNV64a() InlineFNV64a { 15 | return offset64 16 | } 17 | 18 | // Write adds data to the running hash. 19 | func (s *InlineFNV64a) Write(data []byte) (int, error) { 20 | hash := uint64(*s) 21 | for _, c := range data { 22 | hash ^= uint64(c) 23 | hash *= prime64 24 | } 25 | *s = InlineFNV64a(hash) 26 | return len(data), nil 27 | } 28 | 29 | // Sum64 returns the uint64 of the current resulting hash. 30 | func (s *InlineFNV64a) Sum64() uint64 { 31 | return uint64(*s) 32 | } 33 | -------------------------------------------------------------------------------- /server/vendor/github.com/influxdata/influxdb/models/inline_strconv_parse.go: -------------------------------------------------------------------------------- 1 | package models // import "github.com/influxdata/influxdb/models" 2 | 3 | import ( 4 | "reflect" 5 | "strconv" 6 | "unsafe" 7 | ) 8 | 9 | // parseIntBytes is a zero-alloc wrapper around strconv.ParseInt. 10 | func parseIntBytes(b []byte, base int, bitSize int) (i int64, err error) { 11 | s := unsafeBytesToString(b) 12 | return strconv.ParseInt(s, base, bitSize) 13 | } 14 | 15 | // parseFloatBytes is a zero-alloc wrapper around strconv.ParseFloat. 16 | func parseFloatBytes(b []byte, bitSize int) (float64, error) { 17 | s := unsafeBytesToString(b) 18 | return strconv.ParseFloat(s, bitSize) 19 | } 20 | 21 | // parseBoolBytes is a zero-alloc wrapper around strconv.ParseBool. 22 | func parseBoolBytes(b []byte) (bool, error) { 23 | return strconv.ParseBool(unsafeBytesToString(b)) 24 | } 25 | 26 | // unsafeBytesToString converts a []byte to a string without a heap allocation. 27 | // 28 | // It is unsafe, and is intended to prepare input to short-lived functions 29 | // that require strings. 30 | func unsafeBytesToString(in []byte) string { 31 | src := *(*reflect.SliceHeader)(unsafe.Pointer(&in)) 32 | dst := reflect.StringHeader{ 33 | Data: src.Data, 34 | Len: src.Len, 35 | } 36 | s := *(*string)(unsafe.Pointer(&dst)) 37 | return s 38 | } 39 | -------------------------------------------------------------------------------- /server/vendor/github.com/influxdata/influxdb/models/statistic.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | // Statistic is the representation of a statistic used by the monitoring service. 4 | type Statistic struct { 5 | Name string `json:"name"` 6 | Tags map[string]string `json:"tags"` 7 | Values map[string]interface{} `json:"values"` 8 | } 9 | 10 | // NewStatistic returns an initialized Statistic. 11 | func NewStatistic(name string) Statistic { 12 | return Statistic{ 13 | Name: name, 14 | Tags: make(map[string]string), 15 | Values: make(map[string]interface{}), 16 | } 17 | } 18 | 19 | // StatisticTags is a map that can be merged with others without causing 20 | // mutations to either map. 21 | type StatisticTags map[string]string 22 | 23 | // Merge creates a new map containing the merged contents of tags and t. 24 | // If both tags and the receiver map contain the same key, the value in tags 25 | // is used in the resulting map. 26 | // 27 | // Merge always returns a usable map. 28 | func (t StatisticTags) Merge(tags map[string]string) map[string]string { 29 | // Add everything in tags to the result. 30 | out := make(map[string]string, len(tags)) 31 | for k, v := range tags { 32 | out[k] = v 33 | } 34 | 35 | // Only add values from t that don't appear in tags. 36 | for k, v := range t { 37 | if _, ok := tags[k]; !ok { 38 | out[k] = v 39 | } 40 | } 41 | return out 42 | } 43 | -------------------------------------------------------------------------------- /server/vendor/github.com/influxdata/influxdb/pkg/escape/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013-2016 Errplane Inc. 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 | -------------------------------------------------------------------------------- /server/vendor/github.com/influxdata/influxdb/pkg/escape/strings.go: -------------------------------------------------------------------------------- 1 | package escape 2 | 3 | import "strings" 4 | 5 | var ( 6 | escaper = strings.NewReplacer(`,`, `\,`, `"`, `\"`, ` `, `\ `, `=`, `\=`) 7 | unescaper = strings.NewReplacer(`\,`, `,`, `\"`, `"`, `\ `, ` `, `\=`, `=`) 8 | ) 9 | 10 | // UnescapeString returns unescaped version of in. 11 | func UnescapeString(in string) string { 12 | if strings.IndexByte(in, '\\') == -1 { 13 | return in 14 | } 15 | return unescaper.Replace(in) 16 | } 17 | 18 | // String returns the escaped version of in. 19 | func String(in string) string { 20 | return escaper.Replace(in) 21 | } 22 | -------------------------------------------------------------------------------- /server/vendor/github.com/manucorporat/sse/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Manuel Martínez-Almeida 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 | -------------------------------------------------------------------------------- /server/vendor/github.com/manucorporat/sse/writer.go: -------------------------------------------------------------------------------- 1 | package sse 2 | 3 | import "io" 4 | 5 | type stringWriter interface { 6 | io.Writer 7 | WriteString(string) (int, error) 8 | } 9 | 10 | type stringWrapper struct { 11 | io.Writer 12 | } 13 | 14 | func (w stringWrapper) WriteString(str string) (int, error) { 15 | return w.Writer.Write([]byte(str)) 16 | } 17 | 18 | func checkWriter(writer io.Writer) stringWriter { 19 | if w, ok := writer.(stringWriter); ok { 20 | return w 21 | } else { 22 | return stringWrapper{writer} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /server/vendor/github.com/manucorporat/stats/stats.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "sync" 4 | 5 | type ValueType float64 6 | type StatsType map[string]ValueType 7 | 8 | type StatsCollector struct { 9 | lock sync.RWMutex 10 | stats StatsType 11 | } 12 | 13 | func New() *StatsCollector { 14 | s := new(StatsCollector) 15 | s.Reset() 16 | return s 17 | } 18 | 19 | func (s *StatsCollector) Reset() { 20 | s.lock.Lock() 21 | s.stats = make(StatsType) 22 | s.lock.Unlock() 23 | } 24 | 25 | func (s *StatsCollector) Set(key string, value ValueType) { 26 | s.lock.Lock() 27 | s.stats[key] = value 28 | s.lock.Unlock() 29 | } 30 | 31 | func (s *StatsCollector) Add(key string, delta ValueType) (v ValueType) { 32 | s.lock.Lock() 33 | v = s.stats[key] 34 | v += delta 35 | s.stats[key] = v 36 | s.lock.Unlock() 37 | return 38 | } 39 | 40 | func (s *StatsCollector) Get(key string) (v ValueType) { 41 | s.lock.RLock() 42 | v = s.stats[key] 43 | s.lock.RUnlock() 44 | return 45 | } 46 | 47 | func (s *StatsCollector) Del(key string) { 48 | s.lock.Lock() 49 | delete(s.stats, key) 50 | s.lock.Unlock() 51 | } 52 | 53 | func (s *StatsCollector) Data() StatsType { 54 | cp := make(StatsType) 55 | s.lock.RLock() 56 | for key, value := range s.stats { 57 | cp[key] = value 58 | } 59 | s.lock.RUnlock() 60 | return cp 61 | } 62 | 63 | var defaultCollector = New() 64 | 65 | func Reset() { 66 | defaultCollector.Reset() 67 | } 68 | 69 | func Set(key string, value ValueType) { 70 | defaultCollector.Set(key, value) 71 | } 72 | 73 | func Del(key string) { 74 | defaultCollector.Del(key) 75 | } 76 | 77 | func Add(key string, delta ValueType) ValueType { 78 | return defaultCollector.Add(key, delta) 79 | } 80 | 81 | func Get(key string) ValueType { 82 | return defaultCollector.Get(key) 83 | } 84 | 85 | func Data() StatsType { 86 | return defaultCollector.Data() 87 | } 88 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/github.com/pkg/errors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /server/vendor/github.com/rcrowley/go-metrics/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Richard Crowley. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following 12 | disclaimer in the documentation and/or other materials provided 13 | with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY RICHARD CROWLEY ``AS IS'' AND ANY EXPRESS 16 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL RICHARD CROWLEY OR CONTRIBUTORS BE LIABLE 19 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 25 | THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | The views and conclusions contained in the software and documentation 28 | are those of the authors and should not be interpreted as representing 29 | official policies, either expressed or implied, of Richard Crowley. 30 | -------------------------------------------------------------------------------- /server/vendor/github.com/rcrowley/go-metrics/cmd/metrics-bench/metrics-bench.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/rcrowley/go-metrics" 6 | "time" 7 | ) 8 | 9 | func main() { 10 | r := metrics.NewRegistry() 11 | for i := 0; i < 10000; i++ { 12 | r.Register(fmt.Sprintf("counter-%d", i), metrics.NewCounter()) 13 | r.Register(fmt.Sprintf("gauge-%d", i), metrics.NewGauge()) 14 | r.Register(fmt.Sprintf("gaugefloat64-%d", i), metrics.NewGaugeFloat64()) 15 | r.Register(fmt.Sprintf("histogram-uniform-%d", i), metrics.NewHistogram(metrics.NewUniformSample(1028))) 16 | r.Register(fmt.Sprintf("histogram-exp-%d", i), metrics.NewHistogram(metrics.NewExpDecaySample(1028, 0.015))) 17 | r.Register(fmt.Sprintf("meter-%d", i), metrics.NewMeter()) 18 | } 19 | time.Sleep(600e9) 20 | } 21 | -------------------------------------------------------------------------------- /server/vendor/github.com/rcrowley/go-metrics/cmd/never-read/never-read.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "net" 6 | ) 7 | 8 | func main() { 9 | addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:2003") 10 | l, err := net.ListenTCP("tcp", addr) 11 | if nil != err { 12 | log.Fatalln(err) 13 | } 14 | log.Println("listening", l.Addr()) 15 | for { 16 | c, err := l.AcceptTCP() 17 | if nil != err { 18 | log.Fatalln(err) 19 | } 20 | log.Println("accepted", c.RemoteAddr()) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /server/vendor/github.com/rcrowley/go-metrics/healthcheck.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | // Healthchecks hold an error value describing an arbitrary up/down status. 4 | type Healthcheck interface { 5 | Check() 6 | Error() error 7 | Healthy() 8 | Unhealthy(error) 9 | } 10 | 11 | // NewHealthcheck constructs a new Healthcheck which will use the given 12 | // function to update its status. 13 | func NewHealthcheck(f func(Healthcheck)) Healthcheck { 14 | if UseNilMetrics { 15 | return NilHealthcheck{} 16 | } 17 | return &StandardHealthcheck{nil, f} 18 | } 19 | 20 | // NilHealthcheck is a no-op. 21 | type NilHealthcheck struct{} 22 | 23 | // Check is a no-op. 24 | func (NilHealthcheck) Check() {} 25 | 26 | // Error is a no-op. 27 | func (NilHealthcheck) Error() error { return nil } 28 | 29 | // Healthy is a no-op. 30 | func (NilHealthcheck) Healthy() {} 31 | 32 | // Unhealthy is a no-op. 33 | func (NilHealthcheck) Unhealthy(error) {} 34 | 35 | // StandardHealthcheck is the standard implementation of a Healthcheck and 36 | // stores the status and a function to call to update the status. 37 | type StandardHealthcheck struct { 38 | err error 39 | f func(Healthcheck) 40 | } 41 | 42 | // Check runs the healthcheck function to update the healthcheck's status. 43 | func (h *StandardHealthcheck) Check() { 44 | h.f(h) 45 | } 46 | 47 | // Error returns the healthcheck's status, which will be nil if it is healthy. 48 | func (h *StandardHealthcheck) Error() error { 49 | return h.err 50 | } 51 | 52 | // Healthy marks the healthcheck as healthy. 53 | func (h *StandardHealthcheck) Healthy() { 54 | h.err = nil 55 | } 56 | 57 | // Unhealthy marks the healthcheck as unhealthy. The error is stored and 58 | // may be retrieved by the Error method. 59 | func (h *StandardHealthcheck) Unhealthy(err error) { 60 | h.err = err 61 | } 62 | -------------------------------------------------------------------------------- /server/vendor/github.com/rcrowley/go-metrics/metrics.go: -------------------------------------------------------------------------------- 1 | // Go port of Coda Hale's Metrics library 2 | // 3 | // 4 | // 5 | // Coda Hale's original work: 6 | package metrics 7 | 8 | // UseNilMetrics is checked by the constructor functions for all of the 9 | // standard metrics. If it is true, the metric returned is a stub. 10 | // 11 | // This global kill-switch helps quantify the observer effect and makes 12 | // for less cluttered pprof profiles. 13 | var UseNilMetrics bool = false 14 | -------------------------------------------------------------------------------- /server/vendor/github.com/rcrowley/go-metrics/runtime_cgo.go: -------------------------------------------------------------------------------- 1 | // +build cgo 2 | // +build !appengine 3 | 4 | package metrics 5 | 6 | import "runtime" 7 | 8 | func numCgoCall() int64 { 9 | return runtime.NumCgoCall() 10 | } 11 | -------------------------------------------------------------------------------- /server/vendor/github.com/rcrowley/go-metrics/runtime_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return memStats.GCCPUFraction 9 | } 10 | -------------------------------------------------------------------------------- /server/vendor/github.com/rcrowley/go-metrics/runtime_no_cgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo appengine 2 | 3 | package metrics 4 | 5 | func numCgoCall() int64 { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /server/vendor/github.com/rcrowley/go-metrics/runtime_no_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return 0 9 | } 10 | -------------------------------------------------------------------------------- /server/vendor/github.com/stathat/go/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 Numerotron Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /server/vendor/github.com/vrischmann/go-metrics-influxdb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Vincent Rischmann 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 | -------------------------------------------------------------------------------- /server/vendor/github.com/wadey/gocovmerge/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Wade Simmons 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/net/context/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sync/errgroup/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·socketcall(SB),NOSPLIT,$0-36 29 | JMP syscall·socketcall(SB) 30 | 31 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 32 | JMP syscall·rawsocketcall(SB) 33 | 34 | TEXT ·seek(SB),NOSPLIT,$0-28 35 | JMP syscall·seek(SB) 36 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 28 | JMP syscall·RawSyscall(SB) 29 | 30 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 31 | JMP syscall·RawSyscall6(SB) 32 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd openbsd netbsd dragonfly 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 | // +build darwin dragonfly freebsd linux netbsd openbsd 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 14 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 15 | var fcntl64Syscall uintptr = SYS_FCNTL 16 | 17 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 18 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 19 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 20 | if errno == 0 { 21 | return nil 22 | } 23 | return errno 24 | } 25 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/gccgo.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 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // We can't use the gc-syntax .s files for gccgo. On the plus side 12 | // much of the functionality can be written directly in Go. 13 | 14 | //extern gccgoRealSyscall 15 | func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr) 16 | 17 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | syscall.Entersyscall() 19 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 20 | syscall.Exitsyscall() 21 | return r, 0, syscall.Errno(errno) 22 | } 23 | 24 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 25 | syscall.Entersyscall() 26 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 27 | syscall.Exitsyscall() 28 | return r, 0, syscall.Errno(errno) 29 | } 30 | 31 | func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) { 32 | syscall.Entersyscall() 33 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9) 34 | syscall.Exitsyscall() 35 | return r, 0, syscall.Errno(errno) 36 | } 37 | 38 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 39 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 40 | return r, 0, syscall.Errno(errno) 41 | } 42 | 43 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 44 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 45 | return r, 0, syscall.Errno(errno) 46 | } 47 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | // Define the use function in C so that it is not inlined. 35 | 36 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 37 | 38 | void 39 | use(void *p __attribute__ ((unused))) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,sparc64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern sysconf 12 | func realSysconf(name int) int64 13 | 14 | func sysconf(name int) (n int64, err syscall.Errno) { 15 | r := realSysconf(name) 16 | if r < 0 { 17 | return 0, syscall.GetErrno() 18 | } 19 | return r, 0 20 | } 21 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = nsec % 1e9 / 1e3 27 | tv.Sec = int64(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint64(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint64(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int32(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint32(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint32(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = nsec % 1e9 / 1e3 27 | tv.Sec = int64(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint64(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint64(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return ts.Sec*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = nsec / 1e9 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint32(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint32(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int64(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = nsec / 1e9 15 | ts.Nsec = nsec % 1e9 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = nsec % 1e9 / 1e3 22 | tv.Sec = nsec / 1e9 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func NsecToTimeval(nsec int64) (tv Timeval) { 18 | nsec += 999 // round up to microsecond 19 | tv.Usec = nsec % 1e9 / 1e3 20 | tv.Sec = int64(nsec / 1e9) 21 | return 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (cmsg *Cmsghdr) SetLen(length int) { 29 | cmsg.Len = uint32(length) 30 | } 31 | 32 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 33 | // TODO(aram): implement this, see issue 5847. 34 | panic("unimplemented") 35 | } 36 | -------------------------------------------------------------------------------- /server/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 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /server/vendor/golang.org/x/tools/cover/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/go-playground/validator.v8/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dean Karn 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 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/go-playground/validator.v8/examples/custom/custom.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "database/sql" 5 | "database/sql/driver" 6 | "fmt" 7 | "reflect" 8 | 9 | "gopkg.in/go-playground/validator.v8" 10 | ) 11 | 12 | // DbBackedUser User struct 13 | type DbBackedUser struct { 14 | Name sql.NullString `validate:"required"` 15 | Age sql.NullInt64 `validate:"required"` 16 | } 17 | 18 | func main() { 19 | 20 | config := &validator.Config{TagName: "validate"} 21 | 22 | validate := validator.New(config) 23 | 24 | // register all sql.Null* types to use the ValidateValuer CustomTypeFunc 25 | validate.RegisterCustomTypeFunc(ValidateValuer, sql.NullString{}, sql.NullInt64{}, sql.NullBool{}, sql.NullFloat64{}) 26 | 27 | x := DbBackedUser{Name: sql.NullString{String: "", Valid: true}, Age: sql.NullInt64{Int64: 0, Valid: false}} 28 | errs := validate.Struct(x) 29 | 30 | if errs != nil { 31 | fmt.Printf("Errs:\n%+v\n", errs) 32 | } 33 | } 34 | 35 | // ValidateValuer implements validator.CustomTypeFunc 36 | func ValidateValuer(field reflect.Value) interface{} { 37 | if valuer, ok := field.Interface().(driver.Valuer); ok { 38 | val, err := valuer.Value() 39 | if err == nil { 40 | return val 41 | } 42 | // handle the error how you want 43 | } 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2012-2015 Oliver Eilhard 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the “Software”), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/backoff/retry.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | // This file is (c) 2014 Cenk Altı and governed by the MIT license. 6 | // See https://github.com/cenkalti/backoff for original source. 7 | 8 | package backoff 9 | 10 | import "time" 11 | 12 | // An Operation is executing by Retry() or RetryNotify(). 13 | // The operation will be retried using a backoff policy if it returns an error. 14 | type Operation func() error 15 | 16 | // Notify is a notify-on-error function. It receives an operation error and 17 | // backoff delay if the operation failed (with an error). 18 | // 19 | // NOTE that if the backoff policy stated to stop retrying, 20 | // the notify function isn't called. 21 | type Notify func(error, time.Duration) 22 | 23 | // Retry the function f until it does not return error or BackOff stops. 24 | // f is guaranteed to be run at least once. 25 | // It is the caller's responsibility to reset b after Retry returns. 26 | // 27 | // Retry sleeps the goroutine for the duration returned by BackOff after a 28 | // failed operation returns. 29 | func Retry(o Operation, b Backoff) error { return RetryNotify(o, b, nil) } 30 | 31 | // RetryNotify calls notify function with the error and wait duration 32 | // for each failed attempt before sleep. 33 | func RetryNotify(operation Operation, b Backoff, notify Notify) error { 34 | var err error 35 | var next time.Duration 36 | 37 | b.Reset() 38 | for { 39 | if err = operation(); err == nil { 40 | return nil 41 | } 42 | 43 | if next = b.Next(); next == Stop { 44 | return err 45 | } 46 | 47 | if notify != nil { 48 | notify(err, next) 49 | } 50 | 51 | time.Sleep(next) 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/bulk_request.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "fmt" 9 | ) 10 | 11 | // -- Bulkable request (index/update/delete) -- 12 | 13 | // Generic interface to bulkable requests. 14 | type BulkableRequest interface { 15 | fmt.Stringer 16 | Source() ([]string, error) 17 | } 18 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/canonicalize.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "net/url" 8 | 9 | // canonicalize takes a list of URLs and returns its canonicalized form, i.e. 10 | // remove anything but scheme, userinfo, host, path, and port. 11 | // It also removes all trailing slashes. Invalid URLs or URLs that do not 12 | // use protocol http or https are skipped. 13 | // 14 | // Example: 15 | // http://127.0.0.1:9200/?query=1 -> http://127.0.0.1:9200 16 | // http://127.0.0.1:9200/db1/ -> http://127.0.0.1:9200/db1 17 | func canonicalize(rawurls ...string) []string { 18 | var canonicalized []string 19 | for _, rawurl := range rawurls { 20 | u, err := url.Parse(rawurl) 21 | if err == nil { 22 | if u.Scheme == "http" || u.Scheme == "https" { 23 | // Trim trailing slashes 24 | for len(u.Path) > 0 && u.Path[len(u.Path)-1] == '/' { 25 | u.Path = u.Path[0 : len(u.Path)-1] 26 | } 27 | u.Fragment = "" 28 | u.RawQuery = "" 29 | canonicalized = append(canonicalized, u.String()) 30 | } 31 | } 32 | } 33 | return canonicalized 34 | } 35 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/decoder.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "encoding/json" 9 | ) 10 | 11 | // Decoder is used to decode responses from Elasticsearch. 12 | // Users of elastic can implement their own marshaler for advanced purposes 13 | // and set them per Client (see SetDecoder). If none is specified, 14 | // DefaultDecoder is used. 15 | type Decoder interface { 16 | Decode(data []byte, v interface{}) error 17 | } 18 | 19 | // DefaultDecoder uses json.Unmarshal from the Go standard library 20 | // to decode JSON data. 21 | type DefaultDecoder struct{} 22 | 23 | // Decode decodes with json.Unmarshal from the Go standard library. 24 | func (u *DefaultDecoder) Decode(data []byte, v interface{}) error { 25 | return json.Unmarshal(data, v) 26 | } 27 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/geo_point.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "fmt" 9 | "strconv" 10 | "strings" 11 | ) 12 | 13 | // GeoPoint is a geographic position described via latitude and longitude. 14 | type GeoPoint struct { 15 | Lat float64 `json:"lat"` 16 | Lon float64 `json:"lon"` 17 | } 18 | 19 | // Source returns the object to be serialized in Elasticsearch DSL. 20 | func (pt *GeoPoint) Source() map[string]float64 { 21 | return map[string]float64{ 22 | "lat": pt.Lat, 23 | "lon": pt.Lon, 24 | } 25 | } 26 | 27 | // GeoPointFromLatLon initializes a new GeoPoint by latitude and longitude. 28 | func GeoPointFromLatLon(lat, lon float64) *GeoPoint { 29 | return &GeoPoint{Lat: lat, Lon: lon} 30 | } 31 | 32 | // GeoPointFromString initializes a new GeoPoint by a string that is 33 | // formatted as "{latitude},{longitude}", e.g. "40.10210,-70.12091". 34 | func GeoPointFromString(latLon string) (*GeoPoint, error) { 35 | latlon := strings.SplitN(latLon, ",", 2) 36 | if len(latlon) != 2 { 37 | return nil, fmt.Errorf("elastic: %s is not a valid geo point string", latLon) 38 | } 39 | lat, err := strconv.ParseFloat(latlon[0], 64) 40 | if err != nil { 41 | return nil, err 42 | } 43 | lon, err := strconv.ParseFloat(latlon[1], 64) 44 | if err != nil { 45 | return nil, err 46 | } 47 | return &GeoPoint{Lat: lat, Lon: lon}, nil 48 | } 49 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/logger.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2016 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // Logger specifies the interface for all log operations. 8 | type Logger interface { 9 | Printf(format string, v ...interface{}) 10 | } 11 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/plugins.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // HasPlugin indicates whether the cluster has the named plugin. 8 | func (c *Client) HasPlugin(name string) (bool, error) { 9 | plugins, err := c.Plugins() 10 | if err != nil { 11 | return false, nil 12 | } 13 | for _, plugin := range plugins { 14 | if plugin == name { 15 | return true, nil 16 | } 17 | } 18 | return false, nil 19 | } 20 | 21 | // Plugins returns the list of all registered plugins. 22 | func (c *Client) Plugins() ([]string, error) { 23 | stats, err := c.ClusterStats().Do() 24 | if err != nil { 25 | return nil, err 26 | } 27 | if stats == nil { 28 | return nil, err 29 | } 30 | if stats.Nodes == nil { 31 | return nil, err 32 | } 33 | var plugins []string 34 | for _, plugin := range stats.Nodes.Plugins { 35 | plugins = append(plugins, plugin.Name) 36 | } 37 | return plugins, nil 38 | } 39 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/query.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // Query represents the generic query interface. A query's sole purpose 8 | // is to return the source of the query as a JSON-serializable object. 9 | // Returning map[string]interface{} is the norm for queries. 10 | type Query interface { 11 | // Source returns the JSON-serializable query request. 12 | Source() (interface{}, error) 13 | } 14 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/rescore.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | type Rescore struct { 8 | rescorer Rescorer 9 | windowSize *int 10 | defaultRescoreWindowSize *int 11 | } 12 | 13 | func NewRescore() *Rescore { 14 | return &Rescore{} 15 | } 16 | 17 | func (r *Rescore) WindowSize(windowSize int) *Rescore { 18 | r.windowSize = &windowSize 19 | return r 20 | } 21 | 22 | func (r *Rescore) IsEmpty() bool { 23 | return r.rescorer == nil 24 | } 25 | 26 | func (r *Rescore) Rescorer(rescorer Rescorer) *Rescore { 27 | r.rescorer = rescorer 28 | return r 29 | } 30 | 31 | func (r *Rescore) Source() (interface{}, error) { 32 | source := make(map[string]interface{}) 33 | if r.windowSize != nil { 34 | source["window_size"] = *r.windowSize 35 | } else if r.defaultRescoreWindowSize != nil { 36 | source["window_size"] = *r.defaultRescoreWindowSize 37 | } 38 | rescorerSrc, err := r.rescorer.Source() 39 | if err != nil { 40 | return nil, err 41 | } 42 | source[r.rescorer.Name()] = rescorerSrc 43 | return source, nil 44 | } 45 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/rescorer.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | type Rescorer interface { 8 | Name() string 9 | Source() (interface{}, error) 10 | } 11 | 12 | // -- Query Rescorer -- 13 | 14 | type QueryRescorer struct { 15 | query Query 16 | rescoreQueryWeight *float64 17 | queryWeight *float64 18 | scoreMode string 19 | } 20 | 21 | func NewQueryRescorer(query Query) *QueryRescorer { 22 | return &QueryRescorer{ 23 | query: query, 24 | } 25 | } 26 | 27 | func (r *QueryRescorer) Name() string { 28 | return "query" 29 | } 30 | 31 | func (r *QueryRescorer) RescoreQueryWeight(rescoreQueryWeight float64) *QueryRescorer { 32 | r.rescoreQueryWeight = &rescoreQueryWeight 33 | return r 34 | } 35 | 36 | func (r *QueryRescorer) QueryWeight(queryWeight float64) *QueryRescorer { 37 | r.queryWeight = &queryWeight 38 | return r 39 | } 40 | 41 | func (r *QueryRescorer) ScoreMode(scoreMode string) *QueryRescorer { 42 | r.scoreMode = scoreMode 43 | return r 44 | } 45 | 46 | func (r *QueryRescorer) Source() (interface{}, error) { 47 | rescoreQuery, err := r.query.Source() 48 | if err != nil { 49 | return nil, err 50 | } 51 | 52 | source := make(map[string]interface{}) 53 | source["rescore_query"] = rescoreQuery 54 | if r.queryWeight != nil { 55 | source["query_weight"] = *r.queryWeight 56 | } 57 | if r.rescoreQueryWeight != nil { 58 | source["rescore_query_weight"] = *r.rescoreQueryWeight 59 | } 60 | if r.scoreMode != "" { 61 | source["score_mode"] = r.scoreMode 62 | } 63 | return source, nil 64 | } 65 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/response.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "encoding/json" 9 | "io/ioutil" 10 | "net/http" 11 | ) 12 | 13 | // Response represents a response from Elasticsearch. 14 | type Response struct { 15 | // StatusCode is the HTTP status code, e.g. 200. 16 | StatusCode int 17 | // Header is the HTTP header from the HTTP response. 18 | // Keys in the map are canonicalized (see http.CanonicalHeaderKey). 19 | Header http.Header 20 | // Body is the deserialized response body. 21 | Body json.RawMessage 22 | } 23 | 24 | // newResponse creates a new response from the HTTP response. 25 | func (c *Client) newResponse(res *http.Response) (*Response, error) { 26 | r := &Response{ 27 | StatusCode: res.StatusCode, 28 | Header: res.Header, 29 | } 30 | if res.Body != nil { 31 | slurp, err := ioutil.ReadAll(res.Body) 32 | if err != nil { 33 | return nil, err 34 | } 35 | // HEAD requests return a body but no content 36 | if len(slurp) > 0 { 37 | if err := c.decoder.Decode(slurp, &r.Body); err != nil { 38 | return nil, err 39 | } 40 | } 41 | } 42 | return r, nil 43 | } 44 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/search_queries_constant_score.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // ConstantScoreQuery is a query that wraps a filter and simply returns 8 | // a constant score equal to the query boost for every document in the filter. 9 | // 10 | // For more details, see: 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-constant-score-query.html 12 | type ConstantScoreQuery struct { 13 | filter Query 14 | boost *float64 15 | } 16 | 17 | // ConstantScoreQuery creates and initializes a new constant score query. 18 | func NewConstantScoreQuery(filter Query) *ConstantScoreQuery { 19 | return &ConstantScoreQuery{ 20 | filter: filter, 21 | } 22 | } 23 | 24 | // Boost sets the boost for this query. Documents matching this query 25 | // will (in addition to the normal weightings) have their score multiplied 26 | // by the boost provided. 27 | func (q *ConstantScoreQuery) Boost(boost float64) *ConstantScoreQuery { 28 | q.boost = &boost 29 | return q 30 | } 31 | 32 | // Source returns the query source. 33 | func (q *ConstantScoreQuery) Source() (interface{}, error) { 34 | // "constant_score" : { 35 | // "filter" : { 36 | // .... 37 | // }, 38 | // "boost" : 1.5 39 | // } 40 | 41 | query := make(map[string]interface{}) 42 | 43 | params := make(map[string]interface{}) 44 | query["constant_score"] = params 45 | 46 | // filter 47 | src, err := q.filter.Source() 48 | if err != nil { 49 | return nil, err 50 | } 51 | params["filter"] = src 52 | 53 | // boost 54 | if q.boost != nil { 55 | params["boost"] = *q.boost 56 | } 57 | 58 | return query, nil 59 | } 60 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/search_queries_exists.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // ExistsQuery is a query that only matches on documents that the field 8 | // has a value in them. 9 | // 10 | // For more details, see: 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html 12 | type ExistsQuery struct { 13 | name string 14 | queryName string 15 | } 16 | 17 | // NewExistsQuery creates and initializes a new dis max query. 18 | func NewExistsQuery(name string) *ExistsQuery { 19 | return &ExistsQuery{ 20 | name: name, 21 | } 22 | } 23 | 24 | // QueryName sets the query name for the filter that can be used 25 | // when searching for matched queries per hit. 26 | func (q *ExistsQuery) QueryName(queryName string) *ExistsQuery { 27 | q.queryName = queryName 28 | return q 29 | } 30 | 31 | // Source returns the JSON serializable content for this query. 32 | func (q *ExistsQuery) Source() (interface{}, error) { 33 | // { 34 | // "exists" : { 35 | // "field" : "user" 36 | // } 37 | // } 38 | 39 | query := make(map[string]interface{}) 40 | params := make(map[string]interface{}) 41 | query["exists"] = params 42 | 43 | params["field"] = q.name 44 | if q.queryName != "" { 45 | params["_name"] = q.queryName 46 | } 47 | 48 | return query, nil 49 | } 50 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/search_queries_match_all.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // MatchAllQuery is the most simple query, which matches all documents, 8 | // giving them all a _score of 1.0. 9 | // 10 | // For more details, see 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-match-all-query.html 12 | type MatchAllQuery struct { 13 | boost *float64 14 | } 15 | 16 | // NewMatchAllQuery creates and initializes a new match all query. 17 | func NewMatchAllQuery() *MatchAllQuery { 18 | return &MatchAllQuery{} 19 | } 20 | 21 | // Boost sets the boost for this query. Documents matching this query will 22 | // (in addition to the normal weightings) have their score multiplied by the 23 | // boost provided. 24 | func (q *MatchAllQuery) Boost(boost float64) *MatchAllQuery { 25 | q.boost = &boost 26 | return q 27 | } 28 | 29 | // Source returns JSON for the function score query. 30 | func (q MatchAllQuery) Source() (interface{}, error) { 31 | // { 32 | // "match_all" : { ... } 33 | // } 34 | source := make(map[string]interface{}) 35 | params := make(map[string]interface{}) 36 | source["match_all"] = params 37 | if q.boost != nil { 38 | params["boost"] = *q.boost 39 | } 40 | return source, nil 41 | } 42 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/search_queries_not.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // NotQuery filters out matched documents using a query. 8 | // 9 | // For details, see 10 | // https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-not-query.html 11 | type NotQuery struct { 12 | filter Query 13 | queryName string 14 | } 15 | 16 | // NewNotQuery creates and initializes a new NotQuery. 17 | func NewNotQuery(filter Query) *NotQuery { 18 | return &NotQuery{ 19 | filter: filter, 20 | } 21 | } 22 | 23 | // QueryName sets the query name for the filter that can be used 24 | // when searching for matched_filters per hit 25 | func (q *NotQuery) QueryName(queryName string) *NotQuery { 26 | q.queryName = queryName 27 | return q 28 | } 29 | 30 | // Source returns JSON for the query. 31 | func (q *NotQuery) Source() (interface{}, error) { 32 | source := make(map[string]interface{}) 33 | params := make(map[string]interface{}) 34 | source["not"] = params 35 | 36 | src, err := q.filter.Source() 37 | if err != nil { 38 | return nil, err 39 | } 40 | params["query"] = src 41 | if q.queryName != "" { 42 | params["_name"] = q.queryName 43 | } 44 | return source, nil 45 | } 46 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/search_queries_raw_string.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard, John Stanford. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "encoding/json" 8 | 9 | // RawStringQuery can be used to treat a string representation of an ES query 10 | // as a Query. Example usage: 11 | // q := RawStringQuery("{\"match_all\":{}}") 12 | // db.Search().Query(q).From(1).Size(100).Do() 13 | type RawStringQuery string 14 | 15 | // NewRawStringQuery ininitializes a new RawStringQuery. 16 | // It is the same as RawStringQuery(q). 17 | func NewRawStringQuery(q string) RawStringQuery { 18 | return RawStringQuery(q) 19 | } 20 | 21 | // Source returns the JSON encoded body 22 | func (q RawStringQuery) Source() (interface{}, error) { 23 | var f interface{} 24 | err := json.Unmarshal([]byte(q), &f) 25 | return f, err 26 | } 27 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/search_queries_script.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "errors" 8 | 9 | // ScriptQuery allows to define scripts as filters. 10 | // 11 | // For details, see 12 | // https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-script-query.html 13 | type ScriptQuery struct { 14 | script *Script 15 | queryName string 16 | } 17 | 18 | // NewScriptQuery creates and initializes a new ScriptQuery. 19 | func NewScriptQuery(script *Script) *ScriptQuery { 20 | return &ScriptQuery{ 21 | script: script, 22 | } 23 | } 24 | 25 | // QueryName sets the query name for the filter that can be used 26 | // when searching for matched_filters per hit 27 | func (q *ScriptQuery) QueryName(queryName string) *ScriptQuery { 28 | q.queryName = queryName 29 | return q 30 | } 31 | 32 | // Source returns JSON for the query. 33 | func (q *ScriptQuery) Source() (interface{}, error) { 34 | if q.script == nil { 35 | return nil, errors.New("ScriptQuery expected a script") 36 | } 37 | source := make(map[string]interface{}) 38 | params := make(map[string]interface{}) 39 | source["script"] = params 40 | 41 | src, err := q.script.Source() 42 | if err != nil { 43 | return nil, err 44 | } 45 | params["script"] = src 46 | 47 | if q.queryName != "" { 48 | params["_name"] = q.queryName 49 | } 50 | return source, nil 51 | } 52 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/search_queries_term.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // TermQuery finds documents that contain the exact term specified 8 | // in the inverted index. 9 | // 10 | // For details, see 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-term-query.html 12 | type TermQuery struct { 13 | name string 14 | value interface{} 15 | boost *float64 16 | queryName string 17 | } 18 | 19 | // NewTermQuery creates and initializes a new TermQuery. 20 | func NewTermQuery(name string, value interface{}) *TermQuery { 21 | return &TermQuery{name: name, value: value} 22 | } 23 | 24 | // Boost sets the boost for this query. 25 | func (q *TermQuery) Boost(boost float64) *TermQuery { 26 | q.boost = &boost 27 | return q 28 | } 29 | 30 | // QueryName sets the query name for the filter that can be used 31 | // when searching for matched_filters per hit 32 | func (q *TermQuery) QueryName(queryName string) *TermQuery { 33 | q.queryName = queryName 34 | return q 35 | } 36 | 37 | // Source returns JSON for the query. 38 | func (q *TermQuery) Source() (interface{}, error) { 39 | // {"term":{"name":"value"}} 40 | source := make(map[string]interface{}) 41 | tq := make(map[string]interface{}) 42 | source["term"] = tq 43 | 44 | if q.boost == nil && q.queryName == "" { 45 | tq[q.name] = q.value 46 | } else { 47 | subQ := make(map[string]interface{}) 48 | subQ["value"] = q.value 49 | if q.boost != nil { 50 | subQ["boost"] = *q.boost 51 | } 52 | if q.queryName != "" { 53 | subQ["_name"] = q.queryName 54 | } 55 | tq[q.name] = subQ 56 | } 57 | return source, nil 58 | } 59 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/search_queries_terms.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // TermsQuery filters documents that have fields that match any 8 | // of the provided terms (not analyzed). 9 | // 10 | // For more details, see 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html 12 | type TermsQuery struct { 13 | name string 14 | values []interface{} 15 | queryName string 16 | boost *float64 17 | } 18 | 19 | // NewTermsQuery creates and initializes a new TermsQuery. 20 | func NewTermsQuery(name string, values ...interface{}) *TermsQuery { 21 | q := &TermsQuery{ 22 | name: name, 23 | values: make([]interface{}, 0), 24 | } 25 | if len(values) > 0 { 26 | q.values = append(q.values, values...) 27 | } 28 | return q 29 | } 30 | 31 | // Boost sets the boost for this query. 32 | func (q *TermsQuery) Boost(boost float64) *TermsQuery { 33 | q.boost = &boost 34 | return q 35 | } 36 | 37 | // QueryName sets the query name for the filter that can be used 38 | // when searching for matched_filters per hit 39 | func (q *TermsQuery) QueryName(queryName string) *TermsQuery { 40 | q.queryName = queryName 41 | return q 42 | } 43 | 44 | // Creates the query source for the term query. 45 | func (q *TermsQuery) Source() (interface{}, error) { 46 | // {"terms":{"name":["value1","value2"]}} 47 | source := make(map[string]interface{}) 48 | params := make(map[string]interface{}) 49 | source["terms"] = params 50 | params[q.name] = q.values 51 | if q.boost != nil { 52 | params["boost"] = *q.boost 53 | } 54 | if q.queryName != "" { 55 | params["_name"] = q.queryName 56 | } 57 | return source, nil 58 | } 59 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/search_queries_type.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // TypeQuery filters documents matching the provided document / mapping type. 8 | // 9 | // For details, see: 10 | // https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-type-query.html 11 | type TypeQuery struct { 12 | typ string 13 | } 14 | 15 | func NewTypeQuery(typ string) *TypeQuery { 16 | return &TypeQuery{typ: typ} 17 | } 18 | 19 | // Source returns JSON for the query. 20 | func (q *TypeQuery) Source() (interface{}, error) { 21 | source := make(map[string]interface{}) 22 | params := make(map[string]interface{}) 23 | source["type"] = params 24 | params["value"] = q.typ 25 | return source, nil 26 | } 27 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/suggester.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // Represents the generic suggester interface. 8 | // A suggester's only purpose is to return the 9 | // source of the query as a JSON-serializable 10 | // object. Returning a map[string]interface{} 11 | // will do. 12 | type Suggester interface { 13 | Name() string 14 | Source(includeName bool) (interface{}, error) 15 | } 16 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/suggester_context.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-2015 Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // SuggesterContextQuery is used to define context information within 8 | // a suggestion request. 9 | type SuggesterContextQuery interface { 10 | Source() (interface{}, error) 11 | } 12 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v3/uritemplates/utils.go: -------------------------------------------------------------------------------- 1 | package uritemplates 2 | 3 | func Expand(path string, expansions map[string]string) (string, error) { 4 | template, err := Parse(path) 5 | if err != nil { 6 | return "", err 7 | } 8 | values := make(map[string]interface{}) 9 | for k, v := range expansions { 10 | values[k] = v 11 | } 12 | return template.Expand(values) 13 | } 14 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright © 2012-2015 Oliver Eilhard 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the “Software”), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/acknowledged_response.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // AcknowledgedResponse is returned from various APIs. It simply indicates 8 | // whether the operation is ack'd or not. 9 | type AcknowledgedResponse struct { 10 | Acknowledged bool `json:"acknowledged"` 11 | } 12 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/bulk_request.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "fmt" 9 | ) 10 | 11 | // -- Bulkable request (index/update/delete) -- 12 | 13 | // BulkableRequest is a generic interface to bulkable requests. 14 | type BulkableRequest interface { 15 | fmt.Stringer 16 | Source() ([]string, error) 17 | } 18 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/canonicalize.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "net/url" 8 | 9 | // canonicalize takes a list of URLs and returns its canonicalized form, i.e. 10 | // remove anything but scheme, userinfo, host, path, and port. 11 | // It also removes all trailing slashes. Invalid URLs or URLs that do not 12 | // use protocol http or https are skipped. 13 | // 14 | // Example: 15 | // http://127.0.0.1:9200/?query=1 -> http://127.0.0.1:9200 16 | // http://127.0.0.1:9200/db1/ -> http://127.0.0.1:9200/db1 17 | func canonicalize(rawurls ...string) []string { 18 | var canonicalized []string 19 | for _, rawurl := range rawurls { 20 | u, err := url.Parse(rawurl) 21 | if err == nil { 22 | if u.Scheme == "http" || u.Scheme == "https" { 23 | // Trim trailing slashes 24 | for len(u.Path) > 0 && u.Path[len(u.Path)-1] == '/' { 25 | u.Path = u.Path[0 : len(u.Path)-1] 26 | } 27 | u.Fragment = "" 28 | u.RawQuery = "" 29 | canonicalized = append(canonicalized, u.String()) 30 | } 31 | } 32 | } 33 | return canonicalized 34 | } 35 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/decoder.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "encoding/json" 9 | ) 10 | 11 | // Decoder is used to decode responses from Elasticsearch. 12 | // Users of elastic can implement their own marshaler for advanced purposes 13 | // and set them per Client (see SetDecoder). If none is specified, 14 | // DefaultDecoder is used. 15 | type Decoder interface { 16 | Decode(data []byte, v interface{}) error 17 | } 18 | 19 | // DefaultDecoder uses json.Unmarshal from the Go standard library 20 | // to decode JSON data. 21 | type DefaultDecoder struct{} 22 | 23 | // Decode decodes with json.Unmarshal from the Go standard library. 24 | func (u *DefaultDecoder) Decode(data []byte, v interface{}) error { 25 | return json.Unmarshal(data, v) 26 | } 27 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/geo_point.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "fmt" 9 | "strconv" 10 | "strings" 11 | ) 12 | 13 | // GeoPoint is a geographic position described via latitude and longitude. 14 | type GeoPoint struct { 15 | Lat float64 `json:"lat"` 16 | Lon float64 `json:"lon"` 17 | } 18 | 19 | // Source returns the object to be serialized in Elasticsearch DSL. 20 | func (pt *GeoPoint) Source() map[string]float64 { 21 | return map[string]float64{ 22 | "lat": pt.Lat, 23 | "lon": pt.Lon, 24 | } 25 | } 26 | 27 | // GeoPointFromLatLon initializes a new GeoPoint by latitude and longitude. 28 | func GeoPointFromLatLon(lat, lon float64) *GeoPoint { 29 | return &GeoPoint{Lat: lat, Lon: lon} 30 | } 31 | 32 | // GeoPointFromString initializes a new GeoPoint by a string that is 33 | // formatted as "{latitude},{longitude}", e.g. "40.10210,-70.12091". 34 | func GeoPointFromString(latLon string) (*GeoPoint, error) { 35 | latlon := strings.SplitN(latLon, ",", 2) 36 | if len(latlon) != 2 { 37 | return nil, fmt.Errorf("elastic: %s is not a valid geo point string", latLon) 38 | } 39 | lat, err := strconv.ParseFloat(latlon[0], 64) 40 | if err != nil { 41 | return nil, err 42 | } 43 | lon, err := strconv.ParseFloat(latlon[1], 64) 44 | if err != nil { 45 | return nil, err 46 | } 47 | return &GeoPoint{Lat: lat, Lon: lon}, nil 48 | } 49 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/logger.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // Logger specifies the interface for all log operations. 8 | type Logger interface { 9 | Printf(format string, v ...interface{}) 10 | } 11 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/plugins.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "context" 8 | 9 | // HasPlugin indicates whether the cluster has the named plugin. 10 | func (c *Client) HasPlugin(name string) (bool, error) { 11 | plugins, err := c.Plugins() 12 | if err != nil { 13 | return false, nil 14 | } 15 | for _, plugin := range plugins { 16 | if plugin == name { 17 | return true, nil 18 | } 19 | } 20 | return false, nil 21 | } 22 | 23 | // Plugins returns the list of all registered plugins. 24 | func (c *Client) Plugins() ([]string, error) { 25 | stats, err := c.ClusterStats().Do(context.Background()) 26 | if err != nil { 27 | return nil, err 28 | } 29 | if stats == nil { 30 | return nil, err 31 | } 32 | if stats.Nodes == nil { 33 | return nil, err 34 | } 35 | var plugins []string 36 | for _, plugin := range stats.Nodes.Plugins { 37 | plugins = append(plugins, plugin.Name) 38 | } 39 | return plugins, nil 40 | } 41 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/query.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // Query represents the generic query interface. A query's sole purpose 8 | // is to return the source of the query as a JSON-serializable object. 9 | // Returning map[string]interface{} is the norm for queries. 10 | type Query interface { 11 | // Source returns the JSON-serializable query request. 12 | Source() (interface{}, error) 13 | } 14 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/recipes/connect/connect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | // Connect simply connects to Elasticsearch. 6 | // 7 | // Example 8 | // 9 | // 10 | // connect -url=http://127.0.0.1:9200 -sniff=false 11 | // 12 | package main 13 | 14 | import ( 15 | "flag" 16 | "fmt" 17 | "log" 18 | 19 | "gopkg.in/olivere/elastic.v5" 20 | ) 21 | 22 | func main() { 23 | var ( 24 | url = flag.String("url", "http://localhost:9200", "Elasticsearch URL") 25 | sniff = flag.Bool("sniff", true, "Enable or disable sniffing") 26 | ) 27 | flag.Parse() 28 | log.SetFlags(0) 29 | 30 | if *url == "" { 31 | *url = "http://127.0.0.1:9200" 32 | } 33 | 34 | // Create an Elasticsearch client 35 | client, err := elastic.NewClient(elastic.SetURL(*url), elastic.SetSniff(*sniff)) 36 | if err != nil { 37 | log.Fatal(err) 38 | } 39 | _ = client 40 | 41 | // Just a status message 42 | fmt.Println("Connection succeeded") 43 | } 44 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/rescore.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | type Rescore struct { 8 | rescorer Rescorer 9 | windowSize *int 10 | defaultRescoreWindowSize *int 11 | } 12 | 13 | func NewRescore() *Rescore { 14 | return &Rescore{} 15 | } 16 | 17 | func (r *Rescore) WindowSize(windowSize int) *Rescore { 18 | r.windowSize = &windowSize 19 | return r 20 | } 21 | 22 | func (r *Rescore) IsEmpty() bool { 23 | return r.rescorer == nil 24 | } 25 | 26 | func (r *Rescore) Rescorer(rescorer Rescorer) *Rescore { 27 | r.rescorer = rescorer 28 | return r 29 | } 30 | 31 | func (r *Rescore) Source() (interface{}, error) { 32 | source := make(map[string]interface{}) 33 | if r.windowSize != nil { 34 | source["window_size"] = *r.windowSize 35 | } else if r.defaultRescoreWindowSize != nil { 36 | source["window_size"] = *r.defaultRescoreWindowSize 37 | } 38 | rescorerSrc, err := r.rescorer.Source() 39 | if err != nil { 40 | return nil, err 41 | } 42 | source[r.rescorer.Name()] = rescorerSrc 43 | return source, nil 44 | } 45 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/rescorer.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | type Rescorer interface { 8 | Name() string 9 | Source() (interface{}, error) 10 | } 11 | 12 | // -- Query Rescorer -- 13 | 14 | type QueryRescorer struct { 15 | query Query 16 | rescoreQueryWeight *float64 17 | queryWeight *float64 18 | scoreMode string 19 | } 20 | 21 | func NewQueryRescorer(query Query) *QueryRescorer { 22 | return &QueryRescorer{ 23 | query: query, 24 | } 25 | } 26 | 27 | func (r *QueryRescorer) Name() string { 28 | return "query" 29 | } 30 | 31 | func (r *QueryRescorer) RescoreQueryWeight(rescoreQueryWeight float64) *QueryRescorer { 32 | r.rescoreQueryWeight = &rescoreQueryWeight 33 | return r 34 | } 35 | 36 | func (r *QueryRescorer) QueryWeight(queryWeight float64) *QueryRescorer { 37 | r.queryWeight = &queryWeight 38 | return r 39 | } 40 | 41 | func (r *QueryRescorer) ScoreMode(scoreMode string) *QueryRescorer { 42 | r.scoreMode = scoreMode 43 | return r 44 | } 45 | 46 | func (r *QueryRescorer) Source() (interface{}, error) { 47 | rescoreQuery, err := r.query.Source() 48 | if err != nil { 49 | return nil, err 50 | } 51 | 52 | source := make(map[string]interface{}) 53 | source["rescore_query"] = rescoreQuery 54 | if r.queryWeight != nil { 55 | source["query_weight"] = *r.queryWeight 56 | } 57 | if r.rescoreQueryWeight != nil { 58 | source["rescore_query_weight"] = *r.rescoreQueryWeight 59 | } 60 | if r.scoreMode != "" { 61 | source["score_mode"] = r.scoreMode 62 | } 63 | return source, nil 64 | } 65 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/response.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import ( 8 | "encoding/json" 9 | "io/ioutil" 10 | "net/http" 11 | ) 12 | 13 | // Response represents a response from Elasticsearch. 14 | type Response struct { 15 | // StatusCode is the HTTP status code, e.g. 200. 16 | StatusCode int 17 | // Header is the HTTP header from the HTTP response. 18 | // Keys in the map are canonicalized (see http.CanonicalHeaderKey). 19 | Header http.Header 20 | // Body is the deserialized response body. 21 | Body json.RawMessage 22 | } 23 | 24 | // newResponse creates a new response from the HTTP response. 25 | func (c *Client) newResponse(res *http.Response) (*Response, error) { 26 | r := &Response{ 27 | StatusCode: res.StatusCode, 28 | Header: res.Header, 29 | } 30 | if res.Body != nil { 31 | slurp, err := ioutil.ReadAll(res.Body) 32 | if err != nil { 33 | return nil, err 34 | } 35 | // HEAD requests return a body but no content 36 | if len(slurp) > 0 { 37 | if err := c.decoder.Decode(slurp, &r.Body); err != nil { 38 | return nil, err 39 | } 40 | } 41 | } 42 | return r, nil 43 | } 44 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/retry.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | // This file is based on code (c) 2014 Cenk Altı and governed by the MIT license. 6 | // See https://github.com/cenkalti/backoff for original source. 7 | 8 | package elastic 9 | 10 | import "time" 11 | 12 | // An Operation is executing by Retry() or RetryNotify(). 13 | // The operation will be retried using a backoff policy if it returns an error. 14 | type Operation func() error 15 | 16 | // Notify is a notify-on-error function. It receives error returned 17 | // from an operation. 18 | // 19 | // Notice that if the backoff policy stated to stop retrying, 20 | // the notify function isn't called. 21 | type Notify func(error) 22 | 23 | // Retry the function f until it does not return error or BackOff stops. 24 | // f is guaranteed to be run at least once. 25 | // It is the caller's responsibility to reset b after Retry returns. 26 | // 27 | // Retry sleeps the goroutine for the duration returned by BackOff after a 28 | // failed operation returns. 29 | func Retry(o Operation, b Backoff) error { return RetryNotify(o, b, nil) } 30 | 31 | // RetryNotify calls notify function with the error and wait duration 32 | // for each failed attempt before sleep. 33 | func RetryNotify(operation Operation, b Backoff, notify Notify) error { 34 | var err error 35 | var wait time.Duration 36 | var retry bool 37 | var n int 38 | 39 | for { 40 | if err = operation(); err == nil { 41 | return nil 42 | } 43 | 44 | n++ 45 | wait, retry = b.Next(n) 46 | if !retry { 47 | return err 48 | } 49 | 50 | if notify != nil { 51 | notify(err) 52 | } 53 | 54 | time.Sleep(wait) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/search_queries_constant_score.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // ConstantScoreQuery is a query that wraps a filter and simply returns 8 | // a constant score equal to the query boost for every document in the filter. 9 | // 10 | // For more details, see: 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-constant-score-query.html 12 | type ConstantScoreQuery struct { 13 | filter Query 14 | boost *float64 15 | } 16 | 17 | // ConstantScoreQuery creates and initializes a new constant score query. 18 | func NewConstantScoreQuery(filter Query) *ConstantScoreQuery { 19 | return &ConstantScoreQuery{ 20 | filter: filter, 21 | } 22 | } 23 | 24 | // Boost sets the boost for this query. Documents matching this query 25 | // will (in addition to the normal weightings) have their score multiplied 26 | // by the boost provided. 27 | func (q *ConstantScoreQuery) Boost(boost float64) *ConstantScoreQuery { 28 | q.boost = &boost 29 | return q 30 | } 31 | 32 | // Source returns the query source. 33 | func (q *ConstantScoreQuery) Source() (interface{}, error) { 34 | // "constant_score" : { 35 | // "filter" : { 36 | // .... 37 | // }, 38 | // "boost" : 1.5 39 | // } 40 | 41 | query := make(map[string]interface{}) 42 | 43 | params := make(map[string]interface{}) 44 | query["constant_score"] = params 45 | 46 | // filter 47 | src, err := q.filter.Source() 48 | if err != nil { 49 | return nil, err 50 | } 51 | params["filter"] = src 52 | 53 | // boost 54 | if q.boost != nil { 55 | params["boost"] = *q.boost 56 | } 57 | 58 | return query, nil 59 | } 60 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/search_queries_exists.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // ExistsQuery is a query that only matches on documents that the field 8 | // has a value in them. 9 | // 10 | // For more details, see: 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-exists-query.html 12 | type ExistsQuery struct { 13 | name string 14 | queryName string 15 | } 16 | 17 | // NewExistsQuery creates and initializes a new dis max query. 18 | func NewExistsQuery(name string) *ExistsQuery { 19 | return &ExistsQuery{ 20 | name: name, 21 | } 22 | } 23 | 24 | // QueryName sets the query name for the filter that can be used 25 | // when searching for matched queries per hit. 26 | func (q *ExistsQuery) QueryName(queryName string) *ExistsQuery { 27 | q.queryName = queryName 28 | return q 29 | } 30 | 31 | // Source returns the JSON serializable content for this query. 32 | func (q *ExistsQuery) Source() (interface{}, error) { 33 | // { 34 | // "exists" : { 35 | // "field" : "user" 36 | // } 37 | // } 38 | 39 | query := make(map[string]interface{}) 40 | params := make(map[string]interface{}) 41 | query["exists"] = params 42 | 43 | params["field"] = q.name 44 | if q.queryName != "" { 45 | params["_name"] = q.queryName 46 | } 47 | 48 | return query, nil 49 | } 50 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/search_queries_match_all.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // MatchAllQuery is the most simple query, which matches all documents, 8 | // giving them all a _score of 1.0. 9 | // 10 | // For more details, see 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-match-all-query.html 12 | type MatchAllQuery struct { 13 | boost *float64 14 | } 15 | 16 | // NewMatchAllQuery creates and initializes a new match all query. 17 | func NewMatchAllQuery() *MatchAllQuery { 18 | return &MatchAllQuery{} 19 | } 20 | 21 | // Boost sets the boost for this query. Documents matching this query will 22 | // (in addition to the normal weightings) have their score multiplied by the 23 | // boost provided. 24 | func (q *MatchAllQuery) Boost(boost float64) *MatchAllQuery { 25 | q.boost = &boost 26 | return q 27 | } 28 | 29 | // Source returns JSON for the function score query. 30 | func (q MatchAllQuery) Source() (interface{}, error) { 31 | // { 32 | // "match_all" : { ... } 33 | // } 34 | source := make(map[string]interface{}) 35 | params := make(map[string]interface{}) 36 | source["match_all"] = params 37 | if q.boost != nil { 38 | params["boost"] = *q.boost 39 | } 40 | return source, nil 41 | } 42 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/search_queries_raw_string.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard, John Stanford. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "encoding/json" 8 | 9 | // RawStringQuery can be used to treat a string representation of an ES query 10 | // as a Query. Example usage: 11 | // q := RawStringQuery("{\"match_all\":{}}") 12 | // db.Search().Query(q).From(1).Size(100).Do() 13 | type RawStringQuery string 14 | 15 | // NewRawStringQuery ininitializes a new RawStringQuery. 16 | // It is the same as RawStringQuery(q). 17 | func NewRawStringQuery(q string) RawStringQuery { 18 | return RawStringQuery(q) 19 | } 20 | 21 | // Source returns the JSON encoded body 22 | func (q RawStringQuery) Source() (interface{}, error) { 23 | var f interface{} 24 | err := json.Unmarshal([]byte(q), &f) 25 | return f, err 26 | } 27 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/search_queries_script.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | import "errors" 8 | 9 | // ScriptQuery allows to define scripts as filters. 10 | // 11 | // For details, see 12 | // https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-script-query.html 13 | type ScriptQuery struct { 14 | script *Script 15 | queryName string 16 | } 17 | 18 | // NewScriptQuery creates and initializes a new ScriptQuery. 19 | func NewScriptQuery(script *Script) *ScriptQuery { 20 | return &ScriptQuery{ 21 | script: script, 22 | } 23 | } 24 | 25 | // QueryName sets the query name for the filter that can be used 26 | // when searching for matched_filters per hit 27 | func (q *ScriptQuery) QueryName(queryName string) *ScriptQuery { 28 | q.queryName = queryName 29 | return q 30 | } 31 | 32 | // Source returns JSON for the query. 33 | func (q *ScriptQuery) Source() (interface{}, error) { 34 | if q.script == nil { 35 | return nil, errors.New("ScriptQuery expected a script") 36 | } 37 | source := make(map[string]interface{}) 38 | params := make(map[string]interface{}) 39 | source["script"] = params 40 | 41 | src, err := q.script.Source() 42 | if err != nil { 43 | return nil, err 44 | } 45 | params["script"] = src 46 | 47 | if q.queryName != "" { 48 | params["_name"] = q.queryName 49 | } 50 | return source, nil 51 | } 52 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/search_queries_slice.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // SliceQuery allows to partition the documents into several slices. 8 | // It is used e.g. to slice scroll operations in Elasticsearch 5.0 or later. 9 | // See https://www.elastic.co/guide/en/elasticsearch/reference/5.2/search-request-scroll.html#sliced-scroll 10 | // for details. 11 | type SliceQuery struct { 12 | field string 13 | id *int 14 | max *int 15 | } 16 | 17 | // NewSliceQuery creates a new SliceQuery. 18 | func NewSliceQuery() *SliceQuery { 19 | return &SliceQuery{} 20 | } 21 | 22 | // Field is the name of the field to slice against (_uid by default). 23 | func (s *SliceQuery) Field(field string) *SliceQuery { 24 | s.field = field 25 | return s 26 | } 27 | 28 | // Id is the id of the slice. 29 | func (s *SliceQuery) Id(id int) *SliceQuery { 30 | s.id = &id 31 | return s 32 | } 33 | 34 | // Max is the maximum number of slices. 35 | func (s *SliceQuery) Max(max int) *SliceQuery { 36 | s.max = &max 37 | return s 38 | } 39 | 40 | // Source returns the JSON body. 41 | func (s *SliceQuery) Source() (interface{}, error) { 42 | m := make(map[string]interface{}) 43 | if s.field != "" { 44 | m["field"] = s.field 45 | } 46 | if s.id != nil { 47 | m["id"] = *s.id 48 | } 49 | if s.max != nil { 50 | m["max"] = *s.max 51 | } 52 | return m, nil 53 | } 54 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/search_queries_term.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // TermQuery finds documents that contain the exact term specified 8 | // in the inverted index. 9 | // 10 | // For details, see 11 | // https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-term-query.html 12 | type TermQuery struct { 13 | name string 14 | value interface{} 15 | boost *float64 16 | queryName string 17 | } 18 | 19 | // NewTermQuery creates and initializes a new TermQuery. 20 | func NewTermQuery(name string, value interface{}) *TermQuery { 21 | return &TermQuery{name: name, value: value} 22 | } 23 | 24 | // Boost sets the boost for this query. 25 | func (q *TermQuery) Boost(boost float64) *TermQuery { 26 | q.boost = &boost 27 | return q 28 | } 29 | 30 | // QueryName sets the query name for the filter that can be used 31 | // when searching for matched_filters per hit 32 | func (q *TermQuery) QueryName(queryName string) *TermQuery { 33 | q.queryName = queryName 34 | return q 35 | } 36 | 37 | // Source returns JSON for the query. 38 | func (q *TermQuery) Source() (interface{}, error) { 39 | // {"term":{"name":"value"}} 40 | source := make(map[string]interface{}) 41 | tq := make(map[string]interface{}) 42 | source["term"] = tq 43 | 44 | if q.boost == nil && q.queryName == "" { 45 | tq[q.name] = q.value 46 | } else { 47 | subQ := make(map[string]interface{}) 48 | subQ["value"] = q.value 49 | if q.boost != nil { 50 | subQ["boost"] = *q.boost 51 | } 52 | if q.queryName != "" { 53 | subQ["_name"] = q.queryName 54 | } 55 | tq[q.name] = subQ 56 | } 57 | return source, nil 58 | } 59 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/search_queries_type.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // TypeQuery filters documents matching the provided document / mapping type. 8 | // 9 | // For details, see: 10 | // https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-type-query.html 11 | type TypeQuery struct { 12 | typ string 13 | } 14 | 15 | func NewTypeQuery(typ string) *TypeQuery { 16 | return &TypeQuery{typ: typ} 17 | } 18 | 19 | // Source returns JSON for the query. 20 | func (q *TypeQuery) Source() (interface{}, error) { 21 | source := make(map[string]interface{}) 22 | params := make(map[string]interface{}) 23 | source["type"] = params 24 | params["value"] = q.typ 25 | return source, nil 26 | } 27 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/search_terms_lookup.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // TermsLookup encapsulates the parameters needed to fetch terms. 8 | // 9 | // For more details, see 10 | // https://www.elastic.co/guide/en/elasticsearch/reference/5.3/query-dsl-terms-query.html#query-dsl-terms-lookup. 11 | type TermsLookup struct { 12 | index string 13 | typ string 14 | id string 15 | path string 16 | routing string 17 | } 18 | 19 | // NewTermsLookup creates and initializes a new TermsLookup. 20 | func NewTermsLookup() *TermsLookup { 21 | t := &TermsLookup{} 22 | return t 23 | } 24 | 25 | // Index name. 26 | func (t *TermsLookup) Index(index string) *TermsLookup { 27 | t.index = index 28 | return t 29 | } 30 | 31 | // Type name. 32 | func (t *TermsLookup) Type(typ string) *TermsLookup { 33 | t.typ = typ 34 | return t 35 | } 36 | 37 | // Id to look up. 38 | func (t *TermsLookup) Id(id string) *TermsLookup { 39 | t.id = id 40 | return t 41 | } 42 | 43 | // Path to use for lookup. 44 | func (t *TermsLookup) Path(path string) *TermsLookup { 45 | t.path = path 46 | return t 47 | } 48 | 49 | // Routing value. 50 | func (t *TermsLookup) Routing(routing string) *TermsLookup { 51 | t.routing = routing 52 | return t 53 | } 54 | 55 | // Source creates the JSON source of the builder. 56 | func (t *TermsLookup) Source() (interface{}, error) { 57 | src := make(map[string]interface{}) 58 | if t.index != "" { 59 | src["index"] = t.index 60 | } 61 | if t.typ != "" { 62 | src["type"] = t.typ 63 | } 64 | if t.id != "" { 65 | src["id"] = t.id 66 | } 67 | if t.path != "" { 68 | src["path"] = t.path 69 | } 70 | if t.routing != "" { 71 | src["routing"] = t.routing 72 | } 73 | return src, nil 74 | } 75 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/suggester.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // Represents the generic suggester interface. 8 | // A suggester's only purpose is to return the 9 | // source of the query as a JSON-serializable 10 | // object. Returning a map[string]interface{} 11 | // will do. 12 | type Suggester interface { 13 | Name() string 14 | Source(includeName bool) (interface{}, error) 15 | } 16 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/suggester_context.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012-present Oliver Eilhard. All rights reserved. 2 | // Use of this source code is governed by a MIT-license. 3 | // See http://olivere.mit-license.org/license.txt for details. 4 | 5 | package elastic 6 | 7 | // SuggesterContextQuery is used to define context information within 8 | // a suggestion request. 9 | type SuggesterContextQuery interface { 10 | Source() (interface{}, error) 11 | } 12 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/olivere/elastic.v5/uritemplates/utils.go: -------------------------------------------------------------------------------- 1 | package uritemplates 2 | 3 | func Expand(path string, expansions map[string]string) (string, error) { 4 | template, err := Parse(path) 5 | if err != nil { 6 | return "", err 7 | } 8 | values := make(map[string]interface{}) 9 | for k, v := range expansions { 10 | values[k] = v 11 | } 12 | return template.Expand(values) 13 | } 14 | -------------------------------------------------------------------------------- /server/vendor/gopkg.in/yaml.v2/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /talks/README.md: -------------------------------------------------------------------------------- 1 | # Supporting material for Talks 2 | -------------------------------------------------------------------------------- /talks/fosdem2017/config/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | http.host: 0.0.0.0 2 | 3 | http.cors.enabled : true 4 | http.cors.allow-origin: "/.*/" 5 | http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE 6 | http.cors.allow-headers : "X-Requested-With,X-Auth-Token,Content-Type, Content-Length, Authorization" 7 | -------------------------------------------------------------------------------- /talks/fosdem2017/config/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | 3 | appender.console.type = Console 4 | appender.console.name = console 5 | appender.console.layout.type = PatternLayout 6 | appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n 7 | 8 | rootLogger.level = info 9 | rootLogger.appenderRef.console.ref = console 10 | -------------------------------------------------------------------------------- /talks/fosdem2017/generate-jobs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | progs=( sw/R/R sw/python/python sw/bwa/bwa sw/samtools/samtools sw/java/java sw/blast/blast ) 4 | 5 | for i in {1..100}; do 6 | export JOBID=$i 7 | 8 | rand=$[$RANDOM % 6] 9 | ${progs[$rand]} > /dev/null 10 | ls > /dev/null 11 | done 12 | -------------------------------------------------------------------------------- /talks/fosdem2017/generate-software: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat > prog.c < 5 | int main() { printf("I am a dummy()\n"); libfunc(); } 6 | EOM 7 | cat > lib.c < 9 | void libfunc() { printf("libfunc()\n"); } 10 | EOM 11 | 12 | progs=( R python bwa samtools java blast ) 13 | libs=( liba libb ) 14 | 15 | for lib in "${libs[@]}"; do 16 | libdir="sw/$lib/" 17 | export LIBRARY_PATH=$libdir:$LIBRARY_PATH 18 | libso="sw/$lib/${lib}.so" 19 | mkdir -p "$libdir" 20 | gcc -shared -fPIC -o "$libso" lib.c 21 | done 22 | 23 | for prog in "${progs[@]}"; do 24 | rand=$[$RANDOM % 2] 25 | progdir="sw/$prog/" 26 | prog="$progdir/$prog" 27 | libso="${libs[$rand]}.so" 28 | mkdir -p "$progdir" 29 | gcc -o "$prog" prog.c "-l:$libso" 30 | done 31 | 32 | rm prog.c lib.c 33 | -------------------------------------------------------------------------------- /talks/fosdem2017/infra-destroy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker rm -f ogrt-fosdem17-es 4 | docker rm -f ogrt-fosdem17-kibana 5 | -------------------------------------------------------------------------------- /talks/fosdem2017/setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export LD_PRELOAD=$(pwd)/ogrt/lib/libogrt.so 4 | export OGRT_ACTIVE=1 5 | export OGRT_SILENT=1 6 | export PATH=$(pwd)/ogrt/bin/:$PATH 7 | export LD_LIBRARY_PATH=$(pwd)/sw/liba/:$(pwd)/sw/libb/:$LD_LIBRARY_PATH 8 | -------------------------------------------------------------------------------- /talks/hpckp16/infra-destroy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | docker rm -f ogrt-hpckp-es 4 | docker rm -f ogrt-hpckp-kibana 5 | --------------------------------------------------------------------------------