├── .gitignore ├── LICENSE ├── README.md ├── glide.lock ├── glide.yaml ├── helpers └── helper.go ├── main.go ├── modules ├── mutation.go ├── post │ ├── resolvers │ │ ├── insert_post.go │ │ └── post.go │ └── types │ │ └── post_query.go └── query.go ├── talk ├── codetime.png ├── face.png ├── google.jpg ├── gopher.png ├── graphql.png ├── main.go ├── mutations.txt ├── perfil.png ├── queries.txt ├── resolve.txt ├── sc.jpg ├── schema.txt ├── talk.slide └── types.txt └── vendor ├── github.com └── graphql-go │ ├── graphql-go-handler │ ├── .gitignore │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── handler.go │ ├── handler_test.go │ └── request_options_test.go │ └── graphql │ ├── .gitignore │ ├── .travis.yml │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── abstract_test.go │ ├── definition.go │ ├── definition_test.go │ ├── directives.go │ ├── directives_test.go │ ├── enum_type_test.go │ ├── examples │ ├── context │ │ └── main.go │ ├── hello-world │ │ └── main.go │ ├── http │ │ ├── data.json │ │ └── main.go │ ├── star-wars │ │ └── main.go │ └── todo │ │ ├── README.md │ │ └── main.go │ ├── executor.go │ ├── executor_resolve_test.go │ ├── executor_schema_test.go │ ├── executor_test.go │ ├── gqlerrors │ ├── error.go │ ├── formatted.go │ ├── located.go │ ├── sortutil.go │ └── syntax.go │ ├── graphql.go │ ├── graphql_test.go │ ├── introspection.go │ ├── introspection_test.go │ ├── kitchen-sink.graphql │ ├── language │ ├── ast │ │ ├── arguments.go │ │ ├── definitions.go │ │ ├── directives.go │ │ ├── document.go │ │ ├── location.go │ │ ├── name.go │ │ ├── node.go │ │ ├── selections.go │ │ ├── type_definitions.go │ │ ├── types.go │ │ └── values.go │ ├── kinds │ │ └── kinds.go │ ├── lexer │ │ ├── lexer.go │ │ └── lexer_test.go │ ├── location │ │ └── location.go │ ├── parser │ │ ├── parser.go │ │ ├── parser_test.go │ │ └── schema_parser_test.go │ ├── printer │ │ ├── printer.go │ │ ├── printer_test.go │ │ └── schema_printer_test.go │ ├── source │ │ └── source.go │ ├── typeInfo │ │ └── type_info.go │ └── visitor │ │ ├── visitor.go │ │ └── visitor_test.go │ ├── lists_test.go │ ├── located.go │ ├── mutations_test.go │ ├── nonnull_test.go │ ├── quoted_or_list_internal_test.go │ ├── rules.go │ ├── rules_arguments_of_correct_type_test.go │ ├── rules_default_values_of_correct_type_test.go │ ├── rules_fields_on_correct_type_test.go │ ├── rules_fragments_on_composite_types_test.go │ ├── rules_known_argument_names_test.go │ ├── rules_known_directives_rule_test.go │ ├── rules_known_fragment_names_test.go │ ├── rules_known_type_names_test.go │ ├── rules_lone_anonymous_operation_rule_test.go │ ├── rules_no_fragment_cycles_test.go │ ├── rules_no_undefined_variables_test.go │ ├── rules_no_unused_fragments_test.go │ ├── rules_no_unused_variables_test.go │ ├── rules_overlapping_fields_can_be_merged.go │ ├── rules_overlapping_fields_can_be_merged_test.go │ ├── rules_possible_fragment_spreads_test.go │ ├── rules_provided_non_null_arguments_test.go │ ├── rules_scalar_leafs_test.go │ ├── rules_unique_argument_names_test.go │ ├── rules_unique_fragment_names_test.go │ ├── rules_unique_input_field_names_test.go │ ├── rules_unique_operation_names_test.go │ ├── rules_unique_variable_names_test.go │ ├── rules_variables_are_input_types_test.go │ ├── rules_variables_in_allowed_position_test.go │ ├── scalars.go │ ├── scalars_serialization_test.go │ ├── schema-kitchen-sink.graphql │ ├── schema.go │ ├── suggested_list_internal_test.go │ ├── testutil │ ├── introspection_query.go │ ├── rules_test_harness.go │ ├── testutil.go │ └── testutil_test.go │ ├── type_comparators_internal_test.go │ ├── type_info.go │ ├── types.go │ ├── union_interface_test.go │ ├── validation_test.go │ ├── validator.go │ ├── validator_test.go │ ├── values.go │ └── variables_test.go ├── golang.org └── x │ └── net │ ├── .gitattributes │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README │ ├── bpf │ ├── asm.go │ ├── constants.go │ ├── doc.go │ ├── instructions.go │ ├── instructions_test.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 │ ├── pre_go17.go │ └── withtimeout_test.go │ ├── dict │ └── dict.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 │ ├── client_conn_pool.go │ ├── configure_transport.go │ ├── errors.go │ ├── errors_test.go │ ├── fixed_buffer.go │ ├── fixed_buffer_test.go │ ├── flow.go │ ├── flow_test.go │ ├── frame.go │ ├── frame_test.go │ ├── go16.go │ ├── go17.go │ ├── go17_not18.go │ ├── go18.go │ ├── go18_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 │ ├── h2i │ │ ├── README.md │ │ └── h2i.go │ ├── headermap.go │ ├── hpack │ │ ├── encode.go │ │ ├── encode_test.go │ │ ├── hpack.go │ │ ├── hpack_test.go │ │ ├── huffman.go │ │ └── tables.go │ ├── http2.go │ ├── http2_test.go │ ├── not_go16.go │ ├── not_go17.go │ ├── not_go18.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.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 │ ├── idna.go │ ├── idna_test.go │ ├── punycode.go │ └── punycode_test.go │ ├── internal │ ├── iana │ │ ├── const.go │ │ └── gen.go │ ├── netreflect │ │ ├── socket.go │ │ ├── socket_posix.go │ │ ├── socket_stub.go │ │ └── socket_test.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 │ └── timeseries │ │ ├── timeseries.go │ │ └── timeseries_test.go │ ├── ipv4 │ ├── bpf_test.go │ ├── bpfopt_linux.go │ ├── bpfopt_stub.go │ ├── control.go │ ├── control_bsd.go │ ├── control_pktinfo.go │ ├── control_stub.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_posix.go │ ├── dgramopt_stub.go │ ├── doc.go │ ├── endpoint.go │ ├── example_test.go │ ├── gen.go │ ├── genericopt_posix.go │ ├── genericopt_stub.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 │ ├── payload.go │ ├── payload_cmsg.go │ ├── payload_nocmsg.go │ ├── readwrite_test.go │ ├── sockopt.go │ ├── sockopt_asmreq.go │ ├── sockopt_asmreq_posix.go │ ├── sockopt_asmreq_stub.go │ ├── sockopt_asmreqn_stub.go │ ├── sockopt_asmreqn_unix.go │ ├── sockopt_posix.go │ ├── sockopt_ssmreq_stub.go │ ├── sockopt_ssmreq_unix.go │ ├── sockopt_stub.go │ ├── sys_bsd.go │ ├── sys_darwin.go │ ├── sys_freebsd.go │ ├── sys_linux.go │ ├── sys_linux_386.s │ ├── sys_openbsd.go │ ├── sys_solaris.go │ ├── sys_solaris_amd64.s │ ├── sys_stub.go │ ├── sys_windows.go │ ├── syscall_linux_386.go │ ├── syscall_solaris.go │ ├── syscall_unix.go │ ├── syscall_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 │ ├── bpf_test.go │ ├── bpfopt_linux.go │ ├── bpfopt_stub.go │ ├── control.go │ ├── control_rfc2292_unix.go │ ├── control_rfc3542_unix.go │ ├── control_stub.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_posix.go │ ├── dgramopt_stub.go │ ├── doc.go │ ├── endpoint.go │ ├── example_test.go │ ├── gen.go │ ├── genericopt_posix.go │ ├── genericopt_stub.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_nocmsg.go │ ├── readwrite_test.go │ ├── sockopt.go │ ├── sockopt_asmreq_posix.go │ ├── sockopt_posix.go │ ├── sockopt_ssmreq_stub.go │ ├── sockopt_ssmreq_unix.go │ ├── sockopt_stub.go │ ├── sockopt_test.go │ ├── sys_bsd.go │ ├── sys_darwin.go │ ├── sys_freebsd.go │ ├── sys_linux.go │ ├── sys_linux_386.s │ ├── sys_solaris.go │ ├── sys_solaris_amd64.s │ ├── sys_stub.go │ ├── sys_windows.go │ ├── syscall_linux_386.go │ ├── syscall_solaris.go │ ├── syscall_unix.go │ ├── syscall_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_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 │ ├── syscall.s │ ├── 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_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 ├── gopkg.in └── mgo.v2 │ ├── .travis.yml │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── auth.go │ ├── auth_test.go │ ├── bson │ ├── LICENSE │ ├── bson.go │ ├── bson_test.go │ ├── decimal.go │ ├── decimal_test.go │ ├── decode.go │ ├── encode.go │ ├── json.go │ ├── json_test.go │ ├── specdata │ │ └── update.sh │ └── specdata_test.go │ ├── bulk.go │ ├── bulk_test.go │ ├── cluster.go │ ├── cluster_test.go │ ├── dbtest │ ├── dbserver.go │ ├── dbserver_test.go │ └── export_test.go │ ├── doc.go │ ├── export_test.go │ ├── gridfs.go │ ├── gridfs_test.go │ ├── harness │ ├── certs │ │ ├── client.crt │ │ ├── client.key │ │ ├── client.pem │ │ ├── client.req │ │ ├── server.crt │ │ ├── server.key │ │ └── server.pem │ ├── daemons │ │ ├── .env │ │ ├── cfg1 │ │ │ ├── db │ │ │ │ ├── .empty │ │ │ │ ├── journal │ │ │ │ │ └── tempLatencyTest │ │ │ │ └── mongod.lock │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── cfg2 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── cfg3 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── db1 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── db2 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── db3 │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs1a │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs1b │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs1c │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs2a │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs2b │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs2c │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs3a │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs3b │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs3c │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── rs4a │ │ │ ├── db │ │ │ │ └── .empty │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── s1 │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ ├── s2 │ │ │ ├── log │ │ │ │ └── run │ │ │ └── run │ │ └── s3 │ │ │ ├── log │ │ │ └── run │ │ │ └── run │ ├── mongojs │ │ ├── dropall.js │ │ ├── init.js │ │ └── wait.js │ └── setup.sh │ ├── internal │ ├── json │ │ ├── LICENSE │ │ ├── bench_test.go │ │ ├── decode.go │ │ ├── decode_test.go │ │ ├── encode.go │ │ ├── encode_test.go │ │ ├── example_test.go │ │ ├── extension.go │ │ ├── extension_test.go │ │ ├── fold.go │ │ ├── fold_test.go │ │ ├── indent.go │ │ ├── number_test.go │ │ ├── scanner.go │ │ ├── scanner_test.go │ │ ├── stream.go │ │ ├── stream_test.go │ │ ├── tagkey_test.go │ │ ├── tags.go │ │ ├── tags_test.go │ │ └── testdata │ │ │ └── code.json.gz │ ├── sasl │ │ ├── sasl.c │ │ ├── sasl.go │ │ ├── sasl_windows.c │ │ ├── sasl_windows.go │ │ ├── sasl_windows.h │ │ ├── sspi_windows.c │ │ └── sspi_windows.h │ └── scram │ │ ├── scram.go │ │ └── scram_test.go │ ├── log.go │ ├── queue.go │ ├── queue_test.go │ ├── raceoff.go │ ├── raceon.go │ ├── saslimpl.go │ ├── saslstub.go │ ├── server.go │ ├── session.go │ ├── session_test.go │ ├── socket.go │ ├── stats.go │ ├── suite_test.go │ ├── syscall_test.go │ ├── syscall_windows_test.go │ └── txn │ ├── chaos.go │ ├── debug.go │ ├── dockey_test.go │ ├── flusher.go │ ├── output.txt │ ├── sim_test.go │ ├── tarjan.go │ ├── tarjan_test.go │ ├── txn.go │ └── txn_test.go └── static ├── css └── graphiql.css ├── index.html └── js ├── app-graphiql.js └── graphiql.min.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Eliseu Benedito Codinhoto 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 | # Golang GraphQL Talk 2 | Golang GraphQL API Talk - Google 3 | 4 | # Slides 5 | Instale o present: 6 | 7 | ```go get golang.org/x/tools/cmd/present``` 8 | 9 | e execute: 10 | 11 | ```present talk/``` 12 | -------------------------------------------------------------------------------- /glide.lock: -------------------------------------------------------------------------------- 1 | hash: 8025744870304bad9f536e2cbb8b182934dc84041839cce0e7c04779fbb169c9 2 | updated: 2017-02-14T02:23:50.020366836-02:00 3 | imports: 4 | - name: github.com/graphql-go/graphql 5 | version: e13376c2344b5694a62b7cf6cd8b543c813cd5ee 6 | subpackages: 7 | - gqlerrors 8 | - language/ast 9 | - language/kinds 10 | - language/lexer 11 | - language/location 12 | - language/parser 13 | - language/printer 14 | - language/source 15 | - language/typeInfo 16 | - language/visitor 17 | - name: github.com/graphql-go/graphql-go-handler 18 | version: 52e6de4fccd785952dce42265f316acd43a3053f 19 | - name: golang.org/x/net 20 | version: 61557ac0112b576429a0df080e1c2cef5dfbb642 21 | subpackages: 22 | - context 23 | - name: gopkg.in/mgo.v2 24 | version: 3f83fa5005286a7fe593b055f0d7771a7dce4655 25 | testImports: [] 26 | -------------------------------------------------------------------------------- /glide.yaml: -------------------------------------------------------------------------------- 1 | package: golang-graphql-talk 2 | import: 3 | - package: github.com/graphql-go/graphql 4 | version: ^0.6.0 5 | - package: github.com/graphql-go/graphql-go-handler 6 | - package: gopkg.in/mgo.v2 7 | -------------------------------------------------------------------------------- /helpers/helper.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | type Post struct { 4 | Message string `json:"message"` 5 | } 6 | 7 | var PostList []Post 8 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "golang-graphql-talk/modules" 5 | "net/http" 6 | "os" 7 | 8 | "github.com/graphql-go/graphql" 9 | gqlhandler "github.com/graphql-go/graphql-go-handler" 10 | ) 11 | 12 | var Schema, _ = graphql.NewSchema(graphql.SchemaConfig{ 13 | Query: modules.QueryType, 14 | Mutation: modules.MutationType, 15 | }) 16 | 17 | func main() { 18 | port := os.Getenv("PORT") 19 | 20 | if port == "" { 21 | port = "8000" 22 | } 23 | 24 | // create a graphql-go HTTP handler with our previously defined schema 25 | // and we also set it to return pretty JSON output 26 | h := gqlhandler.New(&gqlhandler.Config{ 27 | Schema: &Schema, 28 | Pretty: true, 29 | }) 30 | 31 | // static file server to serve Graphiql in-browser editor 32 | fs := http.FileServer(http.Dir("vendor/static")) 33 | 34 | // serve a GraphQL endpoint at `/graphql` 35 | http.Handle("/graphql", h) 36 | 37 | http.Handle("/", fs) 38 | 39 | // and serve! 40 | http.ListenAndServe(":"+port, nil) 41 | } 42 | -------------------------------------------------------------------------------- /modules/mutation.go: -------------------------------------------------------------------------------- 1 | package modules 2 | 3 | import ( 4 | "golang-graphql-talk/modules/post/resolvers" 5 | 6 | "github.com/graphql-go/graphql" 7 | ) 8 | 9 | var MutationType = graphql.NewObject(graphql.ObjectConfig{ 10 | Name: "Mutation", 11 | Description: "Mutation do graphQL", 12 | Fields: graphql.Fields{ 13 | "insertPost": &graphql.Field{ 14 | Type: graphql.String, 15 | Args: graphql.FieldConfigArgument{ 16 | "message": &graphql.ArgumentConfig{ 17 | Type: graphql.NewNonNull(graphql.String), 18 | }, 19 | }, 20 | Resolve: resolvers.InsertPostResolver, 21 | Description: "Adiciona um novo post", 22 | }, 23 | }, 24 | }) 25 | -------------------------------------------------------------------------------- /modules/post/resolvers/insert_post.go: -------------------------------------------------------------------------------- 1 | package resolvers 2 | 3 | import ( 4 | "fmt" 5 | "golang-graphql-talk/helpers" 6 | 7 | "github.com/graphql-go/graphql" 8 | ) 9 | 10 | var InsertPostResolver = func(params graphql.ResolveParams) (interface{}, error) { 11 | newMessage, ok := params.Args["message"].(string) 12 | if !ok { 13 | return newMessage, fmt.Errorf("SYSTEM ERROR") 14 | } 15 | 16 | newPost := helpers.Post{ 17 | Message: newMessage, 18 | } 19 | 20 | helpers.PostList = append([]helpers.Post{newPost}, helpers.PostList...) 21 | 22 | return newPost.Message, nil 23 | } 24 | -------------------------------------------------------------------------------- /modules/post/resolvers/post.go: -------------------------------------------------------------------------------- 1 | package resolvers 2 | 3 | import ( 4 | "golang-graphql-talk/helpers" 5 | 6 | "github.com/graphql-go/graphql" 7 | ) 8 | 9 | var PostsResolver = func(_ graphql.ResolveParams) (interface{}, error) { 10 | return helpers.PostList, nil 11 | } 12 | -------------------------------------------------------------------------------- /modules/post/types/post_query.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import "github.com/graphql-go/graphql" 4 | 5 | var PostQueryType = graphql.NewObject(graphql.ObjectConfig{ 6 | Name: "PostQuery", 7 | Description: "Objeto que representa uma postagem", 8 | Fields: graphql.Fields{ 9 | "message": &graphql.Field{ 10 | Type: graphql.String, 11 | Description: "Mensagem da postagem", 12 | }, 13 | }, 14 | }) 15 | -------------------------------------------------------------------------------- /modules/query.go: -------------------------------------------------------------------------------- 1 | package modules 2 | 3 | import ( 4 | "golang-graphql-talk/modules/post/resolvers" 5 | "golang-graphql-talk/modules/post/types" 6 | 7 | "github.com/graphql-go/graphql" 8 | ) 9 | 10 | var QueryType = graphql.NewObject(graphql.ObjectConfig{ 11 | Name: "Query", 12 | Description: "Query do graphQL", 13 | Fields: graphql.Fields{ 14 | "posts": &graphql.Field{ 15 | Type: graphql.NewList(types.PostQueryType), 16 | Resolve: resolvers.PostsResolver, 17 | Description: "Todos os posts", 18 | }, 19 | }, 20 | }) 21 | -------------------------------------------------------------------------------- /talk/codetime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeucxb/golang-graphql-talk/5f3ba040e20077e815e3360f92daca5d55fccd1c/talk/codetime.png -------------------------------------------------------------------------------- /talk/face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeucxb/golang-graphql-talk/5f3ba040e20077e815e3360f92daca5d55fccd1c/talk/face.png -------------------------------------------------------------------------------- /talk/google.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeucxb/golang-graphql-talk/5f3ba040e20077e815e3360f92daca5d55fccd1c/talk/google.jpg -------------------------------------------------------------------------------- /talk/gopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeucxb/golang-graphql-talk/5f3ba040e20077e815e3360f92daca5d55fccd1c/talk/gopher.png -------------------------------------------------------------------------------- /talk/graphql.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeucxb/golang-graphql-talk/5f3ba040e20077e815e3360f92daca5d55fccd1c/talk/graphql.png -------------------------------------------------------------------------------- /talk/mutations.txt: -------------------------------------------------------------------------------- 1 | var MutationType = graphql.NewObject(graphql.ObjectConfig{ 2 | Name: "Mutation", 3 | Description: "Mutation do graphQL", 4 | Fields: graphql.Fields{ 5 | "insertPost": &graphql.Field{ 6 | Type: graphql.String, 7 | Args: graphql.FieldConfigArgument{ 8 | "message": &graphql.ArgumentConfig{ 9 | Type: graphql.NewNonNull(graphql.String), 10 | }, 11 | }, 12 | Resolve: InsertPostResolver, 13 | Description: "Adiciona um novo post", 14 | }, 15 | }, 16 | }) -------------------------------------------------------------------------------- /talk/perfil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeucxb/golang-graphql-talk/5f3ba040e20077e815e3360f92daca5d55fccd1c/talk/perfil.png -------------------------------------------------------------------------------- /talk/queries.txt: -------------------------------------------------------------------------------- 1 | var QueryType = graphql.NewObject(graphql.ObjectConfig{ 2 | Name: "Query", 3 | Description: "Query do graphQL", 4 | Fields: graphql.Fields{ 5 | "posts": &graphql.Field{ 6 | Type: graphql.NewList(PostQueryType), 7 | Resolve: PostsResolver, 8 | Description: "Todos os posts", 9 | }, 10 | }, 11 | }) -------------------------------------------------------------------------------- /talk/resolve.txt: -------------------------------------------------------------------------------- 1 | var InsertPostResolver = func(params graphql.ResolveParams) (interface{}, error) { 2 | newMessage, ok := params.Args["message"].(string) 3 | if !ok { 4 | return newMessage, fmt.Errorf("SYSTEM ERROR") 5 | } 6 | 7 | newPost := Post{ 8 | Message: newMessage, 9 | } 10 | 11 | PostList = append([]Post{newPost}, PostList...) 12 | 13 | return newPost.Message, nil 14 | } -------------------------------------------------------------------------------- /talk/sc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zeucxb/golang-graphql-talk/5f3ba040e20077e815e3360f92daca5d55fccd1c/talk/sc.jpg -------------------------------------------------------------------------------- /talk/schema.txt: -------------------------------------------------------------------------------- 1 | var Schema, _ = graphql.NewSchema(graphql.SchemaConfig{ 2 | Query: QueryType, 3 | Mutation: MutationType, 4 | }) -------------------------------------------------------------------------------- /talk/types.txt: -------------------------------------------------------------------------------- 1 | var PostQueryType = graphql.NewObject(graphql.ObjectConfig{ 2 | Name: "PostQuery", 3 | Description: "Objeto que representa uma postagem", 4 | Fields: graphql.Fields{ 5 | "message": &graphql.Field{ 6 | Type: graphql.String, 7 | Description: "Mensagem da postagem", 8 | }, 9 | }, 10 | }) -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql-go-handler/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql-go-handler/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4 5 | 6 | before_install: 7 | - go get github.com/axw/gocov/gocov 8 | - go get github.com/mattn/goveralls 9 | - go get golang.org/x/tools/cmd/cover 10 | 11 | script: 12 | - $HOME/gopath/bin/goveralls -service=travis-ci 13 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql-go-handler/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Hafiz Ismail 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4 5 | - 1.7 6 | - tip 7 | 8 | before_install: 9 | - go get github.com/axw/gocov/gocov 10 | - go get github.com/mattn/goveralls 11 | - go get golang.org/x/tools/cmd/cover 12 | 13 | script: 14 | - $HOME/gopath/bin/goveralls -service=travis-ci 15 | - go vet ./... 16 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Chris Ramón 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/graphql-go/graphql/examples/hello-world/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "log" 7 | 8 | "github.com/graphql-go/graphql" 9 | ) 10 | 11 | func main() { 12 | // Schema 13 | fields := graphql.Fields{ 14 | "hello": &graphql.Field{ 15 | Type: graphql.String, 16 | Resolve: func(p graphql.ResolveParams) (interface{}, error) { 17 | return "world", nil 18 | }, 19 | }, 20 | } 21 | rootQuery := graphql.ObjectConfig{Name: "RootQuery", Fields: fields} 22 | schemaConfig := graphql.SchemaConfig{Query: graphql.NewObject(rootQuery)} 23 | schema, err := graphql.NewSchema(schemaConfig) 24 | if err != nil { 25 | log.Fatalf("failed to create new schema, error: %v", err) 26 | } 27 | 28 | // Query 29 | query := ` 30 | { 31 | hello 32 | } 33 | ` 34 | params := graphql.Params{Schema: schema, RequestString: query} 35 | r := graphql.Do(params) 36 | if len(r.Errors) > 0 { 37 | log.Fatalf("failed to execute graphql operation, errors: %+v", r.Errors) 38 | } 39 | rJSON, _ := json.Marshal(r) 40 | fmt.Printf("%s \n", rJSON) // {“data”:{“hello”:”world”}} 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/examples/http/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "1": { 3 | "id": "1", 4 | "name": "Dan" 5 | }, 6 | "2": { 7 | "id": "2", 8 | "name": "Lee" 9 | }, 10 | "3": { 11 | "id": "3", 12 | "name": "Nick" 13 | } 14 | } -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/examples/star-wars/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/http" 7 | 8 | "github.com/graphql-go/graphql" 9 | "github.com/graphql-go/graphql/testutil" 10 | ) 11 | 12 | func main() { 13 | http.HandleFunc("/graphql", func(w http.ResponseWriter, r *http.Request) { 14 | query := r.URL.Query()["query"][0] 15 | result := graphql.Do(graphql.Params{ 16 | Schema: testutil.StarWarsSchema, 17 | RequestString: query, 18 | }) 19 | json.NewEncoder(w).Encode(result) 20 | }) 21 | fmt.Println("Now server is running on port 8080") 22 | fmt.Println("Test with Get : curl -g 'http://localhost:8080/graphql?query={hero{name}}'") 23 | http.ListenAndServe(":8080", nil) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/examples/todo/README.md: -------------------------------------------------------------------------------- 1 | # Go GraphQL ToDo example 2 | 3 | An example that consists of basic core GraphQL queries and mutations. 4 | 5 | To run the example navigate to the example directory by using your shell of choice. 6 | 7 | ``` 8 | cd examples/todo 9 | ``` 10 | 11 | Run the example, it will spawn a GraphQL HTTP endpoint 12 | 13 | ``` 14 | go run main.go 15 | ``` 16 | 17 | Execute queries via shell. 18 | 19 | ``` 20 | // To get single ToDo item by ID 21 | curl -g 'http://localhost:8080/graphql?query={todo(id:"b"){id,text,done}}' 22 | 23 | // To create a ToDo item 24 | curl -g 'http://localhost:8080/graphql?query=mutation+_{createTodo(text:"My+new+todo"){id,text,done}}' 25 | 26 | // To get a list of ToDo items 27 | curl -g 'http://localhost:8080/graphql?query={todoList{id,text,done}}' 28 | ``` 29 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/gqlerrors/formatted.go: -------------------------------------------------------------------------------- 1 | package gqlerrors 2 | 3 | import ( 4 | "errors" 5 | 6 | "github.com/graphql-go/graphql/language/location" 7 | ) 8 | 9 | type FormattedError struct { 10 | Message string `json:"message"` 11 | Locations []location.SourceLocation `json:"locations"` 12 | } 13 | 14 | func (g FormattedError) Error() string { 15 | return g.Message 16 | } 17 | 18 | func NewFormattedError(message string) FormattedError { 19 | err := errors.New(message) 20 | return FormatError(err) 21 | } 22 | 23 | func FormatError(err error) FormattedError { 24 | switch err := err.(type) { 25 | case FormattedError: 26 | return err 27 | case *Error: 28 | return FormattedError{ 29 | Message: err.Error(), 30 | Locations: err.Locations, 31 | } 32 | case Error: 33 | return FormattedError{ 34 | Message: err.Error(), 35 | Locations: err.Locations, 36 | } 37 | default: 38 | return FormattedError{ 39 | Message: err.Error(), 40 | Locations: []location.SourceLocation{}, 41 | } 42 | } 43 | } 44 | 45 | func FormatErrors(errs ...error) []FormattedError { 46 | formattedErrors := []FormattedError{} 47 | for _, err := range errs { 48 | formattedErrors = append(formattedErrors, FormatError(err)) 49 | } 50 | return formattedErrors 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/gqlerrors/located.go: -------------------------------------------------------------------------------- 1 | package gqlerrors 2 | 3 | import ( 4 | "errors" 5 | "github.com/graphql-go/graphql/language/ast" 6 | ) 7 | 8 | // NewLocatedError creates a graphql.Error with location info 9 | // @deprecated 0.4.18 10 | // Already exists in `graphql.NewLocatedError()` 11 | func NewLocatedError(err interface{}, nodes []ast.Node) *Error { 12 | var origError error 13 | message := "An unknown error occurred." 14 | if err, ok := err.(error); ok { 15 | message = err.Error() 16 | origError = err 17 | } 18 | if err, ok := err.(string); ok { 19 | message = err 20 | origError = errors.New(err) 21 | } 22 | stack := message 23 | return NewError( 24 | message, 25 | nodes, 26 | stack, 27 | nil, 28 | []int{}, 29 | origError, 30 | ) 31 | } 32 | 33 | func FieldASTsToNodeASTs(fieldASTs []*ast.Field) []ast.Node { 34 | nodes := []ast.Node{} 35 | for _, fieldAST := range fieldASTs { 36 | nodes = append(nodes, fieldAST) 37 | } 38 | return nodes 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/gqlerrors/sortutil.go: -------------------------------------------------------------------------------- 1 | package gqlerrors 2 | 3 | import "bytes" 4 | 5 | type FormattedErrors []FormattedError 6 | 7 | func (errs FormattedErrors) Len() int { 8 | return len(errs) 9 | } 10 | 11 | func (errs FormattedErrors) Swap(i, j int) { 12 | errs[i], errs[j] = errs[j], errs[i] 13 | } 14 | 15 | func (errs FormattedErrors) Less(i, j int) bool { 16 | mCompare := bytes.Compare([]byte(errs[i].Message), []byte(errs[j].Message)) 17 | lesserLine := errs[i].Locations[0].Line < errs[j].Locations[0].Line 18 | eqLine := errs[i].Locations[0].Line == errs[j].Locations[0].Line 19 | lesserColumn := errs[i].Locations[0].Column < errs[j].Locations[0].Column 20 | if mCompare < 0 { 21 | return true 22 | } 23 | if mCompare == 0 && lesserLine { 24 | return true 25 | } 26 | if mCompare == 0 && eqLine && lesserColumn { 27 | return true 28 | } 29 | return false 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/kitchen-sink.graphql: -------------------------------------------------------------------------------- 1 | # Filename: kitchen-sink.graphql 2 | 3 | query namedQuery($foo: ComplexFooType, $bar: Bar = DefaultBarValue) { 4 | customUser: user(id: [987, 654]) { 5 | id, 6 | ... on User @defer { 7 | field2 { 8 | id , 9 | alias: field1(first:10, after:$foo,) @include(if: $foo) { 10 | id, 11 | ...frag 12 | } 13 | } 14 | } 15 | ... @skip(unless: $foo) { 16 | id 17 | } 18 | ... { 19 | id 20 | } 21 | } 22 | } 23 | 24 | mutation favPost { 25 | fav(post: 123) @defer { 26 | post { 27 | id 28 | } 29 | } 30 | } 31 | 32 | subscription PostFavSubscription($input: StoryLikeSubscribeInput) { 33 | postFavSubscribe(input: $input) { 34 | post { 35 | favers { 36 | count 37 | } 38 | favSentence { 39 | text 40 | } 41 | } 42 | } 43 | } 44 | 45 | fragment frag on Follower { 46 | foo(size: $size, bar: $b, obj: {key: "value"}) 47 | } 48 | 49 | { 50 | unnamed(truthyVal: true, falseyVal: false), 51 | query 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/language/ast/arguments.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "github.com/graphql-go/graphql/language/kinds" 5 | ) 6 | 7 | // Argument implements Node 8 | type Argument struct { 9 | Kind string 10 | Loc *Location 11 | Name *Name 12 | Value Value 13 | } 14 | 15 | func NewArgument(arg *Argument) *Argument { 16 | if arg == nil { 17 | arg = &Argument{} 18 | } 19 | return &Argument{ 20 | Kind: kinds.Argument, 21 | Loc: arg.Loc, 22 | Name: arg.Name, 23 | Value: arg.Value, 24 | } 25 | } 26 | 27 | func (arg *Argument) GetKind() string { 28 | return arg.Kind 29 | } 30 | 31 | func (arg *Argument) GetLoc() *Location { 32 | return arg.Loc 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/language/ast/directives.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "github.com/graphql-go/graphql/language/kinds" 5 | ) 6 | 7 | // Directive implements Node 8 | type Directive struct { 9 | Kind string 10 | Loc *Location 11 | Name *Name 12 | Arguments []*Argument 13 | } 14 | 15 | func NewDirective(dir *Directive) *Directive { 16 | if dir == nil { 17 | dir = &Directive{} 18 | } 19 | return &Directive{ 20 | Kind: kinds.Directive, 21 | Loc: dir.Loc, 22 | Name: dir.Name, 23 | Arguments: dir.Arguments, 24 | } 25 | } 26 | 27 | func (dir *Directive) GetKind() string { 28 | return dir.Kind 29 | } 30 | 31 | func (dir *Directive) GetLoc() *Location { 32 | return dir.Loc 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/language/ast/document.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "github.com/graphql-go/graphql/language/kinds" 5 | ) 6 | 7 | // Document implements Node 8 | type Document struct { 9 | Kind string 10 | Loc *Location 11 | Definitions []Node 12 | } 13 | 14 | func NewDocument(d *Document) *Document { 15 | if d == nil { 16 | d = &Document{} 17 | } 18 | return &Document{ 19 | Kind: kinds.Document, 20 | Loc: d.Loc, 21 | Definitions: d.Definitions, 22 | } 23 | } 24 | 25 | func (node *Document) GetKind() string { 26 | return node.Kind 27 | } 28 | 29 | func (node *Document) GetLoc() *Location { 30 | return node.Loc 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/language/ast/location.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "github.com/graphql-go/graphql/language/source" 5 | ) 6 | 7 | type Location struct { 8 | Start int 9 | End int 10 | Source *source.Source 11 | } 12 | 13 | func NewLocation(loc *Location) *Location { 14 | if loc == nil { 15 | loc = &Location{} 16 | } 17 | return &Location{ 18 | Start: loc.Start, 19 | End: loc.End, 20 | Source: loc.Source, 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/language/ast/name.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "github.com/graphql-go/graphql/language/kinds" 5 | ) 6 | 7 | // Name implements Node 8 | type Name struct { 9 | Kind string 10 | Loc *Location 11 | Value string 12 | } 13 | 14 | func NewName(node *Name) *Name { 15 | if node == nil { 16 | node = &Name{} 17 | } 18 | return &Name{ 19 | Kind: kinds.Name, 20 | Value: node.Value, 21 | Loc: node.Loc, 22 | } 23 | } 24 | 25 | func (node *Name) GetKind() string { 26 | return node.Kind 27 | } 28 | 29 | func (node *Name) GetLoc() *Location { 30 | return node.Loc 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/language/location/location.go: -------------------------------------------------------------------------------- 1 | package location 2 | 3 | import ( 4 | "regexp" 5 | 6 | "github.com/graphql-go/graphql/language/source" 7 | ) 8 | 9 | type SourceLocation struct { 10 | Line int `json:"line"` 11 | Column int `json:"column"` 12 | } 13 | 14 | func GetLocation(s *source.Source, position int) SourceLocation { 15 | body := []byte{} 16 | if s != nil { 17 | body = s.Body 18 | } 19 | line := 1 20 | column := position + 1 21 | lineRegexp := regexp.MustCompile("\r\n|[\n\r]") 22 | matches := lineRegexp.FindAllIndex(body, -1) 23 | for _, match := range matches { 24 | matchIndex := match[0] 25 | if matchIndex < position { 26 | line++ 27 | l := len(s.Body[match[0]:match[1]]) 28 | column = position + 1 - (matchIndex + l) 29 | continue 30 | } else { 31 | break 32 | } 33 | } 34 | return SourceLocation{Line: line, Column: column} 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/language/source/source.go: -------------------------------------------------------------------------------- 1 | package source 2 | 3 | const ( 4 | name = "GraphQL" 5 | ) 6 | 7 | type Source struct { 8 | Body []byte 9 | Name string 10 | } 11 | 12 | func NewSource(s *Source) *Source { 13 | if s == nil { 14 | s = &Source{Name: name} 15 | } 16 | if s.Name == "" { 17 | s.Name = name 18 | } 19 | return s 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/language/typeInfo/type_info.go: -------------------------------------------------------------------------------- 1 | package typeInfo 2 | 3 | import ( 4 | "github.com/graphql-go/graphql/language/ast" 5 | ) 6 | 7 | // TypeInfoI defines the interface for TypeInfo Implementation 8 | type TypeInfoI interface { 9 | Enter(node ast.Node) 10 | Leave(node ast.Node) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/located.go: -------------------------------------------------------------------------------- 1 | package graphql 2 | 3 | import ( 4 | "errors" 5 | "github.com/graphql-go/graphql/gqlerrors" 6 | "github.com/graphql-go/graphql/language/ast" 7 | ) 8 | 9 | func NewLocatedError(err interface{}, nodes []ast.Node) *gqlerrors.Error { 10 | var origError error 11 | message := "An unknown error occurred." 12 | if err, ok := err.(error); ok { 13 | message = err.Error() 14 | origError = err 15 | } 16 | if err, ok := err.(string); ok { 17 | message = err 18 | origError = errors.New(err) 19 | } 20 | stack := message 21 | return gqlerrors.NewError( 22 | message, 23 | nodes, 24 | stack, 25 | nil, 26 | []int{}, 27 | origError, 28 | ) 29 | } 30 | 31 | func FieldASTsToNodeASTs(fieldASTs []*ast.Field) []ast.Node { 32 | nodes := []ast.Node{} 33 | for _, fieldAST := range fieldASTs { 34 | nodes = append(nodes, fieldAST) 35 | } 36 | return nodes 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/quoted_or_list_internal_test.go: -------------------------------------------------------------------------------- 1 | package graphql 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | ) 7 | 8 | func TestQuotedOrList_DoesNoAcceptAnEmptyList(t *testing.T) { 9 | expected := "" 10 | result := quotedOrList([]string{}) 11 | if !reflect.DeepEqual(expected, result) { 12 | t.Fatalf("Expected %v, got: %v", expected, result) 13 | } 14 | } 15 | func TestQuotedOrList_ReturnsSingleQuotedItem(t *testing.T) { 16 | expected := `"A"` 17 | result := quotedOrList([]string{"A"}) 18 | if !reflect.DeepEqual(expected, result) { 19 | t.Fatalf("Expected %v, got: %v", expected, result) 20 | } 21 | } 22 | func TestQuotedOrList_ReturnsTwoItems(t *testing.T) { 23 | expected := `"A" or "B"` 24 | result := quotedOrList([]string{"A", "B"}) 25 | if !reflect.DeepEqual(expected, result) { 26 | t.Fatalf("Expected %v, got: %v", expected, result) 27 | } 28 | } 29 | func TestQuotedOrList_ReturnsCommaSeparatedManyItemList(t *testing.T) { 30 | expected := `"A", "B", "C", "D", or "E"` 31 | result := quotedOrList([]string{"A", "B", "C", "D", "E", "F"}) 32 | if !reflect.DeepEqual(expected, result) { 33 | t.Fatalf("Expected %v, got: %v", expected, result) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/rules_known_fragment_names_test.go: -------------------------------------------------------------------------------- 1 | package graphql_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/graphql-go/graphql" 7 | "github.com/graphql-go/graphql/gqlerrors" 8 | "github.com/graphql-go/graphql/testutil" 9 | ) 10 | 11 | func TestValidate_KnownFragmentNames_KnownFragmentNamesAreValid(t *testing.T) { 12 | testutil.ExpectPassesRule(t, graphql.KnownFragmentNamesRule, ` 13 | { 14 | human(id: 4) { 15 | ...HumanFields1 16 | ... on Human { 17 | ...HumanFields2 18 | } 19 | ... { 20 | name 21 | } 22 | } 23 | } 24 | fragment HumanFields1 on Human { 25 | name 26 | ...HumanFields3 27 | } 28 | fragment HumanFields2 on Human { 29 | name 30 | } 31 | fragment HumanFields3 on Human { 32 | name 33 | } 34 | `) 35 | } 36 | func TestValidate_KnownFragmentNames_UnknownFragmentNamesAreInvalid(t *testing.T) { 37 | testutil.ExpectFailsRule(t, graphql.KnownFragmentNamesRule, ` 38 | { 39 | human(id: 4) { 40 | ...UnknownFragment1 41 | ... on Human { 42 | ...UnknownFragment2 43 | } 44 | } 45 | } 46 | fragment HumanFields on Human { 47 | name 48 | ...UnknownFragment3 49 | } 50 | `, []gqlerrors.FormattedError{ 51 | testutil.RuleError(`Unknown fragment "UnknownFragment1".`, 4, 14), 52 | testutil.RuleError(`Unknown fragment "UnknownFragment2".`, 6, 16), 53 | testutil.RuleError(`Unknown fragment "UnknownFragment3".`, 12, 12), 54 | }) 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/rules_unique_variable_names_test.go: -------------------------------------------------------------------------------- 1 | package graphql_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/graphql-go/graphql" 7 | "github.com/graphql-go/graphql/gqlerrors" 8 | "github.com/graphql-go/graphql/testutil" 9 | ) 10 | 11 | func TestValidate_UniqueVariableNames_UniqueVariableNames(t *testing.T) { 12 | testutil.ExpectPassesRule(t, graphql.UniqueVariableNamesRule, ` 13 | query A($x: Int, $y: String) { __typename } 14 | query B($x: String, $y: Int) { __typename } 15 | `) 16 | } 17 | func TestValidate_UniqueVariableNames_DuplicateVariableNames(t *testing.T) { 18 | testutil.ExpectFailsRule(t, graphql.UniqueVariableNamesRule, ` 19 | query A($x: Int, $x: Int, $x: String) { __typename } 20 | query B($x: String, $x: Int) { __typename } 21 | query C($x: Int, $x: Int) { __typename } 22 | `, []gqlerrors.FormattedError{ 23 | testutil.RuleError(`There can only be one variable named "x".`, 2, 16, 2, 25), 24 | testutil.RuleError(`There can only be one variable named "x".`, 2, 16, 2, 34), 25 | testutil.RuleError(`There can only be one variable named "x".`, 3, 16, 3, 28), 26 | testutil.RuleError(`There can only be one variable named "x".`, 4, 16, 4, 25), 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/rules_variables_are_input_types_test.go: -------------------------------------------------------------------------------- 1 | package graphql_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/graphql-go/graphql" 7 | "github.com/graphql-go/graphql/gqlerrors" 8 | "github.com/graphql-go/graphql/testutil" 9 | ) 10 | 11 | func TestValidate_VariablesAreInputTypes_(t *testing.T) { 12 | testutil.ExpectPassesRule(t, graphql.VariablesAreInputTypesRule, ` 13 | query Foo($a: String, $b: [Boolean!]!, $c: ComplexInput) { 14 | field(a: $a, b: $b, c: $c) 15 | } 16 | `) 17 | } 18 | func TestValidate_VariablesAreInputTypes_1(t *testing.T) { 19 | testutil.ExpectFailsRule(t, graphql.VariablesAreInputTypesRule, ` 20 | query Foo($a: Dog, $b: [[CatOrDog!]]!, $c: Pet) { 21 | field(a: $a, b: $b, c: $c) 22 | } 23 | `, []gqlerrors.FormattedError{ 24 | testutil.RuleError(`Variable "$a" cannot be non-input type "Dog".`, 2, 21), 25 | testutil.RuleError(`Variable "$b" cannot be non-input type "[[CatOrDog!]]!".`, 2, 30), 26 | testutil.RuleError(`Variable "$c" cannot be non-input type "Pet".`, 2, 50), 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/suggested_list_internal_test.go: -------------------------------------------------------------------------------- 1 | package graphql 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | ) 7 | 8 | func TestSuggestionList_ReturnsResultsWhenInputIsEmpty(t *testing.T) { 9 | expected := []string{"a"} 10 | result := suggestionList("", []string{"a"}) 11 | if !reflect.DeepEqual(expected, result) { 12 | t.Fatalf("Expected %v, got: %v", expected, result) 13 | } 14 | } 15 | func TestSuggestionList_ReturnsEmptyArrayWhenThereAreNoOptions(t *testing.T) { 16 | expected := []string{} 17 | result := suggestionList("input", []string{}) 18 | if !reflect.DeepEqual(expected, result) { 19 | t.Fatalf("Expected %v, got: %v", expected, result) 20 | } 21 | } 22 | func TestSuggestionList_ReturnsOptionsSortedBasedOnSimilarity(t *testing.T) { 23 | expected := []string{"abc", "ab"} 24 | result := suggestionList("abc", []string{"a", "ab", "abc"}) 25 | if !reflect.DeepEqual(expected, result) { 26 | t.Fatalf("Expected %v, got: %v", expected, result) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/graphql-go/graphql/types.go: -------------------------------------------------------------------------------- 1 | package graphql 2 | 3 | import ( 4 | "github.com/graphql-go/graphql/gqlerrors" 5 | ) 6 | 7 | // type Schema interface{} 8 | 9 | type Result struct { 10 | Data interface{} `json:"data"` 11 | Errors []gqlerrors.FormattedError `json:"errors,omitempty"` 12 | } 13 | 14 | func (r *Result) HasErrors() bool { 15 | return (len(r.Errors) > 0) 16 | } 17 | -------------------------------------------------------------------------------- /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/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go networking libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/bpf/asm.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 6 | 7 | import "fmt" 8 | 9 | // Assemble converts insts into raw instructions suitable for loading 10 | // into a BPF virtual machine. 11 | // 12 | // Currently, no optimization is attempted, the assembled program flow 13 | // is exactly as provided. 14 | func Assemble(insts []Instruction) ([]RawInstruction, error) { 15 | ret := make([]RawInstruction, len(insts)) 16 | var err error 17 | for i, inst := range insts { 18 | ret[i], err = inst.Assemble() 19 | if err != nil { 20 | return nil, fmt.Errorf("assembling instruction %d: %s", i+1, err) 21 | } 22 | } 23 | return ret, nil 24 | } 25 | 26 | // Disassemble attempts to parse raw back into 27 | // Instructions. Unrecognized RawInstructions are assumed to be an 28 | // extension not implemented by this package, and are passed through 29 | // unchanged to the output. The allDecoded value reports whether insts 30 | // contains no RawInstructions. 31 | func Disassemble(raw []RawInstruction) (insts []Instruction, allDecoded bool) { 32 | insts = make([]Instruction, len(raw)) 33 | allDecoded = true 34 | for i, r := range raw { 35 | insts[i] = r.Disassemble() 36 | if _, ok := insts[i].(RawInstruction); ok { 37 | allDecoded = false 38 | } 39 | } 40 | return insts, allDecoded 41 | } 42 | -------------------------------------------------------------------------------- /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/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 | func ExampleWithTimeout() { 15 | // Pass a context with a timeout to tell a blocking function that it 16 | // should abandon its work after the timeout elapses. 17 | ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond) 18 | select { 19 | case <-time.After(200 * time.Millisecond): 20 | fmt.Println("overslept") 21 | case <-ctx.Done(): 22 | fmt.Println(ctx.Err()) // prints "context deadline exceeded" 23 | } 24 | // Output: 25 | // context deadline exceeded 26 | } 27 | -------------------------------------------------------------------------------- /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/zeucxb/golang-graphql-talk/5f3ba040e20077e815e3360f92daca5d55fccd1c/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/zeucxb/golang-graphql-talk/5f3ba040e20077e815e3360f92daca5d55fccd1c/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 | |