├── .gitignore ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE.txt ├── README.md ├── db ├── db.go └── migrations │ ├── 1_create_link.down.sql │ ├── 1_create_link.up.sql │ ├── 2_create_user.down.sql │ ├── 2_create_user.up.sql │ ├── 3_add_postedby_to_link.down.sql │ ├── 3_add_postedby_to_link.up.sql │ ├── 4_create_vote.down.sql │ └── 4_create_vote.up.sql ├── docker-compose.yml ├── main.go ├── resolvers └── resolvers.go ├── schema.graphqls └── vendor ├── github.com ├── lib │ └── pq │ │ ├── .gitignore │ │ ├── .travis.sh │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── array.go │ │ ├── array_test.go │ │ ├── bench_test.go │ │ ├── buf.go │ │ ├── certs │ │ ├── README │ │ ├── bogus_root.crt │ │ ├── postgresql.crt │ │ ├── postgresql.key │ │ ├── root.crt │ │ ├── server.crt │ │ └── server.key │ │ ├── conn.go │ │ ├── conn_go18.go │ │ ├── conn_test.go │ │ ├── copy.go │ │ ├── copy_test.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encode_test.go │ │ ├── error.go │ │ ├── example │ │ └── listen │ │ │ └── doc.go │ │ ├── go18_test.go │ │ ├── hstore │ │ ├── hstore.go │ │ └── hstore_test.go │ │ ├── issues_test.go │ │ ├── notify.go │ │ ├── notify_test.go │ │ ├── oid │ │ ├── doc.go │ │ ├── gen.go │ │ └── types.go │ │ ├── rows.go │ │ ├── rows_test.go │ │ ├── ssl.go │ │ ├── ssl_go1.7.go │ │ ├── ssl_permissions.go │ │ ├── ssl_renegotiation.go │ │ ├── ssl_test.go │ │ ├── ssl_windows.go │ │ ├── url.go │ │ ├── url_test.go │ │ ├── user_posix.go │ │ ├── user_windows.go │ │ ├── uuid.go │ │ └── uuid_test.go ├── mattes │ └── migrate │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── FAQ.md │ │ ├── LICENSE │ │ ├── MIGRATIONS.md │ │ ├── Makefile │ │ ├── README.md │ │ ├── cli │ │ ├── README.md │ │ ├── build_aws-s3.go │ │ ├── build_github.go │ │ ├── build_go-bindata.go │ │ ├── build_google-cloud-storage.go │ │ ├── build_mysql.go │ │ ├── build_postgres.go │ │ ├── build_ql.go │ │ ├── build_redshift.go │ │ ├── commands.go │ │ ├── examples │ │ │ └── Dockerfile │ │ ├── log.go │ │ ├── main.go │ │ └── version.go │ │ ├── database │ │ ├── cassandra │ │ │ └── README.md │ │ ├── crate │ │ │ └── README.md │ │ ├── driver.go │ │ ├── driver_test.go │ │ ├── error.go │ │ ├── mongodb │ │ │ └── README.md │ │ ├── mysql │ │ │ ├── README.md │ │ │ ├── mysql.go │ │ │ └── mysql_test.go │ │ ├── neo4j │ │ │ └── README.md │ │ ├── postgres │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ └── migrations │ │ │ │ │ ├── 1085649617_create_users_table.down.sql │ │ │ │ │ ├── 1085649617_create_users_table.up.sql │ │ │ │ │ ├── 1185749658_add_city_to_users.down.sql │ │ │ │ │ ├── 1185749658_add_city_to_users.up.sql │ │ │ │ │ ├── 1285849751_add_index_on_user_emails.down.sql │ │ │ │ │ ├── 1285849751_add_index_on_user_emails.up.sql │ │ │ │ │ ├── 1385949617_create_books_table.down.sql │ │ │ │ │ ├── 1385949617_create_books_table.up.sql │ │ │ │ │ ├── 1485949617_create_movies_table.down.sql │ │ │ │ │ ├── 1485949617_create_movies_table.up.sql │ │ │ │ │ ├── 1585849751_just_a_comment.up.sql │ │ │ │ │ ├── 1685849751_another_comment.up.sql │ │ │ │ │ ├── 1785849751_another_comment.up.sql │ │ │ │ │ └── 1885849751_another_comment.up.sql │ │ │ ├── postgres.go │ │ │ └── postgres_test.go │ │ ├── ql │ │ │ ├── README.md │ │ │ ├── migration │ │ │ │ ├── 33_create_table.down.sql │ │ │ │ ├── 33_create_table.up.sql │ │ │ │ ├── 44_alter_table.down.sql │ │ │ │ └── 44_alter_table.up.sql │ │ │ ├── ql.go │ │ │ └── ql_test.go │ │ ├── redshift │ │ │ ├── README.md │ │ │ └── redshift.go │ │ ├── shell │ │ │ └── README.md │ │ ├── sqlite │ │ │ └── README.md │ │ ├── stub │ │ │ ├── stub.go │ │ │ └── stub_test.go │ │ ├── testing │ │ │ └── testing.go │ │ ├── util.go │ │ └── util_test.go │ │ ├── log.go │ │ ├── migrate.go │ │ ├── migrate_test.go │ │ ├── migration.go │ │ ├── migration_test.go │ │ ├── source │ │ ├── aws-s3 │ │ │ ├── README.md │ │ │ ├── s3.go │ │ │ └── s3_test.go │ │ ├── driver.go │ │ ├── driver_test.go │ │ ├── file │ │ │ ├── README.md │ │ │ ├── file.go │ │ │ └── file_test.go │ │ ├── github │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ └── migrations │ │ │ │ │ ├── 1085649617_create_users_table.down.sql │ │ │ │ │ ├── 1085649617_create_users_table.up.sql │ │ │ │ │ ├── 1185749658_add_city_to_users.down.sql │ │ │ │ │ ├── 1185749658_add_city_to_users.up.sql │ │ │ │ │ ├── 1285849751_add_index_on_user_emails.down.sql │ │ │ │ │ ├── 1285849751_add_index_on_user_emails.up.sql │ │ │ │ │ ├── 1385949617_create_books_table.down.sql │ │ │ │ │ ├── 1385949617_create_books_table.up.sql │ │ │ │ │ ├── 1485949617_create_movies_table.down.sql │ │ │ │ │ ├── 1485949617_create_movies_table.up.sql │ │ │ │ │ ├── 1585849751_just_a_comment.up.sql │ │ │ │ │ ├── 1685849751_another_comment.up.sql │ │ │ │ │ ├── 1785849751_another_comment.up.sql │ │ │ │ │ └── 1885849751_another_comment.up.sql │ │ │ ├── github.go │ │ │ └── github_test.go │ │ ├── go-bindata │ │ │ ├── README.md │ │ │ ├── examples │ │ │ │ └── migrations │ │ │ │ │ └── bindata.go │ │ │ ├── go-bindata.go │ │ │ ├── go-bindata_test.go │ │ │ └── testdata │ │ │ │ └── bindata.go │ │ ├── google-cloud-storage │ │ │ ├── README.md │ │ │ ├── storage.go │ │ │ └── storage_test.go │ │ ├── migration.go │ │ ├── migration_test.go │ │ ├── parse.go │ │ ├── parse_test.go │ │ ├── stub │ │ │ ├── stub.go │ │ │ └── stub_test.go │ │ └── testing │ │ │ └── testing.go │ │ ├── testing │ │ ├── docker.go │ │ ├── testing.go │ │ └── testing_test.go │ │ ├── util.go │ │ └── util_test.go ├── neelance │ └── graphql-go │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── errors │ │ └── errors.go │ │ ├── example │ │ └── starwars │ │ │ ├── server │ │ │ └── server.go │ │ │ └── starwars.go │ │ ├── gqltesting │ │ └── testing.go │ │ ├── graphql.go │ │ ├── graphql_test.go │ │ ├── internal │ │ ├── common │ │ │ ├── directive.go │ │ │ ├── lexer.go │ │ │ ├── literals.go │ │ │ ├── types.go │ │ │ └── values.go │ │ ├── exec │ │ │ ├── exec.go │ │ │ ├── packer │ │ │ │ └── packer.go │ │ │ ├── resolvable │ │ │ │ ├── meta.go │ │ │ │ └── resolvable.go │ │ │ └── selected │ │ │ │ └── selected.go │ │ ├── query │ │ │ └── query.go │ │ ├── schema │ │ │ ├── meta.go │ │ │ └── schema.go │ │ ├── tests │ │ │ ├── all_test.go │ │ │ ├── empty.go │ │ │ └── testdata │ │ │ │ ├── LICENSE │ │ │ │ ├── export.js │ │ │ │ ├── gen.go │ │ │ │ └── tests.json │ │ └── validation │ │ │ ├── suggestion.go │ │ │ └── validation.go │ │ ├── introspection.go │ │ ├── introspection │ │ └── introspection.go │ │ ├── log │ │ └── log.go │ │ ├── relay │ │ ├── relay.go │ │ └── relay_test.go │ │ ├── time.go │ │ └── trace │ │ └── trace.go ├── opentracing │ └── opentracing-go │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── ext │ │ ├── tags.go │ │ └── tags_test.go │ │ ├── globaltracer.go │ │ ├── gocontext.go │ │ ├── gocontext_test.go │ │ ├── log │ │ ├── field.go │ │ ├── field_test.go │ │ └── util.go │ │ ├── mocktracer │ │ ├── mocklogrecord.go │ │ ├── mockspan.go │ │ ├── mocktracer.go │ │ ├── mocktracer_test.go │ │ └── propagation.go │ │ ├── noop.go │ │ ├── options_test.go │ │ ├── propagation.go │ │ ├── propagation_test.go │ │ ├── span.go │ │ ├── testtracer_test.go │ │ └── tracer.go └── satori │ └── go.uuid │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── benchmarks_test.go │ ├── uuid.go │ └── uuid_test.go └── golang.org └── x └── net ├── .gitattributes ├── .gitignore ├── AUTHORS ├── CONTRIBUTING.md ├── CONTRIBUTORS ├── LICENSE ├── PATENTS ├── README.md ├── bpf ├── asm.go ├── constants.go ├── doc.go ├── instructions.go ├── instructions_test.go ├── setter.go ├── testdata │ ├── all_instructions.bpf │ └── all_instructions.txt ├── vm.go ├── vm_aluop_test.go ├── vm_bpf_test.go ├── vm_extension_test.go ├── vm_instructions.go ├── vm_jump_test.go ├── vm_load_test.go ├── vm_ret_test.go ├── vm_scratch_test.go └── vm_test.go ├── codereview.cfg ├── context ├── context.go ├── context_test.go ├── ctxhttp │ ├── ctxhttp.go │ ├── ctxhttp_17_test.go │ ├── ctxhttp_pre17.go │ ├── ctxhttp_pre17_test.go │ └── ctxhttp_test.go ├── go17.go ├── go19.go ├── pre_go17.go ├── pre_go19.go └── withtimeout_test.go ├── dict └── dict.go ├── dns └── dnsmessage │ ├── example_test.go │ ├── message.go │ └── message_test.go ├── html ├── atom │ ├── atom.go │ ├── atom_test.go │ ├── gen.go │ ├── table.go │ └── table_test.go ├── charset │ ├── charset.go │ ├── charset_test.go │ └── testdata │ │ ├── HTTP-charset.html │ │ ├── HTTP-vs-UTF-8-BOM.html │ │ ├── HTTP-vs-meta-charset.html │ │ ├── HTTP-vs-meta-content.html │ │ ├── No-encoding-declaration.html │ │ ├── README │ │ ├── UTF-16BE-BOM.html │ │ ├── UTF-16LE-BOM.html │ │ ├── UTF-8-BOM-vs-meta-charset.html │ │ ├── UTF-8-BOM-vs-meta-content.html │ │ ├── meta-charset-attribute.html │ │ └── meta-content-attribute.html ├── const.go ├── doc.go ├── doctype.go ├── entity.go ├── entity_test.go ├── escape.go ├── escape_test.go ├── example_test.go ├── foreign.go ├── node.go ├── node_test.go ├── parse.go ├── parse_test.go ├── render.go ├── render_test.go ├── testdata │ ├── go1.html │ └── webkit │ │ ├── README │ │ ├── adoption01.dat │ │ ├── adoption02.dat │ │ ├── comments01.dat │ │ ├── doctype01.dat │ │ ├── entities01.dat │ │ ├── entities02.dat │ │ ├── html5test-com.dat │ │ ├── inbody01.dat │ │ ├── isindex.dat │ │ ├── pending-spec-changes-plain-text-unsafe.dat │ │ ├── pending-spec-changes.dat │ │ ├── plain-text-unsafe.dat │ │ ├── scriptdata01.dat │ │ ├── scripted │ │ ├── adoption01.dat │ │ └── webkit01.dat │ │ ├── tables01.dat │ │ ├── tests1.dat │ │ ├── tests10.dat │ │ ├── tests11.dat │ │ ├── tests12.dat │ │ ├── tests14.dat │ │ ├── tests15.dat │ │ ├── tests16.dat │ │ ├── tests17.dat │ │ ├── tests18.dat │ │ ├── tests19.dat │ │ ├── tests2.dat │ │ ├── tests20.dat │ │ ├── tests21.dat │ │ ├── tests22.dat │ │ ├── tests23.dat │ │ ├── tests24.dat │ │ ├── tests25.dat │ │ ├── tests26.dat │ │ ├── tests3.dat │ │ ├── tests4.dat │ │ ├── tests5.dat │ │ ├── tests6.dat │ │ ├── tests7.dat │ │ ├── tests8.dat │ │ ├── tests9.dat │ │ ├── tests_innerHTML_1.dat │ │ ├── tricky01.dat │ │ ├── webkit01.dat │ │ └── webkit02.dat ├── token.go └── token_test.go ├── http2 ├── .gitignore ├── Dockerfile ├── Makefile ├── README ├── ciphers.go ├── ciphers_test.go ├── client_conn_pool.go ├── configure_transport.go ├── databuffer.go ├── databuffer_test.go ├── errors.go ├── errors_test.go ├── flow.go ├── flow_test.go ├── frame.go ├── frame_test.go ├── go16.go ├── go17.go ├── go17_not18.go ├── go18.go ├── go18_test.go ├── go19.go ├── go19_test.go ├── gotrack.go ├── gotrack_test.go ├── h2demo │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── h2demo.go │ ├── launch.go │ ├── rootCA.key │ ├── rootCA.pem │ ├── rootCA.srl │ ├── server.crt │ ├── server.key │ └── tmpl.go ├── h2i │ ├── README.md │ └── h2i.go ├── headermap.go ├── hpack │ ├── encode.go │ ├── encode_test.go │ ├── hpack.go │ ├── hpack_test.go │ ├── huffman.go │ ├── tables.go │ └── tables_test.go ├── http2.go ├── http2_test.go ├── not_go16.go ├── not_go17.go ├── not_go18.go ├── not_go19.go ├── pipe.go ├── pipe_test.go ├── server.go ├── server_push_test.go ├── server_test.go ├── testdata │ └── draft-ietf-httpbis-http2.xml ├── transport.go ├── transport_test.go ├── write.go ├── writesched.go ├── writesched_priority.go ├── writesched_priority_test.go ├── writesched_random.go ├── writesched_random_test.go ├── writesched_test.go └── z_spec_test.go ├── icmp ├── dstunreach.go ├── echo.go ├── endpoint.go ├── example_test.go ├── extension.go ├── extension_test.go ├── helper_posix.go ├── interface.go ├── ipv4.go ├── ipv4_test.go ├── ipv6.go ├── listen_posix.go ├── listen_stub.go ├── message.go ├── message_test.go ├── messagebody.go ├── mpls.go ├── multipart.go ├── multipart_test.go ├── packettoobig.go ├── paramprob.go ├── ping_test.go ├── sys_freebsd.go └── timeexceeded.go ├── idna ├── example_test.go ├── idna.go ├── idna_test.go ├── punycode.go ├── punycode_test.go ├── tables.go ├── trie.go └── trieval.go ├── internal ├── iana │ ├── const.go │ └── gen.go ├── nettest │ ├── helper_bsd.go │ ├── helper_nobsd.go │ ├── helper_posix.go │ ├── helper_stub.go │ ├── helper_unix.go │ ├── helper_windows.go │ ├── interface.go │ ├── rlimit.go │ └── stack.go ├── socket │ ├── cmsghdr.go │ ├── cmsghdr_bsd.go │ ├── cmsghdr_linux_32bit.go │ ├── cmsghdr_linux_64bit.go │ ├── cmsghdr_solaris_64bit.go │ ├── cmsghdr_stub.go │ ├── defs_darwin.go │ ├── defs_dragonfly.go │ ├── defs_freebsd.go │ ├── defs_linux.go │ ├── defs_netbsd.go │ ├── defs_openbsd.go │ ├── defs_solaris.go │ ├── error_unix.go │ ├── error_windows.go │ ├── iovec_32bit.go │ ├── iovec_64bit.go │ ├── iovec_solaris_64bit.go │ ├── iovec_stub.go │ ├── mmsghdr_stub.go │ ├── mmsghdr_unix.go │ ├── msghdr_bsd.go │ ├── msghdr_bsdvar.go │ ├── msghdr_linux.go │ ├── msghdr_linux_32bit.go │ ├── msghdr_linux_64bit.go │ ├── msghdr_openbsd.go │ ├── msghdr_solaris_64bit.go │ ├── msghdr_stub.go │ ├── rawconn.go │ ├── rawconn_mmsg.go │ ├── rawconn_msg.go │ ├── rawconn_nommsg.go │ ├── rawconn_nomsg.go │ ├── rawconn_stub.go │ ├── reflect.go │ ├── socket.go │ ├── socket_go1_9_test.go │ ├── socket_test.go │ ├── sys.go │ ├── sys_bsd.go │ ├── sys_bsdvar.go │ ├── sys_darwin.go │ ├── sys_dragonfly.go │ ├── sys_linux.go │ ├── sys_linux_386.go │ ├── sys_linux_386.s │ ├── sys_linux_amd64.go │ ├── sys_linux_arm.go │ ├── sys_linux_arm64.go │ ├── sys_linux_mips.go │ ├── sys_linux_mips64.go │ ├── sys_linux_mips64le.go │ ├── sys_linux_mipsle.go │ ├── sys_linux_ppc64.go │ ├── sys_linux_ppc64le.go │ ├── sys_linux_s390x.go │ ├── sys_linux_s390x.s │ ├── sys_netbsd.go │ ├── sys_posix.go │ ├── sys_solaris.go │ ├── sys_solaris_amd64.s │ ├── sys_stub.go │ ├── sys_unix.go │ ├── sys_windows.go │ ├── zsys_darwin_386.go │ ├── zsys_darwin_amd64.go │ ├── zsys_darwin_arm.go │ ├── zsys_dragonfly_amd64.go │ ├── zsys_freebsd_386.go │ ├── zsys_freebsd_amd64.go │ ├── zsys_freebsd_arm.go │ ├── zsys_linux_386.go │ ├── zsys_linux_amd64.go │ ├── zsys_linux_arm.go │ ├── zsys_linux_arm64.go │ ├── zsys_linux_mips.go │ ├── zsys_linux_mips64.go │ ├── zsys_linux_mips64le.go │ ├── zsys_linux_mipsle.go │ ├── zsys_linux_ppc64.go │ ├── zsys_linux_ppc64le.go │ ├── zsys_linux_s390x.go │ ├── zsys_netbsd_386.go │ ├── zsys_netbsd_amd64.go │ ├── zsys_netbsd_arm.go │ ├── zsys_openbsd_386.go │ ├── zsys_openbsd_amd64.go │ ├── zsys_openbsd_arm.go │ └── zsys_solaris_amd64.go └── timeseries │ ├── timeseries.go │ └── timeseries_test.go ├── ipv4 ├── batch.go ├── bpf_test.go ├── control.go ├── control_bsd.go ├── control_pktinfo.go ├── control_stub.go ├── control_test.go ├── control_unix.go ├── control_windows.go ├── defs_darwin.go ├── defs_dragonfly.go ├── defs_freebsd.go ├── defs_linux.go ├── defs_netbsd.go ├── defs_openbsd.go ├── defs_solaris.go ├── dgramopt.go ├── doc.go ├── endpoint.go ├── example_test.go ├── gen.go ├── genericopt.go ├── header.go ├── header_test.go ├── helper.go ├── iana.go ├── icmp.go ├── icmp_linux.go ├── icmp_stub.go ├── icmp_test.go ├── multicast_test.go ├── multicastlistener_test.go ├── multicastsockopt_test.go ├── packet.go ├── packet_go1_8.go ├── packet_go1_9.go ├── payload.go ├── payload_cmsg.go ├── payload_cmsg_go1_8.go ├── payload_cmsg_go1_9.go ├── payload_nocmsg.go ├── readwrite_go1_8_test.go ├── readwrite_go1_9_test.go ├── readwrite_test.go ├── sockopt.go ├── sockopt_posix.go ├── sockopt_stub.go ├── sys_asmreq.go ├── sys_asmreq_stub.go ├── sys_asmreqn.go ├── sys_asmreqn_stub.go ├── sys_bpf.go ├── sys_bpf_stub.go ├── sys_bsd.go ├── sys_darwin.go ├── sys_dragonfly.go ├── sys_freebsd.go ├── sys_linux.go ├── sys_solaris.go ├── sys_ssmreq.go ├── sys_ssmreq_stub.go ├── sys_stub.go ├── sys_windows.go ├── unicast_test.go ├── unicastsockopt_test.go ├── zsys_darwin.go ├── zsys_dragonfly.go ├── zsys_freebsd_386.go ├── zsys_freebsd_amd64.go ├── zsys_freebsd_arm.go ├── zsys_linux_386.go ├── zsys_linux_amd64.go ├── zsys_linux_arm.go ├── zsys_linux_arm64.go ├── zsys_linux_mips.go ├── zsys_linux_mips64.go ├── zsys_linux_mips64le.go ├── zsys_linux_mipsle.go ├── zsys_linux_ppc.go ├── zsys_linux_ppc64.go ├── zsys_linux_ppc64le.go ├── zsys_linux_s390x.go ├── zsys_netbsd.go ├── zsys_openbsd.go └── zsys_solaris.go ├── ipv6 ├── batch.go ├── bpf_test.go ├── control.go ├── control_rfc2292_unix.go ├── control_rfc3542_unix.go ├── control_stub.go ├── control_test.go ├── control_unix.go ├── control_windows.go ├── defs_darwin.go ├── defs_dragonfly.go ├── defs_freebsd.go ├── defs_linux.go ├── defs_netbsd.go ├── defs_openbsd.go ├── defs_solaris.go ├── dgramopt.go ├── doc.go ├── endpoint.go ├── example_test.go ├── gen.go ├── genericopt.go ├── header.go ├── header_test.go ├── helper.go ├── iana.go ├── icmp.go ├── icmp_bsd.go ├── icmp_linux.go ├── icmp_solaris.go ├── icmp_stub.go ├── icmp_test.go ├── icmp_windows.go ├── mocktransponder_test.go ├── multicast_test.go ├── multicastlistener_test.go ├── multicastsockopt_test.go ├── payload.go ├── payload_cmsg.go ├── payload_cmsg_go1_8.go ├── payload_cmsg_go1_9.go ├── payload_nocmsg.go ├── readwrite_go1_8_test.go ├── readwrite_go1_9_test.go ├── readwrite_test.go ├── sockopt.go ├── sockopt_posix.go ├── sockopt_stub.go ├── sockopt_test.go ├── sys_asmreq.go ├── sys_asmreq_stub.go ├── sys_bpf.go ├── sys_bpf_stub.go ├── sys_bsd.go ├── sys_darwin.go ├── sys_freebsd.go ├── sys_linux.go ├── sys_solaris.go ├── sys_ssmreq.go ├── sys_ssmreq_stub.go ├── sys_stub.go ├── sys_windows.go ├── unicast_test.go ├── unicastsockopt_test.go ├── zsys_darwin.go ├── zsys_dragonfly.go ├── zsys_freebsd_386.go ├── zsys_freebsd_amd64.go ├── zsys_freebsd_arm.go ├── zsys_linux_386.go ├── zsys_linux_amd64.go ├── zsys_linux_arm.go ├── zsys_linux_arm64.go ├── zsys_linux_mips.go ├── zsys_linux_mips64.go ├── zsys_linux_mips64le.go ├── zsys_linux_mipsle.go ├── zsys_linux_ppc.go ├── zsys_linux_ppc64.go ├── zsys_linux_ppc64le.go ├── zsys_linux_s390x.go ├── zsys_netbsd.go ├── zsys_openbsd.go └── zsys_solaris.go ├── lex └── httplex │ ├── httplex.go │ └── httplex_test.go ├── lif ├── address.go ├── address_test.go ├── binary.go ├── defs_solaris.go ├── lif.go ├── link.go ├── link_test.go ├── sys.go ├── sys_solaris_amd64.s ├── syscall.go └── zsys_solaris_amd64.go ├── nettest ├── conntest.go ├── conntest_go16.go ├── conntest_go17.go └── conntest_test.go ├── netutil ├── listen.go └── listen_test.go ├── proxy ├── direct.go ├── per_host.go ├── per_host_test.go ├── proxy.go ├── proxy_test.go └── socks5.go ├── publicsuffix ├── gen.go ├── list.go ├── list_test.go ├── table.go └── table_test.go ├── route ├── address.go ├── address_darwin_test.go ├── address_test.go ├── binary.go ├── defs_darwin.go ├── defs_dragonfly.go ├── defs_freebsd.go ├── defs_netbsd.go ├── defs_openbsd.go ├── interface.go ├── interface_announce.go ├── interface_classic.go ├── interface_freebsd.go ├── interface_multicast.go ├── interface_openbsd.go ├── message.go ├── message_darwin_test.go ├── message_freebsd_test.go ├── message_test.go ├── route.go ├── route_classic.go ├── route_openbsd.go ├── route_test.go ├── sys.go ├── sys_darwin.go ├── sys_dragonfly.go ├── sys_freebsd.go ├── sys_netbsd.go ├── sys_openbsd.go ├── syscall.go ├── zsys_darwin.go ├── zsys_dragonfly.go ├── zsys_freebsd_386.go ├── zsys_freebsd_amd64.go ├── zsys_freebsd_arm.go ├── zsys_netbsd.go └── zsys_openbsd.go ├── trace ├── events.go ├── histogram.go ├── histogram_test.go ├── trace.go ├── trace_go16.go ├── trace_go17.go └── trace_test.go ├── webdav ├── file.go ├── file_go1.6.go ├── file_go1.7.go ├── file_test.go ├── if.go ├── if_test.go ├── internal │ └── xml │ │ ├── README │ │ ├── atom_test.go │ │ ├── example_test.go │ │ ├── marshal.go │ │ ├── marshal_test.go │ │ ├── read.go │ │ ├── read_test.go │ │ ├── typeinfo.go │ │ ├── xml.go │ │ └── xml_test.go ├── litmus_test_server.go ├── lock.go ├── lock_test.go ├── prop.go ├── prop_test.go ├── webdav.go ├── webdav_test.go ├── xml.go └── xml_test.go ├── websocket ├── client.go ├── dial.go ├── dial_test.go ├── exampledial_test.go ├── examplehandler_test.go ├── hybi.go ├── hybi_test.go ├── server.go ├── websocket.go └── websocket_test.go └── xsrftoken ├── xsrf.go └── xsrf_test.go /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | [[constraint]] 2 | branch = "master" 3 | name = "github.com/neelance/graphql-go" 4 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [2017] [Graphcool] 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hackernews Go Example 2 | 3 | ## Setup 4 | 1. `go get -u github.com/howtographql/graphql-go` 5 | 2. `cd ${GOPATH}/src/github.com/howtographql/graphql-go` 6 | 3. `docker-compose up -d` 7 | 4. `go run main.go` 8 | 5. Execute queries in GraphiQL by visiting http://localhost:8080/ 9 | -------------------------------------------------------------------------------- /db/migrations/1_create_link.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS link; 2 | -------------------------------------------------------------------------------- /db/migrations/1_create_link.up.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE TABLE IF NOT EXISTS link ( 3 | id VARCHAR(100) PRIMARY KEY UNIQUE, 4 | url TEXT, 5 | description TEXT 6 | ); 7 | -------------------------------------------------------------------------------- /db/migrations/2_create_user.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS user; 2 | -------------------------------------------------------------------------------- /db/migrations/2_create_user.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS users ( 2 | id VARCHAR(100) PRIMARY KEY UNIQUE, 3 | name VARCHAR(100), 4 | email VARCHAR(100), 5 | password VARCHAR(100) 6 | ); 7 | -------------------------------------------------------------------------------- /db/migrations/3_add_postedby_to_link.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE link DROP COLUMN posted_by; -------------------------------------------------------------------------------- /db/migrations/3_add_postedby_to_link.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE link ADD COLUMN posted_by VARCHAR(100) REFERENCES users(id); -------------------------------------------------------------------------------- /db/migrations/4_create_vote.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS vote; 2 | -------------------------------------------------------------------------------- /db/migrations/4_create_vote.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS vote ( 2 | id VARCHAR(100) PRIMARY KEY UNIQUE, 3 | created_at VARCHAR(100), 4 | user_id VARCHAR(100) REFERENCES users (id), 5 | link_id VARCHAR(100) REFERENCES link (id) 6 | ); 7 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | postgres: 5 | image: postgres:9.6 6 | ports: 7 | - 5432:5432 8 | environment: 9 | - POSTGRES_DB=hackernews 10 | -------------------------------------------------------------------------------- /schema.graphqls: -------------------------------------------------------------------------------- 1 | type Link { 2 | id: String! 3 | url: String! 4 | description: String! 5 | postedBy: User 6 | votes: [Vote!]! 7 | } 8 | 9 | type User { 10 | id: ID! 11 | name: String! 12 | email: String 13 | password: String 14 | votes: [Vote!]! 15 | } 16 | 17 | input AuthData { 18 | email: String! 19 | password: String! 20 | } 21 | 22 | type SigninPayload { 23 | token: String 24 | user: User 25 | } 26 | 27 | type Vote { 28 | id: ID! 29 | createdAt: Time! 30 | user: User! 31 | link: Link! 32 | } 33 | 34 | scalar Time 35 | 36 | type Query { 37 | allLinks: [Link] 38 | } 39 | 40 | type Mutation { 41 | createUser(name: String!, authProvider: AuthData!): User 42 | createLink(url: String!, description: String!): Link 43 | signinUser(auth: AuthData): SigninPayload 44 | createVote(linkId: ID, userId: ID): Vote 45 | } 46 | 47 | schema { 48 | query: Query 49 | mutation: Mutation 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.gitignore: -------------------------------------------------------------------------------- 1 | .db 2 | *.test 3 | *~ 4 | *.swp 5 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2013, 'pq' Contributors 2 | Portions Copyright (C) 2011 Blake Mizerany 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/certs/README: -------------------------------------------------------------------------------- 1 | This directory contains certificates and private keys for testing some 2 | SSL-related functionality in Travis. Do NOT use these certificates for 3 | anything other than testing. 4 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/certs/bogus_root.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBjCCAe6gAwIBAgIQSnDYp/Naet9HOZljF5PuwDANBgkqhkiG9w0BAQsFADAr 3 | MRIwEAYDVQQKEwlDb2Nrcm9hY2gxFTATBgNVBAMTDENvY2tyb2FjaCBDQTAeFw0x 4 | NjAyMDcxNjQ0MzdaFw0xNzAyMDYxNjQ0MzdaMCsxEjAQBgNVBAoTCUNvY2tyb2Fj 5 | aDEVMBMGA1UEAxMMQ29ja3JvYWNoIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A 6 | MIIBCgKCAQEAxdln3/UdgP7ayA/G1kT7upjLe4ERwQjYQ25q0e1+vgsB5jhiirxJ 7 | e0+WkhhYu/mwoSAXzvlsbZ2PWFyfdanZeD/Lh6SvIeWXVVaPcWVWL1TEcoN2jr5+ 8 | E85MMHmbbmaT2he8s6br2tM/UZxyTQ2XRprIzApbDssyw1c0Yufcpu3C6267FLEl 9 | IfcWrzDhnluFhthhtGXv3ToD8IuMScMC5qlKBXtKmD1B5x14ngO/ecNJ+OlEi0HU 10 | mavK4KWgI2rDXRZ2EnCpyTZdkc3kkRnzKcg653oOjMDRZdrhfIrha+Jq38ACsUmZ 11 | Su7Sp5jkIHOCO8Zg+l6GKVSq37dKMapD8wIDAQABoyYwJDAOBgNVHQ8BAf8EBAMC 12 | AuQwEgYDVR0TAQH/BAgwBgEB/wIBATANBgkqhkiG9w0BAQsFAAOCAQEAwZ2Tu0Yu 13 | rrSVdMdoPEjT1IZd+5OhM/SLzL0ddtvTithRweLHsw2lDQYlXFqr24i3UGZJQ1sp 14 | cqSrNwswgLUQT3vWyTjmM51HEb2vMYWKmjZ+sBQYAUP1CadrN/+OTfNGnlF1+B4w 15 | IXOzh7EvQmJJnNybLe4a/aRvj1NE2n8Z898B76SVU9WbfKKz8VwLzuIPDqkKcZda 16 | lMy5yzthyztV9YjcWs2zVOUGZvGdAhDrvZuUq6mSmxrBEvR2LBOggmVf3tGRT+Ls 17 | lW7c9Lrva5zLHuqmoPP07A+vuI9a0D1X44jwGDuPWJ5RnTOQ63Uez12mKNjqleHw 18 | DnkwNanuO8dhAA== 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/certs/postgresql.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICWwIBAAKBgQDjjAaacFRR0TQ0gznNolkPBe2N2A400JL0CU3ujHhVSST4POA0 3 | WAKy55RYwejlu9Gv9lTBQLGQcHkNNVScjxbpwvCS5mRJOMF2+EdmxFtKtqlDzsi+ 4 | bE0rlJc8VbzR0G63U66JXEtrhkC+wa4eZM6crocKaeXIIRK+rh32Rd8WpwIDAQAB 5 | AoGAM5dM6/kp9P700i8qjOgRPym96Zoh5nGfz/rIE5z/r36NBkdvIg8OVZfR96nH 6 | b0b9TOMR5lsPp0sI9yivTWvX6qyvLJRWy2vvx17hXK9NxXUNTAm0PYZUTvCtcPeX 7 | RnJpzQKNZQPkFzF0uXBc4CtPK2Vz0+FGvAelrhYAxnw1dIkCQQD+9qaW5QhXjsjb 8 | Nl85CmXgxPmGROcgLQCO+omfrjf9UXrituU9Dz6auym5lDGEdMFnkzfr+wpasEy9 9 | mf5ZZOhDAkEA5HjXfVGaCtpydOt6hDon/uZsyssCK2lQ7NSuE3vP+sUsYMzIpEoy 10 | t3VWXqKbo+g9KNDTP4WEliqp1aiSIylzzQJANPeqzihQnlgEdD4MdD4rwhFJwVIp 11 | Le8Lcais1KaN7StzOwxB/XhgSibd2TbnPpw+3bSg5n5lvUdo+e62/31OHwJAU1jS 12 | I+F09KikQIr28u3UUWT2IzTT4cpVv1AHAQyV3sG3YsjSGT0IK20eyP9BEBZU2WL0 13 | 7aNjrvR5aHxKc5FXsQJABsFtyGpgI5X4xufkJZVZ+Mklz2n7iXa+XPatMAHFxAtb 14 | EEMt60rngwMjXAzBSC6OYuYogRRAY3UCacNC5VhLYQ== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/issues_test.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import "testing" 4 | 5 | func TestIssue494(t *testing.T) { 6 | db := openTestConn(t) 7 | defer db.Close() 8 | 9 | query := `CREATE TEMP TABLE t (i INT PRIMARY KEY)` 10 | if _, err := db.Exec(query); err != nil { 11 | t.Fatal(err) 12 | } 13 | 14 | txn, err := db.Begin() 15 | if err != nil { 16 | t.Fatal(err) 17 | } 18 | 19 | if _, err := txn.Prepare(CopyIn("t", "i")); err != nil { 20 | t.Fatal(err) 21 | } 22 | 23 | if _, err := txn.Query("SELECT 1"); err == nil { 24 | t.Fatal("expected error") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/oid/doc.go: -------------------------------------------------------------------------------- 1 | // Package oid contains OID constants 2 | // as defined by the Postgres server. 3 | package oid 4 | 5 | // Oid is a Postgres Object ID. 6 | type Oid uint32 7 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_go1.7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package pq 4 | 5 | import "crypto/tls" 6 | 7 | // Accept renegotiation requests initiated by the backend. 8 | // 9 | // Renegotiation was deprecated then removed from PostgreSQL 9.5, but 10 | // the default configuration of older versions has it enabled. Redshift 11 | // also initiates renegotiations and cannot be reconfigured. 12 | func sslRenegotiation(conf *tls.Config) { 13 | conf.Renegotiation = tls.RenegotiateFreelyAsClient 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_permissions.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package pq 4 | 5 | import "os" 6 | 7 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 8 | // The key file should have very little access. 9 | // 10 | // libpq does not check key file permissions on Windows. 11 | func sslKeyPermissions(sslkey string) error { 12 | info, err := os.Stat(sslkey) 13 | if err != nil { 14 | return err 15 | } 16 | if info.Mode().Perm()&0077 != 0 { 17 | return ErrSSLKeyHasWorldPermissions 18 | } 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_renegotiation.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package pq 4 | 5 | import "crypto/tls" 6 | 7 | // Renegotiation is not supported by crypto/tls until Go 1.7. 8 | func sslRenegotiation(*tls.Config) {} 9 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package pq 4 | 5 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 6 | // The key file should have very little access. 7 | // 8 | // libpq does not check key file permissions on Windows. 9 | func sslKeyPermissions(string) error { return nil } 10 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_posix.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris rumprun 4 | 5 | package pq 6 | 7 | import ( 8 | "os" 9 | "os/user" 10 | ) 11 | 12 | func userCurrent() (string, error) { 13 | u, err := user.Current() 14 | if err == nil { 15 | return u.Username, nil 16 | } 17 | 18 | name := os.Getenv("USER") 19 | if name != "" { 20 | return name, nil 21 | } 22 | 23 | return "", ErrCouldNotDetectUsername 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_windows.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | package pq 3 | 4 | import ( 5 | "path/filepath" 6 | "syscall" 7 | ) 8 | 9 | // Perform Windows user name lookup identically to libpq. 10 | // 11 | // The PostgreSQL code makes use of the legacy Win32 function 12 | // GetUserName, and that function has not been imported into stock Go. 13 | // GetUserNameEx is available though, the difference being that a 14 | // wider range of names are available. To get the output to be the 15 | // same as GetUserName, only the base (or last) component of the 16 | // result is returned. 17 | func userCurrent() (string, error) { 18 | pw_name := make([]uint16, 128) 19 | pwname_size := uint32(len(pw_name)) - 1 20 | err := syscall.GetUserNameEx(syscall.NameSamCompatible, &pw_name[0], &pwname_size) 21 | if err != nil { 22 | return "", ErrCouldNotDetectUsername 23 | } 24 | s := syscall.UTF16ToString(pw_name) 25 | u := filepath.Base(s) 26 | return u, nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/uuid.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "encoding/hex" 5 | "fmt" 6 | ) 7 | 8 | // decodeUUIDBinary interprets the binary format of a uuid, returning it in text format. 9 | func decodeUUIDBinary(src []byte) ([]byte, error) { 10 | if len(src) != 16 { 11 | return nil, fmt.Errorf("pq: unable to decode uuid; bad length: %d", len(src)) 12 | } 13 | 14 | dst := make([]byte, 36) 15 | dst[8], dst[13], dst[18], dst[23] = '-', '-', '-', '-' 16 | hex.Encode(dst[0:], src[0:4]) 17 | hex.Encode(dst[9:], src[4:6]) 18 | hex.Encode(dst[14:], src[6:8]) 19 | hex.Encode(dst[19:], src[8:10]) 20 | hex.Encode(dst[24:], src[10:16]) 21 | 22 | return dst, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/uuid_test.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "reflect" 5 | "strings" 6 | "testing" 7 | ) 8 | 9 | func TestDecodeUUIDBinaryError(t *testing.T) { 10 | t.Parallel() 11 | _, err := decodeUUIDBinary([]byte{0x12, 0x34}) 12 | 13 | if err == nil { 14 | t.Fatal("Expected error, got none") 15 | } 16 | if !strings.HasPrefix(err.Error(), "pq:") { 17 | t.Errorf("Expected error to start with %q, got %q", "pq:", err.Error()) 18 | } 19 | if !strings.Contains(err.Error(), "bad length: 2") { 20 | t.Errorf("Expected error to contain length, got %q", err.Error()) 21 | } 22 | } 23 | 24 | func BenchmarkDecodeUUIDBinary(b *testing.B) { 25 | x := []byte{0x03, 0xa3, 0x52, 0x2f, 0x89, 0x28, 0x49, 0x87, 0x84, 0xd6, 0x93, 0x7b, 0x36, 0xec, 0x27, 0x6f} 26 | 27 | for i := 0; i < b.N; i++ { 28 | decodeUUIDBinary(x) 29 | } 30 | } 31 | 32 | func TestDecodeUUIDBackend(t *testing.T) { 33 | db := openTestConn(t) 34 | defer db.Close() 35 | 36 | var s = "a0ecc91d-a13f-4fe4-9fce-7e09777cc70a" 37 | var scanned interface{} 38 | 39 | err := db.QueryRow(`SELECT $1::uuid`, s).Scan(&scanned) 40 | if err != nil { 41 | t.Fatalf("Expected no error, got %v", err) 42 | } 43 | if !reflect.DeepEqual(scanned, []byte(s)) { 44 | t.Errorf("Expected []byte(%q), got %T(%q)", s, scanned, scanned) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | cli/build 3 | cli/cli 4 | cli/migrate 5 | .coverage 6 | .godoc.pid 7 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Development, Testing and Contributing 2 | 3 | 1. Make sure you have a running Docker daemon 4 | (Install for [MacOS](https://docs.docker.com/docker-for-mac/)) 5 | 2. Fork this repo and `git clone` somewhere to `$GOPATH/src/github.com/%you%/migrate` 6 | 3. `make rewrite-import-paths` to update imports to your local fork 7 | 4. Confirm tests are working: `make test-short` 8 | 5. Write awesome code ... 9 | 6. `make test` to run all tests against all database versions 10 | 7. `make restore-import-paths` to restore import paths 11 | 8. Push code and open Pull Request 12 | 13 | Some more helpful commands: 14 | 15 | * You can specify which database/ source tests to run: 16 | `make test-short SOURCE='file go-bindata' DATABASE='postgres cassandra'` 17 | * After `make test`, run `make html-coverage` which opens a shiny test coverage overview. 18 | * Missing imports? `make deps` 19 | * `make build-cli` builds the CLI in directory `cli/build/`. 20 | * `make list-external-deps` lists all external dependencies for each package 21 | * `make docs && make open-docs` opens godoc in your browser, `make kill-docs` kills the godoc server. 22 | Repeatedly call `make docs` to refresh the server. 23 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Matthias Kadenbach 4 | 5 | https://github.com/mattes/migrate 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/MIGRATIONS.md: -------------------------------------------------------------------------------- 1 | # Migrations 2 | 3 | ## Best practices: How to write migrations. 4 | 5 | @TODO 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/build_aws-s3.go: -------------------------------------------------------------------------------- 1 | // +build aws-s3 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/mattes/migrate/source/aws-s3" 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/build_github.go: -------------------------------------------------------------------------------- 1 | // +build github 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/mattes/migrate/source/github" 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/build_go-bindata.go: -------------------------------------------------------------------------------- 1 | // +build go-bindata 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/mattes/migrate/source/go-bindata" 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/build_google-cloud-storage.go: -------------------------------------------------------------------------------- 1 | // +build google-cloud-storage 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/mattes/migrate/source/google-cloud-storage" 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/build_mysql.go: -------------------------------------------------------------------------------- 1 | // +build mysql 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/mattes/migrate/database/mysql" 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/build_postgres.go: -------------------------------------------------------------------------------- 1 | // +build postgres 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/mattes/migrate/database/postgres" 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/build_ql.go: -------------------------------------------------------------------------------- 1 | // +build ql 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/mattes/migrate/database/ql" 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/build_redshift.go: -------------------------------------------------------------------------------- 1 | // +build redshift 2 | 3 | package main 4 | 5 | import ( 6 | _ "github.com/mattes/migrate/database/redshift" 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/examples/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:xenial 2 | 3 | RUN apt-get update && \ 4 | apt-get install -y curl apt-transport-https 5 | 6 | RUN curl -L https://packagecloud.io/mattes/migrate/gpgkey | apt-key add - && \ 7 | echo "deb https://packagecloud.io/mattes/migrate/ubuntu/ xenial main" > /etc/apt/sources.list.d/migrate.list && \ 8 | apt-get update && \ 9 | apt-get install -y migrate 10 | 11 | RUN migrate -version 12 | 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/log.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | logpkg "log" 6 | "os" 7 | ) 8 | 9 | type Log struct { 10 | verbose bool 11 | } 12 | 13 | func (l *Log) Printf(format string, v ...interface{}) { 14 | if l.verbose { 15 | logpkg.Printf(format, v...) 16 | } else { 17 | fmt.Fprintf(os.Stderr, format, v...) 18 | } 19 | } 20 | 21 | func (l *Log) Println(args ...interface{}) { 22 | if l.verbose { 23 | logpkg.Println(args...) 24 | } else { 25 | fmt.Fprintln(os.Stderr, args...) 26 | } 27 | } 28 | 29 | func (l *Log) Verbose() bool { 30 | return l.verbose 31 | } 32 | 33 | func (l *Log) fatalf(format string, v ...interface{}) { 34 | l.Printf(format, v...) 35 | os.Exit(1) 36 | } 37 | 38 | func (l *Log) fatal(args ...interface{}) { 39 | l.Println(args...) 40 | os.Exit(1) 41 | } 42 | 43 | func (l *Log) fatalErr(err error) { 44 | l.fatal("error:", err) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/cli/version.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // Version is set in Makefile with build flags 4 | var Version = "dev" 5 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/cassandra/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/howtographql/graphql-go/04819498d25a707965211f76e83031098a4e14e5/vendor/github.com/mattes/migrate/database/cassandra/README.md -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/crate/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/howtographql/graphql-go/04819498d25a707965211f76e83031098a4e14e5/vendor/github.com/mattes/migrate/database/crate/README.md -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/driver_test.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | func ExampleDriver() { 4 | // see database/stub for an example 5 | 6 | // database/stub/stub.go has the driver implementation 7 | // database/stub/stub_test.go runs database/testing/test.go:Test 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/error.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Error should be used for errors involving queries ran against the database 8 | type Error struct { 9 | // Optional: the line number 10 | Line uint 11 | 12 | // Query is a query excerpt 13 | Query []byte 14 | 15 | // Err is a useful/helping error message for humans 16 | Err string 17 | 18 | // OrigErr is the underlying error 19 | OrigErr error 20 | } 21 | 22 | func (e Error) Error() string { 23 | if len(e.Err) == 0 { 24 | return fmt.Sprintf("%v in line %v: %s", e.OrigErr, e.Line, e.Query) 25 | } 26 | return fmt.Sprintf("%v in line %v: %s (details: %v)", e.Err, e.Line, e.Query, e.OrigErr) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/mongodb/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/howtographql/graphql-go/04819498d25a707965211f76e83031098a4e14e5/vendor/github.com/mattes/migrate/database/mongodb/README.md -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/mysql/README.md: -------------------------------------------------------------------------------- 1 | # mysql 2 | 3 | `mysql://user:password@tcp(host:port)/dbname?query` 4 | 5 | | URL Query | WithInstance Config | Description | 6 | |------------|---------------------|-------------| 7 | | `x-migrations-table` | `MigrationsTable` | Name of the migrations table | 8 | | `dbname` | `DatabaseName` | The name of the database to connect to | 9 | | `user` | | The user to sign in as | 10 | | `password` | | The user's password | 11 | | `host` | | The host to connect to. | 12 | | `port` | | The port to bind to. | 13 | | `x-tls-ca` | | The location of the root certificate file. | 14 | | `x-tls-cert` | | Cert file location. | 15 | | `x-tls-key` | | Key file location. | 16 | | `x-tls-insecure-skip-verify` | | Whether or not to use SSL (true\|false) | 17 | 18 | ## Upgrading from v1 19 | 20 | 1. Write down the current migration version from schema_migrations 21 | 1. `DROP TABLE schema_migrations` 22 | 2. Wrap your existing migrations in transactions ([BEGIN/COMMIT](https://dev.mysql.com/doc/refman/5.7/en/commit.html)) if you use multiple statements within one migration. 23 | 3. Download and install the latest migrate version. 24 | 4. Force the current migration version with `migrate force `. 25 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/neo4j/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/howtographql/graphql-go/04819498d25a707965211f76e83031098a4e14e5/vendor/github.com/mattes/migrate/database/neo4j/README.md -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1085649617_create_users_table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS users; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1085649617_create_users_table.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE users ( 2 | user_id integer unique, 3 | name varchar(40), 4 | email varchar(40) 5 | ); 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1185749658_add_city_to_users.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE users DROP COLUMN IF EXISTS city; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1185749658_add_city_to_users.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE users ADD COLUMN city varchar(100); 2 | 3 | 4 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1285849751_add_index_on_user_emails.down.sql: -------------------------------------------------------------------------------- 1 | DROP INDEX IF EXISTS users_email_index; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1285849751_add_index_on_user_emails.up.sql: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX CONCURRENTLY users_email_index ON users (email); 2 | 3 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 4 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1385949617_create_books_table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS books; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1385949617_create_books_table.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE books ( 2 | user_id integer, 3 | name varchar(40), 4 | author varchar(40) 5 | ); 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1485949617_create_movies_table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS movies; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1485949617_create_movies_table.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE movies ( 2 | user_id integer, 3 | name varchar(40), 4 | director varchar(40) 5 | ); 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1585849751_just_a_comment.up.sql: -------------------------------------------------------------------------------- 1 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1685849751_another_comment.up.sql: -------------------------------------------------------------------------------- 1 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1785849751_another_comment.up.sql: -------------------------------------------------------------------------------- 1 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/postgres/examples/migrations/1885849751_another_comment.up.sql: -------------------------------------------------------------------------------- 1 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/ql/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/howtographql/graphql-go/04819498d25a707965211f76e83031098a4e14e5/vendor/github.com/mattes/migrate/database/ql/README.md -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/ql/migration/33_create_table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS pets; -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/ql/migration/33_create_table.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE pets ( 2 | name string 3 | ); -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/ql/migration/44_alter_table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS pets; -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/ql/migration/44_alter_table.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE pets ADD predator bool;; -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/redshift/README.md: -------------------------------------------------------------------------------- 1 | Redshift 2 | === 3 | 4 | This provides a Redshift driver for migrations. It is used whenever the URL of the database starts with `redshift://`. 5 | 6 | Redshift is PostgreSQL compatible but has some specific features (or lack thereof) that require slightly different behavior. 7 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/shell/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/howtographql/graphql-go/04819498d25a707965211f76e83031098a4e14e5/vendor/github.com/mattes/migrate/database/shell/README.md -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/sqlite/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/howtographql/graphql-go/04819498d25a707965211f76e83031098a4e14e5/vendor/github.com/mattes/migrate/database/sqlite/README.md -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/stub/stub_test.go: -------------------------------------------------------------------------------- 1 | package stub 2 | 3 | import ( 4 | "testing" 5 | 6 | dt "github.com/mattes/migrate/database/testing" 7 | ) 8 | 9 | func Test(t *testing.T) { 10 | s := &Stub{} 11 | d, err := s.Open("") 12 | if err != nil { 13 | t.Fatal(err) 14 | } 15 | dt.Test(t, d, []byte("/* foobar migration */")) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/util.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | import ( 4 | "fmt" 5 | "hash/crc32" 6 | ) 7 | 8 | const advisoryLockIdSalt uint = 1486364155 9 | 10 | // inspired by rails migrations, see https://goo.gl/8o9bCT 11 | func GenerateAdvisoryLockId(databaseName string) (string, error) { 12 | sum := crc32.ChecksumIEEE([]byte(databaseName)) 13 | sum = sum * uint32(advisoryLockIdSalt) 14 | return fmt.Sprintf("%v", sum), nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/database/util_test.go: -------------------------------------------------------------------------------- 1 | package database 2 | 3 | func TestGenerateAdvisoryLockId(t *testing.T) { 4 | id, err := p.generateAdvisoryLockId("database_name") 5 | if err != nil { 6 | t.Errorf("expected err to be nil, got %v", err) 7 | } 8 | if len(id) == 0 { 9 | t.Errorf("expected generated id not to be empty") 10 | } 11 | t.Logf("generated id: %v", id) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/log.go: -------------------------------------------------------------------------------- 1 | package migrate 2 | 3 | // Logger is an interface so you can pass in your own 4 | // logging implementation. 5 | type Logger interface { 6 | 7 | // Printf is like fmt.Printf 8 | Printf(format string, v ...interface{}) 9 | 10 | // Verbose should return true when verbose logging output is wanted 11 | Verbose() bool 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/aws-s3/README.md: -------------------------------------------------------------------------------- 1 | # aws-s3 2 | 3 | `s3:///` 4 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/driver_test.go: -------------------------------------------------------------------------------- 1 | package source 2 | 3 | func ExampleDriver() { 4 | // see source/stub for an example 5 | 6 | // source/stub/stub.go has the driver implementation 7 | // source/stub/stub_test.go runs source/testing/test.go:Test 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/file/README.md: -------------------------------------------------------------------------------- 1 | # file 2 | 3 | `file:///absolute/path` 4 | `file://relative/path` 5 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/.gitignore: -------------------------------------------------------------------------------- 1 | .github_test_secrets 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/README.md: -------------------------------------------------------------------------------- 1 | # github 2 | 3 | `github://user:personal-access-token@owner/repo/path` 4 | 5 | | URL Query | WithInstance Config | Description | 6 | |------------|---------------------|-------------| 7 | | user | | The username of the user connecting | 8 | | personal-access-token | | An access token from Github (https://github.com/settings/tokens) | 9 | | owner | | the repo owner | 10 | | repo | | the name of the repository | 11 | | path | | path in repo to migrations | 12 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1085649617_create_users_table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS users; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1085649617_create_users_table.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE users ( 2 | user_id integer unique, 3 | name varchar(40), 4 | email varchar(40) 5 | ); 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1185749658_add_city_to_users.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE users DROP COLUMN IF EXISTS city; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1185749658_add_city_to_users.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE users ADD COLUMN city varchar(100); 2 | 3 | 4 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1285849751_add_index_on_user_emails.down.sql: -------------------------------------------------------------------------------- 1 | DROP INDEX IF EXISTS users_email_index; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1285849751_add_index_on_user_emails.up.sql: -------------------------------------------------------------------------------- 1 | CREATE UNIQUE INDEX CONCURRENTLY users_email_index ON users (email); 2 | 3 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 4 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1385949617_create_books_table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS books; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1385949617_create_books_table.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE books ( 2 | user_id integer, 3 | name varchar(40), 4 | author varchar(40) 5 | ); 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1485949617_create_movies_table.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS movies; 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1485949617_create_movies_table.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE movies ( 2 | user_id integer, 3 | name varchar(40), 4 | director varchar(40) 5 | ); 6 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1585849751_just_a_comment.up.sql: -------------------------------------------------------------------------------- 1 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1685849751_another_comment.up.sql: -------------------------------------------------------------------------------- 1 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1785849751_another_comment.up.sql: -------------------------------------------------------------------------------- 1 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/examples/migrations/1885849751_another_comment.up.sql: -------------------------------------------------------------------------------- 1 | -- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. 2 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/github/github_test.go: -------------------------------------------------------------------------------- 1 | package github 2 | 3 | import ( 4 | "bytes" 5 | "io/ioutil" 6 | "testing" 7 | 8 | st "github.com/mattes/migrate/source/testing" 9 | ) 10 | 11 | var GithubTestSecret = "" // username:token 12 | 13 | func init() { 14 | secrets, err := ioutil.ReadFile(".github_test_secrets") 15 | if err == nil { 16 | GithubTestSecret = string(bytes.TrimSpace(secrets)[:]) 17 | } 18 | } 19 | 20 | func Test(t *testing.T) { 21 | if len(GithubTestSecret) == 0 { 22 | t.Skip("test requires .github_test_secrets") 23 | } 24 | 25 | g := &Github{} 26 | d, err := g.Open("github://" + GithubTestSecret + "@mattes/migrate_test_tmp/test") 27 | if err != nil { 28 | t.Fatal(err) 29 | } 30 | 31 | st.Test(t, d) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/go-bindata/README.md: -------------------------------------------------------------------------------- 1 | # go-bindata 2 | 3 | ## Usage 4 | 5 | 6 | 7 | ### Read bindata with NewWithSourceInstance 8 | 9 | ```shell 10 | go get -u github.com/jteeuwen/go-bindata/... 11 | cd examples/migrations && go-bindata -pkg migrations . 12 | ``` 13 | 14 | ```go 15 | import ( 16 | "github.com/mattes/migrate" 17 | "github.com/mattes/migrate/source/go-bindata" 18 | "github.com/mattes/migrate/source/go-bindata/examples/migrations" 19 | ) 20 | 21 | func main() { 22 | // wrap assets into Resource 23 | s := bindata.Resource(migrations.AssetNames(), 24 | func(name string) ([]byte, error) { 25 | return migrations.Asset(name) 26 | }) 27 | 28 | m, err := migrate.NewWithSourceInstance("go-bindata", s, "database://foobar") 29 | m.Up() // run your migrations and handle the errors above of course 30 | } 31 | ``` 32 | 33 | ### Read bindata with URL (todo) 34 | 35 | This will restore the assets in a tmp directory and then 36 | proxy to source/file. go-bindata must be in your `$PATH`. 37 | 38 | ``` 39 | migrate -source go-bindata://examples/migrations/bindata.go 40 | ``` 41 | 42 | 43 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/go-bindata/go-bindata_test.go: -------------------------------------------------------------------------------- 1 | package bindata 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/mattes/migrate/source/go-bindata/testdata" 7 | st "github.com/mattes/migrate/source/testing" 8 | ) 9 | 10 | func Test(t *testing.T) { 11 | // wrap assets into Resource first 12 | s := Resource(testdata.AssetNames(), 13 | func(name string) ([]byte, error) { 14 | return testdata.Asset(name) 15 | }) 16 | 17 | d, err := WithInstance(s) 18 | if err != nil { 19 | t.Fatal(err) 20 | } 21 | st.Test(t, d) 22 | } 23 | 24 | func TestWithInstance(t *testing.T) { 25 | // wrap assets into Resource 26 | s := Resource(testdata.AssetNames(), 27 | func(name string) ([]byte, error) { 28 | return testdata.Asset(name) 29 | }) 30 | 31 | _, err := WithInstance(s) 32 | if err != nil { 33 | t.Fatal(err) 34 | } 35 | } 36 | 37 | func TestOpen(t *testing.T) { 38 | b := &Bindata{} 39 | _, err := b.Open("") 40 | if err == nil { 41 | t.Fatal("expected err, because it's not implemented yet") 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/google-cloud-storage/README.md: -------------------------------------------------------------------------------- 1 | # google-cloud-storage 2 | 3 | `gcs:///` 4 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/migration_test.go: -------------------------------------------------------------------------------- 1 | package source 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestNewMigrations(t *testing.T) { 8 | // TODO 9 | } 10 | 11 | func TestAppend(t *testing.T) { 12 | // TODO 13 | } 14 | 15 | func TestBuildIndex(t *testing.T) { 16 | // TODO 17 | } 18 | 19 | func TestFirst(t *testing.T) { 20 | // TODO 21 | } 22 | 23 | func TestPrev(t *testing.T) { 24 | // TODO 25 | } 26 | 27 | func TestUp(t *testing.T) { 28 | // TODO 29 | } 30 | 31 | func TestDown(t *testing.T) { 32 | // TODO 33 | } 34 | 35 | func TestFindPos(t *testing.T) { 36 | m := Migrations{index: uintSlice{1, 2, 3}} 37 | if p := m.findPos(0); p != -1 { 38 | t.Errorf("expected -1, got %v", p) 39 | } 40 | if p := m.findPos(1); p != 0 { 41 | t.Errorf("expected 0, got %v", p) 42 | } 43 | if p := m.findPos(3); p != 2 { 44 | t.Errorf("expected 2, got %v", p) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/parse.go: -------------------------------------------------------------------------------- 1 | package source 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | "strconv" 7 | ) 8 | 9 | var ( 10 | ErrParse = fmt.Errorf("no match") 11 | ) 12 | 13 | var ( 14 | DefaultParse = Parse 15 | DefaultRegex = Regex 16 | ) 17 | 18 | // Regex matches the following pattern: 19 | // 123_name.up.ext 20 | // 123_name.down.ext 21 | var Regex = regexp.MustCompile(`^([0-9]+)_(.*)\.(` + string(Down) + `|` + string(Up) + `)\.(.*)$`) 22 | 23 | // Parse returns Migration for matching Regex pattern. 24 | func Parse(raw string) (*Migration, error) { 25 | m := Regex.FindStringSubmatch(raw) 26 | if len(m) == 5 { 27 | versionUint64, err := strconv.ParseUint(m[1], 10, 64) 28 | if err != nil { 29 | return nil, err 30 | } 31 | return &Migration{ 32 | Version: uint(versionUint64), 33 | Identifier: m[2], 34 | Direction: Direction(m[3]), 35 | Raw: raw, 36 | }, nil 37 | } 38 | return nil, ErrParse 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/source/stub/stub_test.go: -------------------------------------------------------------------------------- 1 | package stub 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/mattes/migrate/source" 7 | st "github.com/mattes/migrate/source/testing" 8 | ) 9 | 10 | func Test(t *testing.T) { 11 | s := &Stub{} 12 | d, err := s.Open("") 13 | if err != nil { 14 | t.Fatal(err) 15 | } 16 | 17 | m := source.NewMigrations() 18 | m.Append(&source.Migration{Version: 1, Direction: source.Up}) 19 | m.Append(&source.Migration{Version: 1, Direction: source.Down}) 20 | m.Append(&source.Migration{Version: 3, Direction: source.Up}) 21 | m.Append(&source.Migration{Version: 4, Direction: source.Up}) 22 | m.Append(&source.Migration{Version: 4, Direction: source.Down}) 23 | m.Append(&source.Migration{Version: 5, Direction: source.Down}) 24 | m.Append(&source.Migration{Version: 7, Direction: source.Up}) 25 | m.Append(&source.Migration{Version: 7, Direction: source.Down}) 26 | 27 | d.(*Stub).Migrations = m 28 | 29 | st.Test(t, d) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/testing/testing_test.go: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func ExampleParallelTest(t *testing.T) { 8 | var isReady = func(i Instance) bool { 9 | // Return true if Instance is ready to run tests. 10 | // Don't block here though. 11 | return true 12 | } 13 | 14 | // t is *testing.T coming from parent Test(t *testing.T) 15 | ParallelTest(t, []Version{{Image: "docker_image:9.6"}}, isReady, 16 | func(t *testing.T, i Instance) { 17 | // Run your test/s ... 18 | t.Fatal("...") 19 | }) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattes/migrate/util_test.go: -------------------------------------------------------------------------------- 1 | package migrate 2 | 3 | import ( 4 | nurl "net/url" 5 | "testing" 6 | ) 7 | 8 | func TestSuintPanicsWithNegativeInput(t *testing.T) { 9 | defer func() { 10 | if r := recover(); r == nil { 11 | t.Fatal("expected suint to panic for -1") 12 | } 13 | }() 14 | suint(-1) 15 | } 16 | 17 | func TestSuint(t *testing.T) { 18 | if u := suint(0); u != 0 { 19 | t.Fatalf("expected 0, got %v", u) 20 | } 21 | } 22 | 23 | func TestFilterCustomQuery(t *testing.T) { 24 | n, err := nurl.Parse("foo://host?a=b&x-custom=foo&c=d") 25 | if err != nil { 26 | t.Fatal(err) 27 | } 28 | nx := FilterCustomQuery(n).Query() 29 | if nx.Get("x-custom") != "" { 30 | t.Fatalf("didn't expect x-custom") 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/neelance/graphql-go/.gitignore: -------------------------------------------------------------------------------- 1 | /internal/tests/testdata/graphql-js 2 | -------------------------------------------------------------------------------- /vendor/github.com/neelance/graphql-go/errors/errors.go: -------------------------------------------------------------------------------- 1 | package errors 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type QueryError struct { 8 | Message string `json:"message"` 9 | Locations []Location `json:"locations,omitempty"` 10 | Path []interface{} `json:"path,omitempty"` 11 | Rule string `json:"-"` 12 | ResolverError error `json:"-"` 13 | } 14 | 15 | type Location struct { 16 | Line int `json:"line"` 17 | Column int `json:"column"` 18 | } 19 | 20 | func (a Location) Before(b Location) bool { 21 | return a.Line < b.Line || (a.Line == b.Line && a.Column < b.Column) 22 | } 23 | 24 | func Errorf(format string, a ...interface{}) *QueryError { 25 | return &QueryError{ 26 | Message: fmt.Sprintf(format, a...), 27 | } 28 | } 29 | 30 | func (err *QueryError) Error() string { 31 | if err == nil { 32 | return "" 33 | } 34 | str := fmt.Sprintf("graphql: %s", err.Message) 35 | for _, loc := range err.Locations { 36 | str += fmt.Sprintf(" (line %d, column %d)", loc.Line, loc.Column) 37 | } 38 | return str 39 | } 40 | 41 | var _ error = &QueryError{} 42 | -------------------------------------------------------------------------------- /vendor/github.com/neelance/graphql-go/internal/common/directive.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | type Directive struct { 4 | Name Ident 5 | Args ArgumentList 6 | } 7 | 8 | func ParseDirectives(l *Lexer) DirectiveList { 9 | var directives DirectiveList 10 | for l.Peek() == '@' { 11 | l.ConsumeToken('@') 12 | d := &Directive{} 13 | d.Name = l.ConsumeIdentWithLoc() 14 | d.Name.Loc.Column-- 15 | if l.Peek() == '(' { 16 | d.Args = ParseArguments(l) 17 | } 18 | directives = append(directives, d) 19 | } 20 | return directives 21 | } 22 | 23 | type DirectiveList []*Directive 24 | 25 | func (l DirectiveList) Get(name string) *Directive { 26 | for _, d := range l { 27 | if d.Name.Name == name { 28 | return d 29 | } 30 | } 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/neelance/graphql-go/internal/tests/empty.go: -------------------------------------------------------------------------------- 1 | package tests 2 | -------------------------------------------------------------------------------- /vendor/github.com/neelance/graphql-go/internal/tests/testdata/gen.go: -------------------------------------------------------------------------------- 1 | package testdata 2 | 3 | //go:generate cp export.js graphql-js/export.js 4 | //go:generate babel-node graphql-js/export.js 5 | -------------------------------------------------------------------------------- /vendor/github.com/neelance/graphql-go/log/log.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "context" 5 | "log" 6 | "runtime" 7 | ) 8 | 9 | // Logger is the interface used to log panics that occur durring query execution. It is setable via graphql.ParseSchema 10 | type Logger interface { 11 | LogPanic(ctx context.Context, value interface{}) 12 | } 13 | 14 | // DefaultLogger is the default logger used to log panics that occur durring query execution 15 | type DefaultLogger struct{} 16 | 17 | // LogPanic is used to log recovered panic values that occur durring query execution 18 | func (l *DefaultLogger) LogPanic(_ context.Context, value interface{}) { 19 | const size = 64 << 10 20 | buf := make([]byte, size) 21 | buf = buf[:runtime.Stack(buf, false)] 22 | log.Printf("graphql: panic occurred: %v\n%s", value, buf) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/neelance/graphql-go/relay/relay_test.go: -------------------------------------------------------------------------------- 1 | package relay_test 2 | 3 | import ( 4 | "net/http/httptest" 5 | "strings" 6 | "testing" 7 | 8 | "github.com/neelance/graphql-go" 9 | "github.com/neelance/graphql-go/example/starwars" 10 | "github.com/neelance/graphql-go/relay" 11 | ) 12 | 13 | var starwarsSchema = graphql.MustParseSchema(starwars.Schema, &starwars.Resolver{}) 14 | 15 | func TestServeHTTP(t *testing.T) { 16 | w := httptest.NewRecorder() 17 | r := httptest.NewRequest("POST", "/some/path/here", strings.NewReader(`{"query":"{ hero { name } }", "operationName":"", "variables": null}`)) 18 | h := relay.Handler{Schema: starwarsSchema} 19 | 20 | h.ServeHTTP(w, r) 21 | 22 | if w.Code != 200 { 23 | t.Fatalf("Expected status code 200, got %d.", w.Code) 24 | } 25 | 26 | contentType := w.Header().Get("Content-Type") 27 | if contentType != "application/json" { 28 | t.Fatalf("Invalid content-type. Expected [application/json], but instead got [%s]", contentType) 29 | } 30 | 31 | expectedResponse := `{"data":{"hero":{"name":"R2-D2"}}}` 32 | actualResponse := w.Body.String() 33 | if expectedResponse != actualResponse { 34 | t.Fatalf("Invalid response. Expected [%s], but instead got [%s]", expectedResponse, actualResponse) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/neelance/graphql-go/time.go: -------------------------------------------------------------------------------- 1 | package graphql 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | // Time is a custom GraphQL type to represent an instant in time. It has to be added to a schema 9 | // via "scalar Time" since it is not a predeclared GraphQL type like "ID". 10 | type Time struct { 11 | time.Time 12 | } 13 | 14 | func (_ Time) ImplementsGraphQLType(name string) bool { 15 | return name == "Time" 16 | } 17 | 18 | func (t *Time) UnmarshalGraphQL(input interface{}) error { 19 | switch input := input.(type) { 20 | case time.Time: 21 | t.Time = input 22 | return nil 23 | case string: 24 | var err error 25 | t.Time, err = time.Parse(time.RFC3339, input) 26 | return err 27 | case int: 28 | t.Time = time.Unix(int64(input), 0) 29 | return nil 30 | case float64: 31 | t.Time = time.Unix(int64(input), 0) 32 | return nil 33 | default: 34 | return fmt.Errorf("wrong type") 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/.gitignore: -------------------------------------------------------------------------------- 1 | # IntelliJ project files 2 | .idea/ 3 | opentracing-go.iml 4 | opentracing-go.ipr 5 | opentracing-go.iws 6 | 7 | # Test results 8 | *.cov 9 | *.html 10 | test.log 11 | 12 | # Build dir 13 | build/ 14 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.6 5 | - 1.7 6 | - 1.8 7 | - tip 8 | 9 | install: 10 | - go get -d -t github.com/opentracing/opentracing-go/... 11 | - go get -u github.com/golang/lint/... 12 | script: 13 | - make test lint 14 | - go build ./... 15 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Changes by Version 2 | ================== 3 | 4 | 1.1.0 (unreleased) 5 | ------------------- 6 | 7 | - Deprecate InitGlobalTracer() in favor of SetGlobalTracer() 8 | 9 | 10 | 1.0.0 (2016-09-26) 11 | ------------------- 12 | 13 | - This release implements OpenTracing Specification 1.0 (http://opentracing.io/spec) 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 The OpenTracing Authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/Makefile: -------------------------------------------------------------------------------- 1 | PACKAGES := . ./mocktracer/... ./ext/... 2 | 3 | .DEFAULT_GOAL := test-and-lint 4 | 5 | .PHONE: test-and-lint 6 | 7 | test-and-lint: test lint 8 | 9 | .PHONY: test 10 | test: 11 | go test -v -cover ./... 12 | 13 | cover: 14 | @rm -rf cover-all.out 15 | $(foreach pkg, $(PACKAGES), $(MAKE) cover-pkg PKG=$(pkg) || true;) 16 | @grep mode: cover.out > coverage.out 17 | @cat cover-all.out >> coverage.out 18 | go tool cover -html=coverage.out -o cover.html 19 | @rm -rf cover.out cover-all.out coverage.out 20 | 21 | cover-pkg: 22 | go test -coverprofile cover.out $(PKG) 23 | @grep -v mode: cover.out >> cover-all.out 24 | 25 | .PHONY: lint 26 | lint: 27 | go fmt ./... 28 | golint ./... 29 | @# Run again with magic to exit non-zero if golint outputs anything. 30 | @! (golint ./... | read dummy) 31 | go vet ./... 32 | 33 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/globaltracer.go: -------------------------------------------------------------------------------- 1 | package opentracing 2 | 3 | var ( 4 | globalTracer Tracer = NoopTracer{} 5 | ) 6 | 7 | // SetGlobalTracer sets the [singleton] opentracing.Tracer returned by 8 | // GlobalTracer(). Those who use GlobalTracer (rather than directly manage an 9 | // opentracing.Tracer instance) should call SetGlobalTracer as early as 10 | // possible in main(), prior to calling the `StartSpan` global func below. 11 | // Prior to calling `SetGlobalTracer`, any Spans started via the `StartSpan` 12 | // (etc) globals are noops. 13 | func SetGlobalTracer(tracer Tracer) { 14 | globalTracer = tracer 15 | } 16 | 17 | // GlobalTracer returns the global singleton `Tracer` implementation. 18 | // Before `SetGlobalTracer()` is called, the `GlobalTracer()` is a noop 19 | // implementation that drops all data handed to it. 20 | func GlobalTracer() Tracer { 21 | return globalTracer 22 | } 23 | 24 | // StartSpan defers to `Tracer.StartSpan`. See `GlobalTracer()`. 25 | func StartSpan(operationName string, opts ...StartSpanOption) Span { 26 | return globalTracer.StartSpan(operationName, opts...) 27 | } 28 | 29 | // InitGlobalTracer is deprecated. Please use SetGlobalTracer. 30 | func InitGlobalTracer(tracer Tracer) { 31 | SetGlobalTracer(tracer) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/log/field_test.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestFieldString(t *testing.T) { 9 | testCases := []struct { 10 | field Field 11 | expected string 12 | }{ 13 | { 14 | field: String("key", "value"), 15 | expected: "key:value", 16 | }, 17 | { 18 | field: Bool("key", true), 19 | expected: "key:true", 20 | }, 21 | { 22 | field: Int("key", 5), 23 | expected: "key:5", 24 | }, 25 | { 26 | field: Error(fmt.Errorf("err msg")), 27 | expected: "error:err msg", 28 | }, 29 | { 30 | field: Error(nil), 31 | expected: "error:", 32 | }, 33 | } 34 | for i, tc := range testCases { 35 | if str := tc.field.String(); str != tc.expected { 36 | t.Errorf("%d: expected '%s', got '%s'", i, tc.expected, str) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/opentracing/opentracing-go/options_test.go: -------------------------------------------------------------------------------- 1 | package opentracing 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/require" 7 | ) 8 | 9 | func TestChildOfAndFollowsFrom(t *testing.T) { 10 | tests := []struct { 11 | newOpt func(SpanContext) SpanReference 12 | refType SpanReferenceType 13 | name string 14 | }{ 15 | {ChildOf, ChildOfRef, "ChildOf"}, 16 | {FollowsFrom, FollowsFromRef, "FollowsFrom"}, 17 | } 18 | 19 | for _, test := range tests { 20 | opts := new(StartSpanOptions) 21 | 22 | test.newOpt(nil).Apply(opts) 23 | require.Nil(t, opts.References, "%s(nil) must not append a reference", test.name) 24 | 25 | ctx := new(noopSpanContext) 26 | test.newOpt(ctx).Apply(opts) 27 | require.Equal(t, []SpanReference{ 28 | SpanReference{ReferencedContext: ctx, Type: test.refType}, 29 | }, opts.References, "%s(ctx) must append a reference", test.name) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/satori/go.uuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.2 5 | - 1.3 6 | - 1.4 7 | - 1.5 8 | - 1.6 9 | before_install: 10 | - go get github.com/mattn/goveralls 11 | - go get golang.org/x/tools/cmd/cover 12 | script: 13 | - $HOME/gopath/bin/goveralls -service=travis-ci 14 | notifications: 15 | email: false 16 | -------------------------------------------------------------------------------- /vendor/github.com/satori/go.uuid/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013-2016 by Maxim Bublis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README.md: -------------------------------------------------------------------------------- 1 | # Go Networking 2 | 3 | This repository holds supplementary Go networking libraries. 4 | 5 | ## Download/Install 6 | 7 | The easiest way to install is to run `go get -u golang.org/x/net`. You can 8 | also manually git clone the repository to `$GOPATH/src/golang.org/x/net`. 9 | 10 | ## Report Issues / Send Patches 11 | 12 | This repository uses Gerrit for code changes. To learn how to submit 13 | changes to this repository, see https://golang.org/doc/contribute.html. 14 | The main issue tracker for the net repository is located at 15 | https://github.com/golang/go/issues. Prefix your issue with "x/net:" in the 16 | subject line, so it is easy to find. 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/setter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package bpf 6 | 7 | // A Setter is a type which can attach a compiled BPF filter to itself. 8 | type Setter interface { 9 | SetBPF(filter []RawInstruction) error 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/testdata/all_instructions.bpf: -------------------------------------------------------------------------------- 1 | 50,0 0 0 42,1 0 0 42,96 0 0 3,97 0 0 3,48 0 0 42,40 0 0 42,32 0 0 42,80 0 0 42,72 0 0 42,64 0 0 42,177 0 0 42,128 0 0 0,32 0 0 4294963200,32 0 0 4294963204,32 0 0 4294963256,2 0 0 3,3 0 0 3,4 0 0 42,20 0 0 42,36 0 0 42,52 0 0 42,68 0 0 42,84 0 0 42,100 0 0 42,116 0 0 42,148 0 0 42,164 0 0 42,12 0 0 0,28 0 0 0,44 0 0 0,60 0 0 0,76 0 0 0,92 0 0 0,108 0 0 0,124 0 0 0,156 0 0 0,172 0 0 0,132 0 0 0,5 0 0 10,21 8 9 42,21 0 8 42,53 0 7 42,37 0 6 42,37 4 5 42,53 3 4 42,69 2 3 42,7 0 0 0,135 0 0 0,22 0 0 0,6 0 0 0, 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/testdata/all_instructions.txt: -------------------------------------------------------------------------------- 1 | # This filter is compiled to all_instructions.bpf by the `bpf_asm` 2 | # tool, which can be found in the linux kernel source tree under 3 | # tools/net. 4 | 5 | # Load immediate 6 | ld #42 7 | ldx #42 8 | 9 | # Load scratch 10 | ld M[3] 11 | ldx M[3] 12 | 13 | # Load absolute 14 | ldb [42] 15 | ldh [42] 16 | ld [42] 17 | 18 | # Load indirect 19 | ldb [x + 42] 20 | ldh [x + 42] 21 | ld [x + 42] 22 | 23 | # Load IPv4 header length 24 | ldx 4*([42]&0xf) 25 | 26 | # Run extension function 27 | ld #len 28 | ld #proto 29 | ld #type 30 | ld #rand 31 | 32 | # Store scratch 33 | st M[3] 34 | stx M[3] 35 | 36 | # A constant 37 | add #42 38 | sub #42 39 | mul #42 40 | div #42 41 | or #42 42 | and #42 43 | lsh #42 44 | rsh #42 45 | mod #42 46 | xor #42 47 | 48 | # A X 49 | add x 50 | sub x 51 | mul x 52 | div x 53 | or x 54 | and x 55 | lsh x 56 | rsh x 57 | mod x 58 | xor x 59 | 60 | # !A 61 | neg 62 | 63 | # Jumps 64 | ja end 65 | jeq #42,prev,end 66 | jne #42,end 67 | jlt #42,end 68 | jle #42,end 69 | jgt #42,prev,end 70 | jge #42,prev,end 71 | jset #42,prev,end 72 | 73 | # Register transfers 74 | tax 75 | txa 76 | 77 | # Returns 78 | prev: ret a 79 | end: ret #42 80 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/vm_extension_test.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 | package bpf_test 6 | 7 | import ( 8 | "testing" 9 | 10 | "golang.org/x/net/bpf" 11 | ) 12 | 13 | func TestVMLoadExtensionNotImplemented(t *testing.T) { 14 | _, _, err := testVM(t, []bpf.Instruction{ 15 | bpf.LoadExtension{ 16 | Num: 100, 17 | }, 18 | bpf.RetA{}, 19 | }) 20 | if errStr(err) != "extension 100 not implemented" { 21 | t.Fatalf("unexpected error: %v", err) 22 | } 23 | } 24 | 25 | func TestVMLoadExtensionExtLen(t *testing.T) { 26 | vm, done, err := testVM(t, []bpf.Instruction{ 27 | bpf.LoadExtension{ 28 | Num: bpf.ExtLen, 29 | }, 30 | bpf.RetA{}, 31 | }) 32 | if err != nil { 33 | t.Fatalf("failed to load BPF program: %v", err) 34 | } 35 | defer done() 36 | 37 | out, err := vm.Run([]byte{ 38 | 0xff, 0xff, 0xff, 0xff, 39 | 0xff, 0xff, 0xff, 0xff, 40 | 0, 1, 2, 3, 41 | }) 42 | if err != nil { 43 | t.Fatalf("unexpected error while running program: %v", err) 44 | } 45 | if want, got := 4, out; want != got { 46 | t.Fatalf("unexpected number of output bytes:\n- want: %d\n- got: %d", 47 | want, got) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/ctxhttp/ctxhttp_17_test.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 !plan9,go1.7 6 | 7 | package ctxhttp 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | "net/http/httptest" 13 | "testing" 14 | 15 | "context" 16 | ) 17 | 18 | func TestGo17Context(t *testing.T) { 19 | ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 20 | io.WriteString(w, "ok") 21 | })) 22 | defer ts.Close() 23 | ctx := context.Background() 24 | resp, err := Get(ctx, http.DefaultClient, ts.URL) 25 | if resp == nil || err != nil { 26 | t.Fatalf("error received from client: %v %v", err, resp) 27 | } 28 | resp.Body.Close() 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/withtimeout_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package context_test 6 | 7 | import ( 8 | "fmt" 9 | "time" 10 | 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | // This example passes a context with a timeout to tell a blocking function that 15 | // it should abandon its work after the timeout elapses. 16 | func ExampleWithTimeout() { 17 | // Pass a context with a timeout to tell a blocking function that it 18 | // should abandon its work after the timeout elapses. 19 | ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) 20 | defer cancel() 21 | 22 | select { 23 | case <-time.After(1 * time.Second): 24 | fmt.Println("overslept") 25 | case <-ctx.Done(): 26 | fmt.Println(ctx.Err()) // prints "context deadline exceeded" 27 | } 28 | 29 | // Output: 30 | // context deadline exceeded 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/README: -------------------------------------------------------------------------------- 1 | These test cases come from 2 | http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics 3 | 4 | Distributed under both the W3C Test Suite License 5 | (http://www.w3.org/Consortium/Legal/2008/04-testsuite-license) 6 | and the W3C 3-clause BSD License 7 | (http://www.w3.org/Consortium/Legal/2008/03-bsd-license). 8 | To contribute to a W3C Test Suite, see the policies and contribution 9 | forms (http://www.w3.org/2004/10/27-testcases). 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/howtographql/graphql-go/04819498d25a707965211f76e83031098a4e14e5/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/howtographql/graphql-go/04819498d25a707965211f76e83031098a4e14e5/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/entity_test.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 | package html 6 | 7 | import ( 8 | "testing" 9 | "unicode/utf8" 10 | ) 11 | 12 | func TestEntityLength(t *testing.T) { 13 | // We verify that the length of UTF-8 encoding of each value is <= 1 + len(key). 14 | // The +1 comes from the leading "&". This property implies that the length of 15 | // unescaped text is <= the length of escaped text. 16 | for k, v := range entity { 17 | if 1+len(k) < utf8.RuneLen(v) { 18 | t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v)) 19 | } 20 | if len(k) > longestEntityWithoutSemicolon && k[len(k)-1] != ';' { 21 | t.Errorf("entity name %s is %d characters, but longestEntityWithoutSemicolon=%d", k, len(k), longestEntityWithoutSemicolon) 22 | } 23 | } 24 | for k, v := range entity2 { 25 | if 1+len(k) < utf8.RuneLen(v[0])+utf8.RuneLen(v[1]) { 26 | t.Error("escaped entity &" + k + " is shorter than its UTF-8 encoding " + string(v[0]) + string(v[1])) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/example_test.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 | // This example demonstrates parsing HTML data and walking the resulting tree. 6 | package html_test 7 | 8 | import ( 9 | "fmt" 10 | "log" 11 | "strings" 12 | 13 | "golang.org/x/net/html" 14 | ) 15 | 16 | func ExampleParse() { 17 | s := `

Links:

` 18 | doc, err := html.Parse(strings.NewReader(s)) 19 | if err != nil { 20 | log.Fatal(err) 21 | } 22 | var f func(*html.Node) 23 | f = func(n *html.Node) { 24 | if n.Type == html.ElementNode && n.Data == "a" { 25 | for _, a := range n.Attr { 26 | if a.Key == "href" { 27 | fmt.Println(a.Val) 28 | break 29 | } 30 | } 31 | } 32 | for c := n.FirstChild; c != nil; c = c.NextSibling { 33 | f(c) 34 | } 35 | } 36 | f(doc) 37 | // Output: 38 | // foo 39 | // /bar/baz 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/testdata/webkit/adoption02.dat: -------------------------------------------------------------------------------- 1 | #data 2 | 12

34 3 | #errors 4 | #document 5 | | 6 | | 7 | | 8 | | 9 | | "1" 10 | | 11 | | "2" 12 | | 13 | |

14 | | 15 | | "3" 16 | | "4" 17 | 18 | #data 19 |

20 | #errors 21 | #document 22 | | 23 | | 24 | | 25 | | 26 | |
27 | | 28 | |