diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..4e37148 Binary files /dev/null and b/.DS_Store differ diff --git a/Makefile b/Makefile index d4ff3e3..6026723 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,31 @@ -.PHONY: install example - -install: - go install github.com/gogo/protobuf/protoc-gen-gogo - protoc --gogo_out=paths=source_relative,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:./pb \ - -I=${GOPATH}/pkg/mod/ -I=./pb ./pb/*.proto - go install ./protoc-gen-gql - go install ./protoc-gen-gogqlgen - go install ./protoc-gen-gqlgencfg - -example: - protoc \ - --go_out=plugins=grpc,paths=source_relative:. \ - --gqlgencfg_out=paths=source_relative:. \ - --gql_out=svcdir=true,paths=source_relative:. \ - --gogqlgen_out=paths=source_relative,gogoimport=false:. \ - -I=. -I=./example/ ./example/*.proto +# Go tools dependencies +GO_TOOLS := \ + google.golang.org/grpc/cmd/protoc-gen-go-grpc \ + google.golang.org/protobuf/cmd/protoc-gen-go \ + github.com/99designs/gqlgen \ + ./protoc-gen-gql \ + ./protoc-gen-gogql + +GOPATH := $(shell go env GOPATH) + +.PHONY: all +all: all-tools pb/graphql.pb.go + +.PHONY: all-tools +all-tools: ${GOPATH}/bin/protoc go-tools + +.PHONY: go-tools +go-tools: $(foreach l, ${GO_TOOLS}, ${GOPATH}/bin/$(notdir $(l))) + +define LIST_RULE +${GOPATH}/bin/$(notdir $(1)): go.mod + go install $(1) +endef + +$(foreach l, $(GO_TOOLS), $(eval $(call LIST_RULE, $(l) ))) + +pb/graphql.pb.go: ./pb/graphql.proto all-tools + protoc --go_out=paths=source_relative:. ./pb/graphql.proto + +${GOPATH}/bin/protoc: + ./scripts/install-protoc.sh diff --git a/Readme.md b/Readme.md index ace6f2a..56265fa 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ -Protoc plugins for generating graphql schema +Protoc plugins for generating graphql schema and go graphql code -If you use micro-service architecture with grpc for backend and graphql api gateway for frontend you will find yourself +If you use micro-service architecture with grpc for back-end and graphql api gateway for front-end, you will find yourself repeating a lot of code for translating from one transport layer to another (which many times may be a source of bugs) This repository aims to simplify working with grpc trough protocol buffers and graphql by generating code. @@ -10,8 +10,7 @@ Install: ```sh go install github.com/danielvladco/go-proto-gql/protoc-gen-gql -go install github.com/danielvladco/go-proto-gql/protoc-gen-gogqlgen -go install github.com/danielvladco/go-proto-gql/protoc-gen-gqlgencfg +go install github.com/danielvladco/go-proto-gql/protoc-gen-gogql ``` Usage Examples: @@ -23,7 +22,7 @@ export PATH=${PATH}:${GOPATH}/bin ``` --- -`--gql_out` plugin will generate graphql files with extension .graphqls +`--gql_out` plugin will generate graphql files with extension `.graphqls` rather than go code which means it can be further used for any other language or framework. Example: @@ -36,38 +35,28 @@ http://github.com/99designs/gqlgen plugin, and map all the generated go types wi Luckily `--gqlgencfg_out` plugin does exactly this. --- -`--gqlgencfg_out` plugin generates yaml configs that can be used further by the http://github.com/99designs/gqlgen library. - -Example: -```sh -protoc --gqlgencfg_out=paths=source_relative:. -I=. -I=./example/ ./example/*.proto -``` - -The generated go code will work fine if you don't have any `enum`s, `oneof`s or `map`s. For this purpose use `--gogqlgen_out` plugin. - ---- -`--gogqlgen_out` plugin generates generates methods for implementing +`--gogql_out` plugin generates methods for implementing `github.com/99designs/gqlgen/graphql.Marshaler` and `github.com/99designs/gqlgen/graphql.Unmarshaler` interfaces. Now proto `enum`s, `oneof`s and `map`s will work fine with graphql. This plugin also creates convenience methods that will implement generated by the `gqlgen` `MutationResolver` and `QueryResolver` interfaces. -NOTE: to generate with gogo import add `gogoimport=true` as a parameter - Example: ```sh -protoc --gogqlgen_out=gogoimport=false,paths=source_relative:. -I=. -I=./example/ ./example/*.proto +protoc --gogql_out=gogoimport=false,paths=source_relative:. -I=. -I=./example/ ./example/*.proto ``` --- See `/example` folder for more examples. -TODO: -- Create a better implementation of `map`s and `oneof`s. -- Add comments from proto to gql for documentation purposes. -- Add more documentation. +## Gateway (alpha) +A unified gateway is also possible. Right now a gateway can be spawn up +pointing to a list of grpc endpoints (grpc reflection must be enabled on the grpc servers). +The gateway will query the servers for protobuf descriptors and generate a graphql schema abstract tree. +The requests to the gateway will be transformed on the fly to grpc servers without any additional code generation +or writing any code at all. See `examples/gateway` for usage more info. ## Community: -I am one on this. Will be very glad for any contributions so feel free to create issues and forks. +Will be very glad for any contributions so feel free to create issues, forks and PRs. ## License: diff --git a/cmd/gateway/main.go b/cmd/gateway/main.go new file mode 100644 index 0000000..56cf003 --- /dev/null +++ b/cmd/gateway/main.go @@ -0,0 +1,121 @@ +package main + +import ( + "context" + "encoding/json" + "flag" + "log" + "net/http" + "os" + + "github.com/mitchellh/mapstructure" + "github.com/nautilus/gateway" + "github.com/nautilus/graphql" + + "github.com/danielvladco/go-proto-gql/pkg/generator" + "github.com/danielvladco/go-proto-gql/pkg/server" +) + +type Config struct { + Endpoints []string `json:"endpoints"` + Playground *bool `json:"playground"` + Address string `json:"address"` +} + +var ( + configFile = flag.String("cfg", "/opt/config.json", "") +) + +func main() { + flag.Parse() + + f, err := os.Open(*configFile) + fatalOnErr(err) + cfg := &Config{} + err = json.NewDecoder(f).Decode(cfg) + fatalOnErr(err) + if cfg.Address == "" { + cfg.Address = ":8080" + } + if cfg.Playground == nil { + plg := true + cfg.Playground = &plg + } + + caller, descs, _, err := server.NewReflectCaller(cfg.Endpoints) + if err != nil { + log.Fatal(err) + } + + gqlDesc, err := generator.NewSchemas(descs, true, true) + fatalOnErr(err) + + repo := generator.NewRegistry(gqlDesc) + + queryFactory := gateway.QueryerFactory(func(ctx *gateway.PlanningContext, url string) graphql.Queryer { + return server.QueryerLogger{server.NewQueryer(repo, caller)} + }) + sources := []*graphql.RemoteSchema{{URL: "url1"}} + sources[0].Schema = gqlDesc.AsGraphql()[0] + + //sc, _ := os.Create("schema.graphql") + //defer sc.Close() + //formatter.NewFormatter(sc).FormatSchema(sources[0].Schema) + + g, err := gateway.New(sources, gateway.WithQueryerFactory(&queryFactory)) + if err != nil { + log.Fatal(err) + } + result := &graphql.IntrospectionQueryResult{} + err = schemaTestLoadQuery(g, graphql.IntrospectionQuery, result, map[string]interface{}{}) + + //in, _ := os.Create("introspection.json") + //defer in.Close() + //_ = json.NewEncoder(in).Encode(result) + + mux := http.NewServeMux() + mux.HandleFunc("/query", g.GraphQLHandler) + if *cfg.Playground { + mux.HandleFunc("/playground", g.PlaygroundHandler) + } + log.Fatal(http.ListenAndServe(cfg.Address, mux)) +} + +func fatalOnErr(err error) { + if err != nil { + panic(err) + } +} + +func schemaTestLoadQuery(qw *gateway.Gateway, query string, target interface{}, variables map[string]interface{}) error { + reqCtx := &gateway.RequestContext{ + Context: context.Background(), + Query: query, + Variables: variables, + } + plan, err := qw.GetPlans(reqCtx) + if err != nil { + return err + } + + // executing the introspection query should return a full description of the schema + response, err := qw.Execute(reqCtx, plan) + if err != nil { + return err + } + + // massage the map into the structure + decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ + TagName: "json", + Result: target, + }) + if err != nil { + return err + } + err = decoder.Decode(response) + if err != nil { + return err + } + + return nil +} diff --git a/cmd/protogql/main.go b/cmd/protogql/main.go new file mode 100644 index 0000000..a360296 --- /dev/null +++ b/cmd/protogql/main.go @@ -0,0 +1,94 @@ +package main + +import ( + "flag" + "log" + "os" + "path" + "path/filepath" + "strings" + + "github.com/jhump/protoreflect/desc/protoparse" + "github.com/vektah/gqlparser/v2/formatter" + + "github.com/danielvladco/go-proto-gql/pkg/generator" +) + +type arrayFlags []string + +func (i *arrayFlags) String() string { + return "str list" +} + +func (i *arrayFlags) Set(value string) error { + *i = append(*i, value) + return nil +} + +var ( + importPath = arrayFlags{} + fileNames = arrayFlags{} + svc = flag.Bool("svc", false, "") + merge = flag.Bool("merge", false, "") +) + +func main() { + flag.Var(&importPath, "I", "path") + flag.Var(&fileNames, "f", "path") + flag.Parse() + + newFileNames, err := protoparse.ResolveFilenames(importPath, fileNames...) + if err != nil { + log.Fatal(err) + } + descs, err := protoparse.Parser{ImportPaths: importPath}.ParseFiles(newFileNames...) + if err != nil { + log.Fatal(err) + } + gqlDesc, err := generator.NewSchemas(descs, *merge, *svc) + if err != nil { + log.Fatal(err) + } + for _, schema := range gqlDesc { + if len(schema.FileDescriptors) < 1 { + log.Fatalf("unexpected number of proto descriptors: %d for gql schema", len(schema.FileDescriptors)) + } + if len(schema.FileDescriptors) > 1 { + if err := generateFile(schema, true); err != nil { + log.Fatal(err) + } + break + } + if err := generateFile(schema, *merge); err != nil { + log.Fatal(err) + } + } +} + +func generateFile(schema *generator.SchemaDescriptor, merge bool) error { + sc, err := os.Create(resolveGraphqlFilename(schema.FileDescriptors[0].GetName(), merge)) + if err != nil { + return err + } + defer sc.Close() + + formatter.NewFormatter(sc).FormatSchema(schema.AsGraphql()) + return nil +} + +func resolveGraphqlFilename(protoFileName string, merge bool) string { + if merge { + gqlFileName := "schema.graphqls" + absProtoFileName, err := filepath.Abs(protoFileName) + if err == nil { + protoDirSlice := strings.Split(filepath.Dir(absProtoFileName), string(filepath.Separator)) + if len(protoDirSlice) > 0 { + gqlFileName = protoDirSlice[len(protoDirSlice)-1] + ".graphqls" + } + } + protoDir, _ := path.Split(protoFileName) + return path.Join(protoDir, gqlFileName) + } + + return strings.TrimSuffix(protoFileName, path.Ext(protoFileName)) + ".graphqls" +} diff --git a/example/codegen/Makefile b/example/codegen/Makefile new file mode 100644 index 0000000..4f02a03 --- /dev/null +++ b/example/codegen/Makefile @@ -0,0 +1,22 @@ +.PHONY: generate start + +start: generate + go run ./main.go + +generate: gql/constructs/generated.go gql/options/generated.go + +pb/%.gqlgen.pb.go: pb/%.proto pb/%_grpc.pb.go pb/%.pb.go + protoc --gogql_out=paths=source_relative:. -I . -I ../../ ./pb/$*.proto + +pb/%_grpc.pb.go: pb/%.proto pb/%.pb.go + protoc --go-grpc_out=paths=source_relative:. -I . -I ../../ ./pb/$*.proto + +pb/%.pb.go: pb/%.proto + protoc --go_out=paths=source_relative:. -I . -I ../../ ./pb/$*.proto + +pb/%.graphqls: pb/%.proto + protoc --gql_out=svc=true:. -I . -I ../../ ./pb/$*.proto + +gql/%/generated.go: pb/%.graphqls pb/%.gqlgen.pb.go + gqlgen --config ./gqlgen-$*.yaml + diff --git a/example/codegen/gql/constructs/generated.go b/example/codegen/gql/constructs/generated.go new file mode 100644 index 0000000..e02a68b --- /dev/null +++ b/example/codegen/gql/constructs/generated.go @@ -0,0 +1,13623 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package constructs + +import ( + "bytes" + "context" + "errors" + "fmt" + "strconv" + "sync" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/danielvladco/go-proto-gql/example/codegen/pb" + "github.com/danielvladco/go-proto-gql/pkg/types" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" + "google.golang.org/protobuf/types/known/anypb" + "google.golang.org/protobuf/types/known/timestamppb" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Maps() MapsResolver + Mutation() MutationResolver + Oneof() OneofResolver + Query() QueryResolver + MapsInput() MapsInputResolver + OneofInput() OneofInputResolver +} + +type DirectiveRoot struct { + Constructs func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + Oneof_Oneof1 func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + Oneof_Oneof2 func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + Oneof_Oneof3 func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) +} + +type ComplexityRoot struct { + Baz struct { + Param1 func(childComplexity int) int + } + + Foo struct { + Param1 func(childComplexity int) int + Param2 func(childComplexity int) int + } + + FooFoo2 struct { + Param1 func(childComplexity int) int + } + + GoogleProtobufTimestamp struct { + Nanos func(childComplexity int) int + Seconds func(childComplexity int) int + } + + Maps struct { + BoolBool func(childComplexity int) int + Fixed32Fixed32 func(childComplexity int) int + Fixed64Fixed64 func(childComplexity int) int + Int32Int32 func(childComplexity int) int + Int64Int64 func(childComplexity int) int + Sfixed32Sfixed32 func(childComplexity int) int + Sfixed64Sfixed64 func(childComplexity int) int + Sint32Sint32 func(childComplexity int) int + Sint64Sint64 func(childComplexity int) int + StringBar func(childComplexity int) int + StringBytes func(childComplexity int) int + StringDouble func(childComplexity int) int + StringFloat func(childComplexity int) int + StringFoo func(childComplexity int) int + StringString func(childComplexity int) int + Uint32Uint32 func(childComplexity int) int + Uint64Uint64 func(childComplexity int) int + } + + MapsBoolBoolEntry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsFixed32Fixed32Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsFixed64Fixed64Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsInt32Int32Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsInt64Int64Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsSfixed32Sfixed32Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsSfixed64Sfixed64Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsSint32Sint32Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsSint64Sint64Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsStringBarEntry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsStringBytesEntry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsStringDoubleEntry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsStringFloatEntry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsStringFooEntry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsStringStringEntry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsUint32Uint32Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + MapsUint64Uint64Entry struct { + Key func(childComplexity int) int + Value func(childComplexity int) int + } + + Mutation struct { + ConstructsAny func(childComplexity int, in *anypb.Any) int + ConstructsCallWithID func(childComplexity int) int + ConstructsEmpty func(childComplexity int) int + ConstructsEmpty2 func(childComplexity int) int + ConstructsEmpty3 func(childComplexity int) int + ConstructsMaps func(childComplexity int, in *pb.Maps) int + ConstructsOneof func(childComplexity int, in *pb.Oneof) int + ConstructsRef func(childComplexity int, in *pb.Ref) int + ConstructsRepeated func(childComplexity int, in *pb.Repeated) int + ConstructsScalars func(childComplexity int, in *pb.Scalars) int + } + + Oneof struct { + Oneof1 func(childComplexity int) int + Oneof2 func(childComplexity int) int + Oneof3 func(childComplexity int) int + Param1 func(childComplexity int) int + } + + OneofParam2 struct { + Param2 func(childComplexity int) int + } + + OneofParam3 struct { + Param3 func(childComplexity int) int + } + + OneofParam4 struct { + Param4 func(childComplexity int) int + } + + OneofParam5 struct { + Param5 func(childComplexity int) int + } + + OneofParam6 struct { + Param6 func(childComplexity int) int + } + + PbAny struct { + Param1 func(childComplexity int) int + } + + Query struct { + Dummy func(childComplexity int) int + } + + Ref struct { + En1 func(childComplexity int) int + En2 func(childComplexity int) int + External func(childComplexity int) int + File func(childComplexity int) int + FileEnum func(childComplexity int) int + FileMsg func(childComplexity int) int + Foreign func(childComplexity int) int + Gz func(childComplexity int) int + Local func(childComplexity int) int + LocalTime func(childComplexity int) int + LocalTime2 func(childComplexity int) int + } + + RefBar struct { + Param1 func(childComplexity int) int + } + + RefFoo struct { + Bar1 func(childComplexity int) int + Bar2 func(childComplexity int) int + En1 func(childComplexity int) int + En2 func(childComplexity int) int + ExternalTime1 func(childComplexity int) int + LocalTime2 func(childComplexity int) int + } + + RefFooBar struct { + Param1 func(childComplexity int) int + } + + RefFooBazGz struct { + Param1 func(childComplexity int) int + } + + Repeated struct { + Bar func(childComplexity int) int + Bool func(childComplexity int) int + Bytes func(childComplexity int) int + Double func(childComplexity int) int + Fixed32 func(childComplexity int) int + Fixed64 func(childComplexity int) int + Float func(childComplexity int) int + Foo func(childComplexity int) int + Int32 func(childComplexity int) int + Int64 func(childComplexity int) int + Sfixed32 func(childComplexity int) int + Sfixed64 func(childComplexity int) int + Sint32 func(childComplexity int) int + Sint64 func(childComplexity int) int + StringX func(childComplexity int) int + Uint32 func(childComplexity int) int + Uint64 func(childComplexity int) int + } + + Scalars struct { + Bool func(childComplexity int) int + Bytes func(childComplexity int) int + Double func(childComplexity int) int + Fixed32 func(childComplexity int) int + Fixed64 func(childComplexity int) int + Float func(childComplexity int) int + Int32 func(childComplexity int) int + Int64 func(childComplexity int) int + Sfixed32 func(childComplexity int) int + Sfixed64 func(childComplexity int) int + Sint32 func(childComplexity int) int + Sint64 func(childComplexity int) int + StringX func(childComplexity int) int + Uint32 func(childComplexity int) int + Uint64 func(childComplexity int) int + } + + Timestamp struct { + Time func(childComplexity int) int + } +} + +type MapsResolver interface { + Int32Int32(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Int32Int32Entry, error) + Int64Int64(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Int64Int64Entry, error) + Uint32Uint32(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Uint32Uint32Entry, error) + Uint64Uint64(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Uint64Uint64Entry, error) + Sint32Sint32(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Sint32Sint32Entry, error) + Sint64Sint64(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Sint64Sint64Entry, error) + Fixed32Fixed32(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Fixed32Fixed32Entry, error) + Fixed64Fixed64(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Fixed64Fixed64Entry, error) + Sfixed32Sfixed32(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Sfixed32Sfixed32Entry, error) + Sfixed64Sfixed64(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_Sfixed64Sfixed64Entry, error) + BoolBool(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_BoolBoolEntry, error) + StringString(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_StringStringEntry, error) + StringBytes(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_StringBytesEntry, error) + StringFloat(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_StringFloatEntry, error) + StringDouble(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_StringDoubleEntry, error) + StringFoo(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_StringFooEntry, error) + StringBar(ctx context.Context, obj *pb.Maps) ([]*pb.Maps_StringBarEntry, error) +} +type MutationResolver interface { + ConstructsScalars(ctx context.Context, in *pb.Scalars) (*pb.Scalars, error) + ConstructsRepeated(ctx context.Context, in *pb.Repeated) (*pb.Repeated, error) + ConstructsMaps(ctx context.Context, in *pb.Maps) (*pb.Maps, error) + ConstructsAny(ctx context.Context, in *anypb.Any) (*pb.Any, error) + ConstructsEmpty(ctx context.Context) (*bool, error) + ConstructsEmpty2(ctx context.Context) (*bool, error) + ConstructsEmpty3(ctx context.Context) (*bool, error) + ConstructsRef(ctx context.Context, in *pb.Ref) (*pb.Ref, error) + ConstructsOneof(ctx context.Context, in *pb.Oneof) (*pb.Oneof, error) + ConstructsCallWithID(ctx context.Context) (*bool, error) +} +type OneofResolver interface { + Oneof1(ctx context.Context, obj *pb.Oneof) (pb.Oneof_Oneof1, error) + Oneof2(ctx context.Context, obj *pb.Oneof) (pb.Oneof_Oneof2, error) + Oneof3(ctx context.Context, obj *pb.Oneof) (pb.Oneof_Oneof3, error) +} +type QueryResolver interface { + Dummy(ctx context.Context) (*bool, error) +} + +type MapsInputResolver interface { + Int32Int32(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Int32Int32Entry) error + Int64Int64(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Int64Int64Entry) error + Uint32Uint32(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Uint32Uint32Entry) error + Uint64Uint64(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Uint64Uint64Entry) error + Sint32Sint32(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Sint32Sint32Entry) error + Sint64Sint64(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Sint64Sint64Entry) error + Fixed32Fixed32(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Fixed32Fixed32Entry) error + Fixed64Fixed64(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Fixed64Fixed64Entry) error + Sfixed32Sfixed32(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Sfixed32Sfixed32Entry) error + Sfixed64Sfixed64(ctx context.Context, obj *pb.Maps, data []*pb.Maps_Sfixed64Sfixed64Entry) error + BoolBool(ctx context.Context, obj *pb.Maps, data []*pb.Maps_BoolBoolEntry) error + StringString(ctx context.Context, obj *pb.Maps, data []*pb.Maps_StringStringEntry) error + StringBytes(ctx context.Context, obj *pb.Maps, data []*pb.Maps_StringBytesEntry) error + StringFloat(ctx context.Context, obj *pb.Maps, data []*pb.Maps_StringFloatEntry) error + StringDouble(ctx context.Context, obj *pb.Maps, data []*pb.Maps_StringDoubleEntry) error + StringFoo(ctx context.Context, obj *pb.Maps, data []*pb.Maps_StringFooEntry) error + StringBar(ctx context.Context, obj *pb.Maps, data []*pb.Maps_StringBarEntry) error +} +type OneofInputResolver interface { + Param2(ctx context.Context, obj *pb.Oneof, data *string) error + Param3(ctx context.Context, obj *pb.Oneof, data *string) error + Param4(ctx context.Context, obj *pb.Oneof, data *string) error + Param5(ctx context.Context, obj *pb.Oneof, data *string) error + Param6(ctx context.Context, obj *pb.Oneof, data *string) error +} + +type executableSchema struct { + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + return parsedSchema +} + +func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { + ec := executionContext{nil, e} + _ = ec + switch typeName + "." + field { + + case "Baz.param1": + if e.complexity.Baz.Param1 == nil { + break + } + + return e.complexity.Baz.Param1(childComplexity), true + + case "Foo.param1": + if e.complexity.Foo.Param1 == nil { + break + } + + return e.complexity.Foo.Param1(childComplexity), true + + case "Foo.param2": + if e.complexity.Foo.Param2 == nil { + break + } + + return e.complexity.Foo.Param2(childComplexity), true + + case "Foo_Foo2.param1": + if e.complexity.FooFoo2.Param1 == nil { + break + } + + return e.complexity.FooFoo2.Param1(childComplexity), true + + case "GoogleProtobuf_Timestamp.nanos": + if e.complexity.GoogleProtobufTimestamp.Nanos == nil { + break + } + + return e.complexity.GoogleProtobufTimestamp.Nanos(childComplexity), true + + case "GoogleProtobuf_Timestamp.seconds": + if e.complexity.GoogleProtobufTimestamp.Seconds == nil { + break + } + + return e.complexity.GoogleProtobufTimestamp.Seconds(childComplexity), true + + case "Maps.boolBool": + if e.complexity.Maps.BoolBool == nil { + break + } + + return e.complexity.Maps.BoolBool(childComplexity), true + + case "Maps.fixed32Fixed32": + if e.complexity.Maps.Fixed32Fixed32 == nil { + break + } + + return e.complexity.Maps.Fixed32Fixed32(childComplexity), true + + case "Maps.fixed64Fixed64": + if e.complexity.Maps.Fixed64Fixed64 == nil { + break + } + + return e.complexity.Maps.Fixed64Fixed64(childComplexity), true + + case "Maps.int32Int32": + if e.complexity.Maps.Int32Int32 == nil { + break + } + + return e.complexity.Maps.Int32Int32(childComplexity), true + + case "Maps.int64Int64": + if e.complexity.Maps.Int64Int64 == nil { + break + } + + return e.complexity.Maps.Int64Int64(childComplexity), true + + case "Maps.sfixed32Sfixed32": + if e.complexity.Maps.Sfixed32Sfixed32 == nil { + break + } + + return e.complexity.Maps.Sfixed32Sfixed32(childComplexity), true + + case "Maps.sfixed64Sfixed64": + if e.complexity.Maps.Sfixed64Sfixed64 == nil { + break + } + + return e.complexity.Maps.Sfixed64Sfixed64(childComplexity), true + + case "Maps.sint32Sint32": + if e.complexity.Maps.Sint32Sint32 == nil { + break + } + + return e.complexity.Maps.Sint32Sint32(childComplexity), true + + case "Maps.sint64Sint64": + if e.complexity.Maps.Sint64Sint64 == nil { + break + } + + return e.complexity.Maps.Sint64Sint64(childComplexity), true + + case "Maps.stringBar": + if e.complexity.Maps.StringBar == nil { + break + } + + return e.complexity.Maps.StringBar(childComplexity), true + + case "Maps.stringBytes": + if e.complexity.Maps.StringBytes == nil { + break + } + + return e.complexity.Maps.StringBytes(childComplexity), true + + case "Maps.stringDouble": + if e.complexity.Maps.StringDouble == nil { + break + } + + return e.complexity.Maps.StringDouble(childComplexity), true + + case "Maps.stringFloat": + if e.complexity.Maps.StringFloat == nil { + break + } + + return e.complexity.Maps.StringFloat(childComplexity), true + + case "Maps.stringFoo": + if e.complexity.Maps.StringFoo == nil { + break + } + + return e.complexity.Maps.StringFoo(childComplexity), true + + case "Maps.stringString": + if e.complexity.Maps.StringString == nil { + break + } + + return e.complexity.Maps.StringString(childComplexity), true + + case "Maps.uint32Uint32": + if e.complexity.Maps.Uint32Uint32 == nil { + break + } + + return e.complexity.Maps.Uint32Uint32(childComplexity), true + + case "Maps.uint64Uint64": + if e.complexity.Maps.Uint64Uint64 == nil { + break + } + + return e.complexity.Maps.Uint64Uint64(childComplexity), true + + case "Maps_BoolBoolEntry.key": + if e.complexity.MapsBoolBoolEntry.Key == nil { + break + } + + return e.complexity.MapsBoolBoolEntry.Key(childComplexity), true + + case "Maps_BoolBoolEntry.value": + if e.complexity.MapsBoolBoolEntry.Value == nil { + break + } + + return e.complexity.MapsBoolBoolEntry.Value(childComplexity), true + + case "Maps_Fixed32Fixed32Entry.key": + if e.complexity.MapsFixed32Fixed32Entry.Key == nil { + break + } + + return e.complexity.MapsFixed32Fixed32Entry.Key(childComplexity), true + + case "Maps_Fixed32Fixed32Entry.value": + if e.complexity.MapsFixed32Fixed32Entry.Value == nil { + break + } + + return e.complexity.MapsFixed32Fixed32Entry.Value(childComplexity), true + + case "Maps_Fixed64Fixed64Entry.key": + if e.complexity.MapsFixed64Fixed64Entry.Key == nil { + break + } + + return e.complexity.MapsFixed64Fixed64Entry.Key(childComplexity), true + + case "Maps_Fixed64Fixed64Entry.value": + if e.complexity.MapsFixed64Fixed64Entry.Value == nil { + break + } + + return e.complexity.MapsFixed64Fixed64Entry.Value(childComplexity), true + + case "Maps_Int32Int32Entry.key": + if e.complexity.MapsInt32Int32Entry.Key == nil { + break + } + + return e.complexity.MapsInt32Int32Entry.Key(childComplexity), true + + case "Maps_Int32Int32Entry.value": + if e.complexity.MapsInt32Int32Entry.Value == nil { + break + } + + return e.complexity.MapsInt32Int32Entry.Value(childComplexity), true + + case "Maps_Int64Int64Entry.key": + if e.complexity.MapsInt64Int64Entry.Key == nil { + break + } + + return e.complexity.MapsInt64Int64Entry.Key(childComplexity), true + + case "Maps_Int64Int64Entry.value": + if e.complexity.MapsInt64Int64Entry.Value == nil { + break + } + + return e.complexity.MapsInt64Int64Entry.Value(childComplexity), true + + case "Maps_Sfixed32Sfixed32Entry.key": + if e.complexity.MapsSfixed32Sfixed32Entry.Key == nil { + break + } + + return e.complexity.MapsSfixed32Sfixed32Entry.Key(childComplexity), true + + case "Maps_Sfixed32Sfixed32Entry.value": + if e.complexity.MapsSfixed32Sfixed32Entry.Value == nil { + break + } + + return e.complexity.MapsSfixed32Sfixed32Entry.Value(childComplexity), true + + case "Maps_Sfixed64Sfixed64Entry.key": + if e.complexity.MapsSfixed64Sfixed64Entry.Key == nil { + break + } + + return e.complexity.MapsSfixed64Sfixed64Entry.Key(childComplexity), true + + case "Maps_Sfixed64Sfixed64Entry.value": + if e.complexity.MapsSfixed64Sfixed64Entry.Value == nil { + break + } + + return e.complexity.MapsSfixed64Sfixed64Entry.Value(childComplexity), true + + case "Maps_Sint32Sint32Entry.key": + if e.complexity.MapsSint32Sint32Entry.Key == nil { + break + } + + return e.complexity.MapsSint32Sint32Entry.Key(childComplexity), true + + case "Maps_Sint32Sint32Entry.value": + if e.complexity.MapsSint32Sint32Entry.Value == nil { + break + } + + return e.complexity.MapsSint32Sint32Entry.Value(childComplexity), true + + case "Maps_Sint64Sint64Entry.key": + if e.complexity.MapsSint64Sint64Entry.Key == nil { + break + } + + return e.complexity.MapsSint64Sint64Entry.Key(childComplexity), true + + case "Maps_Sint64Sint64Entry.value": + if e.complexity.MapsSint64Sint64Entry.Value == nil { + break + } + + return e.complexity.MapsSint64Sint64Entry.Value(childComplexity), true + + case "Maps_StringBarEntry.key": + if e.complexity.MapsStringBarEntry.Key == nil { + break + } + + return e.complexity.MapsStringBarEntry.Key(childComplexity), true + + case "Maps_StringBarEntry.value": + if e.complexity.MapsStringBarEntry.Value == nil { + break + } + + return e.complexity.MapsStringBarEntry.Value(childComplexity), true + + case "Maps_StringBytesEntry.key": + if e.complexity.MapsStringBytesEntry.Key == nil { + break + } + + return e.complexity.MapsStringBytesEntry.Key(childComplexity), true + + case "Maps_StringBytesEntry.value": + if e.complexity.MapsStringBytesEntry.Value == nil { + break + } + + return e.complexity.MapsStringBytesEntry.Value(childComplexity), true + + case "Maps_StringDoubleEntry.key": + if e.complexity.MapsStringDoubleEntry.Key == nil { + break + } + + return e.complexity.MapsStringDoubleEntry.Key(childComplexity), true + + case "Maps_StringDoubleEntry.value": + if e.complexity.MapsStringDoubleEntry.Value == nil { + break + } + + return e.complexity.MapsStringDoubleEntry.Value(childComplexity), true + + case "Maps_StringFloatEntry.key": + if e.complexity.MapsStringFloatEntry.Key == nil { + break + } + + return e.complexity.MapsStringFloatEntry.Key(childComplexity), true + + case "Maps_StringFloatEntry.value": + if e.complexity.MapsStringFloatEntry.Value == nil { + break + } + + return e.complexity.MapsStringFloatEntry.Value(childComplexity), true + + case "Maps_StringFooEntry.key": + if e.complexity.MapsStringFooEntry.Key == nil { + break + } + + return e.complexity.MapsStringFooEntry.Key(childComplexity), true + + case "Maps_StringFooEntry.value": + if e.complexity.MapsStringFooEntry.Value == nil { + break + } + + return e.complexity.MapsStringFooEntry.Value(childComplexity), true + + case "Maps_StringStringEntry.key": + if e.complexity.MapsStringStringEntry.Key == nil { + break + } + + return e.complexity.MapsStringStringEntry.Key(childComplexity), true + + case "Maps_StringStringEntry.value": + if e.complexity.MapsStringStringEntry.Value == nil { + break + } + + return e.complexity.MapsStringStringEntry.Value(childComplexity), true + + case "Maps_Uint32Uint32Entry.key": + if e.complexity.MapsUint32Uint32Entry.Key == nil { + break + } + + return e.complexity.MapsUint32Uint32Entry.Key(childComplexity), true + + case "Maps_Uint32Uint32Entry.value": + if e.complexity.MapsUint32Uint32Entry.Value == nil { + break + } + + return e.complexity.MapsUint32Uint32Entry.Value(childComplexity), true + + case "Maps_Uint64Uint64Entry.key": + if e.complexity.MapsUint64Uint64Entry.Key == nil { + break + } + + return e.complexity.MapsUint64Uint64Entry.Key(childComplexity), true + + case "Maps_Uint64Uint64Entry.value": + if e.complexity.MapsUint64Uint64Entry.Value == nil { + break + } + + return e.complexity.MapsUint64Uint64Entry.Value(childComplexity), true + + case "Mutation.constructsAny_": + if e.complexity.Mutation.ConstructsAny == nil { + break + } + + args, err := ec.field_Mutation_constructsAny__args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ConstructsAny(childComplexity, args["in"].(*anypb.Any)), true + + case "Mutation.constructsCallWithId": + if e.complexity.Mutation.ConstructsCallWithID == nil { + break + } + + return e.complexity.Mutation.ConstructsCallWithID(childComplexity), true + + case "Mutation.constructsEmpty_": + if e.complexity.Mutation.ConstructsEmpty == nil { + break + } + + return e.complexity.Mutation.ConstructsEmpty(childComplexity), true + + case "Mutation.constructsEmpty2_": + if e.complexity.Mutation.ConstructsEmpty2 == nil { + break + } + + return e.complexity.Mutation.ConstructsEmpty2(childComplexity), true + + case "Mutation.constructsEmpty3_": + if e.complexity.Mutation.ConstructsEmpty3 == nil { + break + } + + return e.complexity.Mutation.ConstructsEmpty3(childComplexity), true + + case "Mutation.constructsMaps_": + if e.complexity.Mutation.ConstructsMaps == nil { + break + } + + args, err := ec.field_Mutation_constructsMaps__args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ConstructsMaps(childComplexity, args["in"].(*pb.Maps)), true + + case "Mutation.constructsOneof_": + if e.complexity.Mutation.ConstructsOneof == nil { + break + } + + args, err := ec.field_Mutation_constructsOneof__args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ConstructsOneof(childComplexity, args["in"].(*pb.Oneof)), true + + case "Mutation.constructsRef_": + if e.complexity.Mutation.ConstructsRef == nil { + break + } + + args, err := ec.field_Mutation_constructsRef__args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ConstructsRef(childComplexity, args["in"].(*pb.Ref)), true + + case "Mutation.constructsRepeated_": + if e.complexity.Mutation.ConstructsRepeated == nil { + break + } + + args, err := ec.field_Mutation_constructsRepeated__args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ConstructsRepeated(childComplexity, args["in"].(*pb.Repeated)), true + + case "Mutation.constructsScalars_": + if e.complexity.Mutation.ConstructsScalars == nil { + break + } + + args, err := ec.field_Mutation_constructsScalars__args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ConstructsScalars(childComplexity, args["in"].(*pb.Scalars)), true + + case "Oneof.oneof1": + if e.complexity.Oneof.Oneof1 == nil { + break + } + + return e.complexity.Oneof.Oneof1(childComplexity), true + + case "Oneof.oneof2": + if e.complexity.Oneof.Oneof2 == nil { + break + } + + return e.complexity.Oneof.Oneof2(childComplexity), true + + case "Oneof.oneof3": + if e.complexity.Oneof.Oneof3 == nil { + break + } + + return e.complexity.Oneof.Oneof3(childComplexity), true + + case "Oneof.param1": + if e.complexity.Oneof.Param1 == nil { + break + } + + return e.complexity.Oneof.Param1(childComplexity), true + + case "Oneof_Param2.param2": + if e.complexity.OneofParam2.Param2 == nil { + break + } + + return e.complexity.OneofParam2.Param2(childComplexity), true + + case "Oneof_Param3.param3": + if e.complexity.OneofParam3.Param3 == nil { + break + } + + return e.complexity.OneofParam3.Param3(childComplexity), true + + case "Oneof_Param4.param4": + if e.complexity.OneofParam4.Param4 == nil { + break + } + + return e.complexity.OneofParam4.Param4(childComplexity), true + + case "Oneof_Param5.param5": + if e.complexity.OneofParam5.Param5 == nil { + break + } + + return e.complexity.OneofParam5.Param5(childComplexity), true + + case "Oneof_Param6.param6": + if e.complexity.OneofParam6.Param6 == nil { + break + } + + return e.complexity.OneofParam6.Param6(childComplexity), true + + case "Pb_Any.param1": + if e.complexity.PbAny.Param1 == nil { + break + } + + return e.complexity.PbAny.Param1(childComplexity), true + + case "Query.dummy": + if e.complexity.Query.Dummy == nil { + break + } + + return e.complexity.Query.Dummy(childComplexity), true + + case "Ref.en1": + if e.complexity.Ref.En1 == nil { + break + } + + return e.complexity.Ref.En1(childComplexity), true + + case "Ref.en2": + if e.complexity.Ref.En2 == nil { + break + } + + return e.complexity.Ref.En2(childComplexity), true + + case "Ref.external": + if e.complexity.Ref.External == nil { + break + } + + return e.complexity.Ref.External(childComplexity), true + + case "Ref.file": + if e.complexity.Ref.File == nil { + break + } + + return e.complexity.Ref.File(childComplexity), true + + case "Ref.fileEnum": + if e.complexity.Ref.FileEnum == nil { + break + } + + return e.complexity.Ref.FileEnum(childComplexity), true + + case "Ref.fileMsg": + if e.complexity.Ref.FileMsg == nil { + break + } + + return e.complexity.Ref.FileMsg(childComplexity), true + + case "Ref.foreign": + if e.complexity.Ref.Foreign == nil { + break + } + + return e.complexity.Ref.Foreign(childComplexity), true + + case "Ref.gz": + if e.complexity.Ref.Gz == nil { + break + } + + return e.complexity.Ref.Gz(childComplexity), true + + case "Ref.local": + if e.complexity.Ref.Local == nil { + break + } + + return e.complexity.Ref.Local(childComplexity), true + + case "Ref.localTime": + if e.complexity.Ref.LocalTime == nil { + break + } + + return e.complexity.Ref.LocalTime(childComplexity), true + + case "Ref.localTime2": + if e.complexity.Ref.LocalTime2 == nil { + break + } + + return e.complexity.Ref.LocalTime2(childComplexity), true + + case "Ref_Bar.param1": + if e.complexity.RefBar.Param1 == nil { + break + } + + return e.complexity.RefBar.Param1(childComplexity), true + + case "Ref_Foo.bar1": + if e.complexity.RefFoo.Bar1 == nil { + break + } + + return e.complexity.RefFoo.Bar1(childComplexity), true + + case "Ref_Foo.bar2": + if e.complexity.RefFoo.Bar2 == nil { + break + } + + return e.complexity.RefFoo.Bar2(childComplexity), true + + case "Ref_Foo.en1": + if e.complexity.RefFoo.En1 == nil { + break + } + + return e.complexity.RefFoo.En1(childComplexity), true + + case "Ref_Foo.en2": + if e.complexity.RefFoo.En2 == nil { + break + } + + return e.complexity.RefFoo.En2(childComplexity), true + + case "Ref_Foo.externalTime1": + if e.complexity.RefFoo.ExternalTime1 == nil { + break + } + + return e.complexity.RefFoo.ExternalTime1(childComplexity), true + + case "Ref_Foo.localTime2": + if e.complexity.RefFoo.LocalTime2 == nil { + break + } + + return e.complexity.RefFoo.LocalTime2(childComplexity), true + + case "Ref_Foo_Bar.param1": + if e.complexity.RefFooBar.Param1 == nil { + break + } + + return e.complexity.RefFooBar.Param1(childComplexity), true + + case "Ref_Foo_Baz_Gz.param1": + if e.complexity.RefFooBazGz.Param1 == nil { + break + } + + return e.complexity.RefFooBazGz.Param1(childComplexity), true + + case "Repeated.bar": + if e.complexity.Repeated.Bar == nil { + break + } + + return e.complexity.Repeated.Bar(childComplexity), true + + case "Repeated.bool": + if e.complexity.Repeated.Bool == nil { + break + } + + return e.complexity.Repeated.Bool(childComplexity), true + + case "Repeated.bytes": + if e.complexity.Repeated.Bytes == nil { + break + } + + return e.complexity.Repeated.Bytes(childComplexity), true + + case "Repeated.double": + if e.complexity.Repeated.Double == nil { + break + } + + return e.complexity.Repeated.Double(childComplexity), true + + case "Repeated.fixed32": + if e.complexity.Repeated.Fixed32 == nil { + break + } + + return e.complexity.Repeated.Fixed32(childComplexity), true + + case "Repeated.fixed64": + if e.complexity.Repeated.Fixed64 == nil { + break + } + + return e.complexity.Repeated.Fixed64(childComplexity), true + + case "Repeated.float": + if e.complexity.Repeated.Float == nil { + break + } + + return e.complexity.Repeated.Float(childComplexity), true + + case "Repeated.foo": + if e.complexity.Repeated.Foo == nil { + break + } + + return e.complexity.Repeated.Foo(childComplexity), true + + case "Repeated.int32": + if e.complexity.Repeated.Int32 == nil { + break + } + + return e.complexity.Repeated.Int32(childComplexity), true + + case "Repeated.int64": + if e.complexity.Repeated.Int64 == nil { + break + } + + return e.complexity.Repeated.Int64(childComplexity), true + + case "Repeated.sfixed32": + if e.complexity.Repeated.Sfixed32 == nil { + break + } + + return e.complexity.Repeated.Sfixed32(childComplexity), true + + case "Repeated.sfixed64": + if e.complexity.Repeated.Sfixed64 == nil { + break + } + + return e.complexity.Repeated.Sfixed64(childComplexity), true + + case "Repeated.sint32": + if e.complexity.Repeated.Sint32 == nil { + break + } + + return e.complexity.Repeated.Sint32(childComplexity), true + + case "Repeated.sint64": + if e.complexity.Repeated.Sint64 == nil { + break + } + + return e.complexity.Repeated.Sint64(childComplexity), true + + case "Repeated.stringX": + if e.complexity.Repeated.StringX == nil { + break + } + + return e.complexity.Repeated.StringX(childComplexity), true + + case "Repeated.uint32": + if e.complexity.Repeated.Uint32 == nil { + break + } + + return e.complexity.Repeated.Uint32(childComplexity), true + + case "Repeated.uint64": + if e.complexity.Repeated.Uint64 == nil { + break + } + + return e.complexity.Repeated.Uint64(childComplexity), true + + case "Scalars.bool": + if e.complexity.Scalars.Bool == nil { + break + } + + return e.complexity.Scalars.Bool(childComplexity), true + + case "Scalars.bytes": + if e.complexity.Scalars.Bytes == nil { + break + } + + return e.complexity.Scalars.Bytes(childComplexity), true + + case "Scalars.double": + if e.complexity.Scalars.Double == nil { + break + } + + return e.complexity.Scalars.Double(childComplexity), true + + case "Scalars.fixed32": + if e.complexity.Scalars.Fixed32 == nil { + break + } + + return e.complexity.Scalars.Fixed32(childComplexity), true + + case "Scalars.fixed64": + if e.complexity.Scalars.Fixed64 == nil { + break + } + + return e.complexity.Scalars.Fixed64(childComplexity), true + + case "Scalars.float": + if e.complexity.Scalars.Float == nil { + break + } + + return e.complexity.Scalars.Float(childComplexity), true + + case "Scalars.int32": + if e.complexity.Scalars.Int32 == nil { + break + } + + return e.complexity.Scalars.Int32(childComplexity), true + + case "Scalars.int64": + if e.complexity.Scalars.Int64 == nil { + break + } + + return e.complexity.Scalars.Int64(childComplexity), true + + case "Scalars.sfixed32": + if e.complexity.Scalars.Sfixed32 == nil { + break + } + + return e.complexity.Scalars.Sfixed32(childComplexity), true + + case "Scalars.sfixed64": + if e.complexity.Scalars.Sfixed64 == nil { + break + } + + return e.complexity.Scalars.Sfixed64(childComplexity), true + + case "Scalars.sint32": + if e.complexity.Scalars.Sint32 == nil { + break + } + + return e.complexity.Scalars.Sint32(childComplexity), true + + case "Scalars.sint64": + if e.complexity.Scalars.Sint64 == nil { + break + } + + return e.complexity.Scalars.Sint64(childComplexity), true + + case "Scalars.stringX": + if e.complexity.Scalars.StringX == nil { + break + } + + return e.complexity.Scalars.StringX(childComplexity), true + + case "Scalars.uint32": + if e.complexity.Scalars.Uint32 == nil { + break + } + + return e.complexity.Scalars.Uint32(childComplexity), true + + case "Scalars.uint64": + if e.complexity.Scalars.Uint64 == nil { + break + } + + return e.complexity.Scalars.Uint64(childComplexity), true + + case "Timestamp.time": + if e.complexity.Timestamp.Time == nil { + break + } + + return e.complexity.Timestamp.Time(childComplexity), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + rc := graphql.GetOperationContext(ctx) + ec := executionContext{rc, e} + first := true + + switch rc.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + data := ec._Query(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + case ast.Mutation: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + data := ec._Mutation(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(parsedSchema), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "pb/constructs.graphqls", Input: `directive @Constructs on FIELD_DEFINITION +directive @Oneof_Oneof1 on INPUT_FIELD_DEFINITION +directive @Oneof_Oneof2 on INPUT_FIELD_DEFINITION +directive @Oneof_Oneof3 on INPUT_FIELD_DEFINITION +""" +Any is any json type +""" +scalar Any +enum Bar { + BAR1 + BAR2 + BAR3 +} +type Baz { + param1: String +} +input BazInput { + param1: String +} +scalar Bytes +type Foo { + param1: String + param2: String +} +input FooInput { + param1: String + param2: String +} +type Foo_Foo2 { + param1: String +} +input Foo_Foo2Input { + param1: String +} +""" + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at + nanosecond resolution. The count is relative to an epoch at UTC midnight on + January 1, 1970, in the proleptic Gregorian calendar which extends the + Gregorian calendar backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a [24-hour linear + smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from [RFC + 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX ` + "`" + `time()` + "`" + `. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX ` + "`" + `gettimeofday()` + "`" + `. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 ` + "`" + `GetSystemTimeAsFileTime()` + "`" + `. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java ` + "`" + `System.currentTimeMillis()` + "`" + `. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + + Example 5: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + where {year} is always expressed using four digits while {month}, {day}, + {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + is required. A proto3 JSON serializer should always use UTC (as indicated by + "Z") when printing the Timestamp type and a proto3 JSON parser should be + able to accept both UTC and other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + 01:30 UTC on January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the + standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard ` + "`" + `datetime.datetime` + "`" + ` object can be converted + to this format using + [` + "`" + `strftime` + "`" + `](https://docs.python.org/2/library/time.html#time.strftime) with + the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + the Joda Time's [` + "`" + `ISODateTimeFormat.dateTime()` + "`" + `]( + http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + ) to obtain a formatter capable of generating timestamps in this format. + + + +""" +type GoogleProtobuf_Timestamp { + """ + Represents seconds of UTC time since Unix epoch + 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + 9999-12-31T23:59:59Z inclusive. + + """ + seconds: Int + """ + Non-negative fractions of a second at nanosecond resolution. Negative + second values with fractions must still have non-negative nanos values + that count forward in time. Must be from 0 to 999,999,999 + inclusive. + + """ + nanos: Int +} +""" + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at + nanosecond resolution. The count is relative to an epoch at UTC midnight on + January 1, 1970, in the proleptic Gregorian calendar which extends the + Gregorian calendar backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a [24-hour linear + smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from [RFC + 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX ` + "`" + `time()` + "`" + `. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX ` + "`" + `gettimeofday()` + "`" + `. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 ` + "`" + `GetSystemTimeAsFileTime()` + "`" + `. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java ` + "`" + `System.currentTimeMillis()` + "`" + `. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + + Example 5: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + where {year} is always expressed using four digits while {month}, {day}, + {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + is required. A proto3 JSON serializer should always use UTC (as indicated by + "Z") when printing the Timestamp type and a proto3 JSON parser should be + able to accept both UTC and other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + 01:30 UTC on January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the + standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard ` + "`" + `datetime.datetime` + "`" + ` object can be converted + to this format using + [` + "`" + `strftime` + "`" + `](https://docs.python.org/2/library/time.html#time.strftime) with + the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + the Joda Time's [` + "`" + `ISODateTimeFormat.dateTime()` + "`" + `]( + http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + ) to obtain a formatter capable of generating timestamps in this format. + + + +""" +input GoogleProtobuf_TimestampInput { + """ + Represents seconds of UTC time since Unix epoch + 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + 9999-12-31T23:59:59Z inclusive. + + """ + seconds: Int + """ + Non-negative fractions of a second at nanosecond resolution. Negative + second values with fractions must still have non-negative nanos values + that count forward in time. Must be from 0 to 999,999,999 + inclusive. + + """ + nanos: Int +} +type Maps { + int32Int32: [Maps_Int32Int32Entry!] + int64Int64: [Maps_Int64Int64Entry!] + uint32Uint32: [Maps_Uint32Uint32Entry!] + uint64Uint64: [Maps_Uint64Uint64Entry!] + sint32Sint32: [Maps_Sint32Sint32Entry!] + sint64Sint64: [Maps_Sint64Sint64Entry!] + fixed32Fixed32: [Maps_Fixed32Fixed32Entry!] + fixed64Fixed64: [Maps_Fixed64Fixed64Entry!] + sfixed32Sfixed32: [Maps_Sfixed32Sfixed32Entry!] + sfixed64Sfixed64: [Maps_Sfixed64Sfixed64Entry!] + boolBool: [Maps_BoolBoolEntry!] + stringString: [Maps_StringStringEntry!] + stringBytes: [Maps_StringBytesEntry!] + stringFloat: [Maps_StringFloatEntry!] + stringDouble: [Maps_StringDoubleEntry!] + stringFoo: [Maps_StringFooEntry!] + stringBar: [Maps_StringBarEntry!] +} +input MapsInput { + int32Int32: [Maps_Int32Int32EntryInput!] + int64Int64: [Maps_Int64Int64EntryInput!] + uint32Uint32: [Maps_Uint32Uint32EntryInput!] + uint64Uint64: [Maps_Uint64Uint64EntryInput!] + sint32Sint32: [Maps_Sint32Sint32EntryInput!] + sint64Sint64: [Maps_Sint64Sint64EntryInput!] + fixed32Fixed32: [Maps_Fixed32Fixed32EntryInput!] + fixed64Fixed64: [Maps_Fixed64Fixed64EntryInput!] + sfixed32Sfixed32: [Maps_Sfixed32Sfixed32EntryInput!] + sfixed64Sfixed64: [Maps_Sfixed64Sfixed64EntryInput!] + boolBool: [Maps_BoolBoolEntryInput!] + stringString: [Maps_StringStringEntryInput!] + stringBytes: [Maps_StringBytesEntryInput!] + stringFloat: [Maps_StringFloatEntryInput!] + stringDouble: [Maps_StringDoubleEntryInput!] + stringFoo: [Maps_StringFooEntryInput!] + stringBar: [Maps_StringBarEntryInput!] +} +type Maps_BoolBoolEntry { + key: Boolean + value: Boolean +} +input Maps_BoolBoolEntryInput { + key: Boolean + value: Boolean +} +type Maps_Fixed32Fixed32Entry { + key: Int + value: Int +} +input Maps_Fixed32Fixed32EntryInput { + key: Int + value: Int +} +type Maps_Fixed64Fixed64Entry { + key: Int + value: Int +} +input Maps_Fixed64Fixed64EntryInput { + key: Int + value: Int +} +type Maps_Int32Int32Entry { + key: Int + value: Int +} +input Maps_Int32Int32EntryInput { + key: Int + value: Int +} +type Maps_Int64Int64Entry { + key: Int + value: Int +} +input Maps_Int64Int64EntryInput { + key: Int + value: Int +} +type Maps_Sfixed32Sfixed32Entry { + key: Int + value: Int +} +input Maps_Sfixed32Sfixed32EntryInput { + key: Int + value: Int +} +type Maps_Sfixed64Sfixed64Entry { + key: Int + value: Int +} +input Maps_Sfixed64Sfixed64EntryInput { + key: Int + value: Int +} +type Maps_Sint32Sint32Entry { + key: Int + value: Int +} +input Maps_Sint32Sint32EntryInput { + key: Int + value: Int +} +type Maps_Sint64Sint64Entry { + key: Int + value: Int +} +input Maps_Sint64Sint64EntryInput { + key: Int + value: Int +} +type Maps_StringBarEntry { + key: String + value: Bar +} +input Maps_StringBarEntryInput { + key: String + value: Bar +} +type Maps_StringBytesEntry { + key: String + value: Bytes +} +input Maps_StringBytesEntryInput { + key: String + value: Bytes +} +type Maps_StringDoubleEntry { + key: String + value: Float +} +input Maps_StringDoubleEntryInput { + key: String + value: Float +} +type Maps_StringFloatEntry { + key: String + value: Float +} +input Maps_StringFloatEntryInput { + key: String + value: Float +} +type Maps_StringFooEntry { + key: String + value: Foo +} +input Maps_StringFooEntryInput { + key: String + value: FooInput +} +type Maps_StringStringEntry { + key: String + value: String +} +input Maps_StringStringEntryInput { + key: String + value: String +} +type Maps_Uint32Uint32Entry { + key: Int + value: Int +} +input Maps_Uint32Uint32EntryInput { + key: Int + value: Int +} +type Maps_Uint64Uint64Entry { + key: Int + value: Int +} +input Maps_Uint64Uint64EntryInput { + key: Int + value: Int +} +type Mutation { + """ + all possible scalars and same message as input and output + + """ + constructsScalars_(in: ScalarsInput): Scalars @Constructs + """ + all scalars messages and enums as repeated + + """ + constructsRepeated_(in: RepeatedInput): Repeated @Constructs + """ + all possible maps and different messages as input and output + + """ + constructsMaps_(in: MapsInput): Maps @Constructs + """ + same name different types + + """ + constructsAny_(in: Any): Pb_Any @Constructs + """ + empty input and empty output + + """ + constructsEmpty_: Boolean @Constructs + """ + messages with all empty fields + + """ + constructsEmpty2_: Boolean @Constructs + """ + messages with all empty fields + + """ + constructsEmpty3_: Boolean @Constructs + constructsRef_(in: RefInput): Ref @Constructs + constructsOneof_(in: OneofInput): Oneof @Constructs + constructsCallWithId: Boolean @Constructs +} +type Oneof { + param1: String + oneof1: Oneof_Oneof1 + oneof2: Oneof_Oneof2 + oneof3: Oneof_Oneof3 +} +input OneofInput { + param1: String + param2: String @Oneof_Oneof1 + param3: String @Oneof_Oneof1 + param4: String @Oneof_Oneof2 + param5: String @Oneof_Oneof2 + param6: String @Oneof_Oneof3 +} +union Oneof_Oneof1 = Oneof_Param2 | Oneof_Param3 +union Oneof_Oneof2 = Oneof_Param4 | Oneof_Param5 +union Oneof_Oneof3 = Oneof_Param6 +type Oneof_Param2 { + param2: String +} +type Oneof_Param3 { + param3: String +} +type Oneof_Param4 { + param4: String +} +type Oneof_Param5 { + param5: String +} +type Oneof_Param6 { + param6: String +} +type Pb_Any { + param1: String +} +type Query { + dummy: Boolean +} +type Ref { + localTime2: Timestamp + external: GoogleProtobuf_Timestamp + localTime: Timestamp + file: Baz + fileMsg: Foo + fileEnum: Bar + local: Ref_Foo + foreign: Foo_Foo2 + en1: Ref_Foo_En + en2: Ref_Foo_Bar_En + gz: Ref_Foo_Baz_Gz +} +input RefInput { + localTime2: TimestampInput + external: GoogleProtobuf_TimestampInput + localTime: TimestampInput + file: BazInput + fileMsg: FooInput + fileEnum: Bar + local: Ref_FooInput + foreign: Foo_Foo2Input + en1: Ref_Foo_En + en2: Ref_Foo_Bar_En + gz: Ref_Foo_Baz_GzInput +} +type Ref_Bar { + param1: String +} +input Ref_BarInput { + param1: String +} +type Ref_Foo { + bar1: Ref_Foo_Bar + localTime2: Timestamp + externalTime1: GoogleProtobuf_Timestamp + bar2: Ref_Bar + en1: Ref_Foo_En + en2: Ref_Foo_Bar_En +} +input Ref_FooInput { + bar1: Ref_Foo_BarInput + localTime2: TimestampInput + externalTime1: GoogleProtobuf_TimestampInput + bar2: Ref_BarInput + en1: Ref_Foo_En + en2: Ref_Foo_Bar_En +} +type Ref_Foo_Bar { + param1: String +} +input Ref_Foo_BarInput { + param1: String +} +enum Ref_Foo_Bar_En { + A0 + A1 +} +type Ref_Foo_Baz_Gz { + param1: String +} +input Ref_Foo_Baz_GzInput { + param1: String +} +enum Ref_Foo_En { + A0 + A1 +} +type Repeated { + double: [Float!] + float: [Float!] + int32: [Int!] + int64: [Int!] + uint32: [Int!] + uint64: [Int!] + sint32: [Int!] + sint64: [Int!] + fixed32: [Int!] + fixed64: [Int!] + sfixed32: [Int!] + sfixed64: [Int!] + bool: [Boolean!] + stringX: [String!] + bytes: [Bytes!] + foo: [Foo!] + bar: [Bar!] +} +input RepeatedInput { + double: [Float!] + float: [Float!] + int32: [Int!] + int64: [Int!] + uint32: [Int!] + uint64: [Int!] + sint32: [Int!] + sint64: [Int!] + fixed32: [Int!] + fixed64: [Int!] + sfixed32: [Int!] + sfixed64: [Int!] + bool: [Boolean!] + stringX: [String!] + bytes: [Bytes!] + foo: [FooInput!] + bar: [Bar!] +} +type Scalars { + double: Float + float: Float + int32: Int + int64: Int + uint32: Int + uint64: Int + sint32: Int + sint64: Int + fixed32: Int + fixed64: Int + sfixed32: Int + sfixed64: Int + bool: Boolean + """ + x for collisions with go method String + + """ + stringX: String + bytes: Bytes +} +input ScalarsInput { + double: Float + float: Float + int32: Int + int64: Int + uint32: Int + uint64: Int + sint32: Int + sint64: Int + fixed32: Int + fixed64: Int + sfixed32: Int + sfixed64: Int + bool: Boolean + """ + x for collisions with go method String + + """ + stringX: String + bytes: Bytes +} +type Timestamp { + time: String +} +input TimestampInput { + time: String +} +`, BuiltIn: false}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Mutation_constructsAny__args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *anypb.Any + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalOAny2ᚖgoogleᚗgolangᚗorgᚋprotobufᚋtypesᚋknownᚋanypbᚐAny(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_constructsMaps__args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Maps + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalOMapsInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_constructsOneof__args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Oneof + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalOOneofInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_constructsRef__args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Ref + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalORefInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_constructsRepeated__args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Repeated + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalORepeatedInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRepeated(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_constructsScalars__args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Scalars + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalOScalarsInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐScalars(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Baz_param1(ctx context.Context, field graphql.CollectedField, obj *pb.Baz) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Baz", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Foo_param1(ctx context.Context, field graphql.CollectedField, obj *pb.Foo) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Foo", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Foo_param2(ctx context.Context, field graphql.CollectedField, obj *pb.Foo) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Foo", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Foo_Foo2_param1(ctx context.Context, field graphql.CollectedField, obj *pb.Foo_Foo2) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Foo_Foo2", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _GoogleProtobuf_Timestamp_seconds(ctx context.Context, field graphql.CollectedField, obj *timestamppb.Timestamp) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "GoogleProtobuf_Timestamp", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Seconds, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _GoogleProtobuf_Timestamp_nanos(ctx context.Context, field graphql.CollectedField, obj *timestamppb.Timestamp) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "GoogleProtobuf_Timestamp", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Nanos, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_int32Int32(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Int32Int32(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Int32Int32Entry) + fc.Result = res + return ec.marshalOMaps_Int32Int32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int32Int32Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_int64Int64(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Int64Int64(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Int64Int64Entry) + fc.Result = res + return ec.marshalOMaps_Int64Int64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int64Int64Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_uint32Uint32(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Uint32Uint32(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Uint32Uint32Entry) + fc.Result = res + return ec.marshalOMaps_Uint32Uint32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint32Uint32Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_uint64Uint64(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Uint64Uint64(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Uint64Uint64Entry) + fc.Result = res + return ec.marshalOMaps_Uint64Uint64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint64Uint64Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_sint32Sint32(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Sint32Sint32(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Sint32Sint32Entry) + fc.Result = res + return ec.marshalOMaps_Sint32Sint32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint32Sint32Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_sint64Sint64(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Sint64Sint64(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Sint64Sint64Entry) + fc.Result = res + return ec.marshalOMaps_Sint64Sint64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint64Sint64Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_fixed32Fixed32(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Fixed32Fixed32(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Fixed32Fixed32Entry) + fc.Result = res + return ec.marshalOMaps_Fixed32Fixed32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed32Fixed32Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_fixed64Fixed64(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Fixed64Fixed64(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Fixed64Fixed64Entry) + fc.Result = res + return ec.marshalOMaps_Fixed64Fixed64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed64Fixed64Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_sfixed32Sfixed32(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Sfixed32Sfixed32(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Sfixed32Sfixed32Entry) + fc.Result = res + return ec.marshalOMaps_Sfixed32Sfixed32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed32Sfixed32Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_sfixed64Sfixed64(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().Sfixed64Sfixed64(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_Sfixed64Sfixed64Entry) + fc.Result = res + return ec.marshalOMaps_Sfixed64Sfixed64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed64Sfixed64Entryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_boolBool(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().BoolBool(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_BoolBoolEntry) + fc.Result = res + return ec.marshalOMaps_BoolBoolEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_BoolBoolEntryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_stringString(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().StringString(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_StringStringEntry) + fc.Result = res + return ec.marshalOMaps_StringStringEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringStringEntryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_stringBytes(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().StringBytes(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_StringBytesEntry) + fc.Result = res + return ec.marshalOMaps_StringBytesEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBytesEntryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_stringFloat(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().StringFloat(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_StringFloatEntry) + fc.Result = res + return ec.marshalOMaps_StringFloatEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFloatEntryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_stringDouble(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().StringDouble(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_StringDoubleEntry) + fc.Result = res + return ec.marshalOMaps_StringDoubleEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringDoubleEntryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_stringFoo(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().StringFoo(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_StringFooEntry) + fc.Result = res + return ec.marshalOMaps_StringFooEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFooEntryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_stringBar(ctx context.Context, field graphql.CollectedField, obj *pb.Maps) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Maps().StringBar(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Maps_StringBarEntry) + fc.Result = res + return ec.marshalOMaps_StringBarEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBarEntryᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_BoolBoolEntry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_BoolBoolEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_BoolBoolEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_BoolBoolEntry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_BoolBoolEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_BoolBoolEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Fixed32Fixed32Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Fixed32Fixed32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Fixed32Fixed32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint32) + fc.Result = res + return ec.marshalOInt2uint32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Fixed32Fixed32Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Fixed32Fixed32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Fixed32Fixed32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint32) + fc.Result = res + return ec.marshalOInt2uint32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Fixed64Fixed64Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Fixed64Fixed64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Fixed64Fixed64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint64) + fc.Result = res + return ec.marshalOInt2uint64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Fixed64Fixed64Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Fixed64Fixed64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Fixed64Fixed64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint64) + fc.Result = res + return ec.marshalOInt2uint64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Int32Int32Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Int32Int32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Int32Int32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Int32Int32Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Int32Int32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Int32Int32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Int64Int64Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Int64Int64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Int64Int64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Int64Int64Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Int64Int64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Int64Int64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Sfixed32Sfixed32Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Sfixed32Sfixed32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Sfixed32Sfixed32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Sfixed32Sfixed32Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Sfixed32Sfixed32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Sfixed32Sfixed32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Sfixed64Sfixed64Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Sfixed64Sfixed64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Sfixed64Sfixed64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Sfixed64Sfixed64Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Sfixed64Sfixed64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Sfixed64Sfixed64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Sint32Sint32Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Sint32Sint32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Sint32Sint32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Sint32Sint32Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Sint32Sint32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Sint32Sint32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Sint64Sint64Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Sint64Sint64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Sint64Sint64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Sint64Sint64Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Sint64Sint64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Sint64Sint64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringBarEntry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringBarEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringBarEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringBarEntry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringBarEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringBarEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pb.Bar) + fc.Result = res + return ec.marshalOBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringBytesEntry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringBytesEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringBytesEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringBytesEntry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringBytesEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringBytesEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]byte) + fc.Result = res + return ec.marshalOBytes2ᚕbyte(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringDoubleEntry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringDoubleEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringDoubleEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringDoubleEntry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringDoubleEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringDoubleEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(float64) + fc.Result = res + return ec.marshalOFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringFloatEntry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringFloatEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringFloatEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringFloatEntry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringFloatEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringFloatEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(float32) + fc.Result = res + return ec.marshalOFloat2float32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringFooEntry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringFooEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringFooEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringFooEntry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringFooEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringFooEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Foo) + fc.Result = res + return ec.marshalOFoo2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringStringEntry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringStringEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringStringEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_StringStringEntry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_StringStringEntry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_StringStringEntry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Uint32Uint32Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Uint32Uint32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Uint32Uint32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint32) + fc.Result = res + return ec.marshalOInt2uint32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Uint32Uint32Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Uint32Uint32Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Uint32Uint32Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint32) + fc.Result = res + return ec.marshalOInt2uint32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Uint64Uint64Entry_key(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Uint64Uint64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Uint64Uint64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Key, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint64) + fc.Result = res + return ec.marshalOInt2uint64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Maps_Uint64Uint64Entry_value(ctx context.Context, field graphql.CollectedField, obj *pb.Maps_Uint64Uint64Entry) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Maps_Uint64Uint64Entry", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Value, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint64) + fc.Result = res + return ec.marshalOInt2uint64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsScalars_(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_constructsScalars__args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsScalars(rctx, args["in"].(*pb.Scalars)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Scalars); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Scalars`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Scalars) + fc.Result = res + return ec.marshalOScalars2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐScalars(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsRepeated_(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_constructsRepeated__args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsRepeated(rctx, args["in"].(*pb.Repeated)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Repeated); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Repeated`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Repeated) + fc.Result = res + return ec.marshalORepeated2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRepeated(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsMaps_(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_constructsMaps__args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsMaps(rctx, args["in"].(*pb.Maps)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Maps); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Maps`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Maps) + fc.Result = res + return ec.marshalOMaps2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsAny_(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_constructsAny__args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsAny(rctx, args["in"].(*anypb.Any)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Any); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Any`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Any) + fc.Result = res + return ec.marshalOPb_Any2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐAny(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsEmpty_(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsEmpty(rctx) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsEmpty2_(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsEmpty2(rctx) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsEmpty3_(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsEmpty3(rctx) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsRef_(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_constructsRef__args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsRef(rctx, args["in"].(*pb.Ref)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Ref); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Ref`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Ref) + fc.Result = res + return ec.marshalORef2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsOneof_(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_constructsOneof__args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsOneof(rctx, args["in"].(*pb.Oneof)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Oneof); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Oneof`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Oneof) + fc.Result = res + return ec.marshalOOneof2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_constructsCallWithId(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ConstructsCallWithID(rctx) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Constructs == nil { + return nil, errors.New("directive Constructs is not implemented") + } + return ec.directives.Constructs(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*bool); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *bool`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Oneof_param1(ctx context.Context, field graphql.CollectedField, obj *pb.Oneof) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Oneof", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Oneof_oneof1(ctx context.Context, field graphql.CollectedField, obj *pb.Oneof) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Oneof", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Oneof().Oneof1(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pb.Oneof_Oneof1) + fc.Result = res + return ec.marshalOOneof_Oneof12githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof_Oneof1(ctx, field.Selections, res) +} + +func (ec *executionContext) _Oneof_oneof2(ctx context.Context, field graphql.CollectedField, obj *pb.Oneof) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Oneof", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Oneof().Oneof2(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pb.Oneof_Oneof2) + fc.Result = res + return ec.marshalOOneof_Oneof22githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof_Oneof2(ctx, field.Selections, res) +} + +func (ec *executionContext) _Oneof_oneof3(ctx context.Context, field graphql.CollectedField, obj *pb.Oneof) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Oneof", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Oneof().Oneof3(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pb.Oneof_Oneof3) + fc.Result = res + return ec.marshalOOneof_Oneof32githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof_Oneof3(ctx, field.Selections, res) +} + +func (ec *executionContext) _Oneof_Param2_param2(ctx context.Context, field graphql.CollectedField, obj *pb.Oneof_Param2) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Oneof_Param2", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Oneof_Param3_param3(ctx context.Context, field graphql.CollectedField, obj *pb.Oneof_Param3) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Oneof_Param3", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param3, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Oneof_Param4_param4(ctx context.Context, field graphql.CollectedField, obj *pb.Oneof_Param4) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Oneof_Param4", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param4, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Oneof_Param5_param5(ctx context.Context, field graphql.CollectedField, obj *pb.Oneof_Param5) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Oneof_Param5", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param5, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Oneof_Param6_param6(ctx context.Context, field graphql.CollectedField, obj *pb.Oneof_Param6) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Oneof_Param6", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param6, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Pb_Any_param1(ctx context.Context, field graphql.CollectedField, obj *pb.Any) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Pb_Any", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query_dummy(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().Dummy(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*bool) + fc.Result = res + return ec.marshalOBoolean2ᚖbool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query___type_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_localTime2(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LocalTime2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Timestamp) + fc.Result = res + return ec.marshalOTimestamp2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐTimestamp(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_external(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.External, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*timestamppb.Timestamp) + fc.Result = res + return ec.marshalOGoogleProtobuf_Timestamp2ᚖgoogleᚗgolangᚗorgᚋprotobufᚋtypesᚋknownᚋtimestamppbᚐTimestamp(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_localTime(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LocalTime, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Timestamp) + fc.Result = res + return ec.marshalOTimestamp2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐTimestamp(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_file(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.File, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Baz) + fc.Result = res + return ec.marshalOBaz2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBaz(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_fileMsg(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FileMsg, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Foo) + fc.Result = res + return ec.marshalOFoo2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_fileEnum(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.FileEnum, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pb.Bar) + fc.Result = res + return ec.marshalOBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_local(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Local, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Ref_Foo) + fc.Result = res + return ec.marshalORef_Foo2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_foreign(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Foreign, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Foo_Foo2) + fc.Result = res + return ec.marshalOFoo_Foo22ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo_Foo2(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_en1(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.En1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pb.Ref_Foo_En) + fc.Result = res + return ec.marshalORef_Foo_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_En(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_en2(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.En2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pb.Ref_Foo_Bar_En) + fc.Result = res + return ec.marshalORef_Foo_Bar_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar_En(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_gz(ctx context.Context, field graphql.CollectedField, obj *pb.Ref) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Gz, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Ref_Foo_Baz_Gz) + fc.Result = res + return ec.marshalORef_Foo_Baz_Gz2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Baz_Gz(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_Bar_param1(ctx context.Context, field graphql.CollectedField, obj *pb.Ref_Bar) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref_Bar", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_Foo_bar1(ctx context.Context, field graphql.CollectedField, obj *pb.Ref_Foo) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref_Foo", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Bar1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Ref_Foo_Bar) + fc.Result = res + return ec.marshalORef_Foo_Bar2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_Foo_localTime2(ctx context.Context, field graphql.CollectedField, obj *pb.Ref_Foo) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref_Foo", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.LocalTime2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Timestamp) + fc.Result = res + return ec.marshalOTimestamp2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐTimestamp(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_Foo_externalTime1(ctx context.Context, field graphql.CollectedField, obj *pb.Ref_Foo) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref_Foo", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ExternalTime1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*timestamppb.Timestamp) + fc.Result = res + return ec.marshalOGoogleProtobuf_Timestamp2ᚖgoogleᚗgolangᚗorgᚋprotobufᚋtypesᚋknownᚋtimestamppbᚐTimestamp(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_Foo_bar2(ctx context.Context, field graphql.CollectedField, obj *pb.Ref_Foo) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref_Foo", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Bar2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Ref_Bar) + fc.Result = res + return ec.marshalORef_Bar2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Bar(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_Foo_en1(ctx context.Context, field graphql.CollectedField, obj *pb.Ref_Foo) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref_Foo", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.En1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pb.Ref_Foo_En) + fc.Result = res + return ec.marshalORef_Foo_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_En(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_Foo_en2(ctx context.Context, field graphql.CollectedField, obj *pb.Ref_Foo) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref_Foo", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.En2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(pb.Ref_Foo_Bar_En) + fc.Result = res + return ec.marshalORef_Foo_Bar_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar_En(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_Foo_Bar_param1(ctx context.Context, field graphql.CollectedField, obj *pb.Ref_Foo_Bar) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref_Foo_Bar", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Ref_Foo_Baz_Gz_param1(ctx context.Context, field graphql.CollectedField, obj *pb.Ref_Foo_Baz_Gz) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Ref_Foo_Baz_Gz", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_double(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Double, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]float64) + fc.Result = res + return ec.marshalOFloat2ᚕfloat64ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_float(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Float, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]float32) + fc.Result = res + return ec.marshalOFloat2ᚕfloat32ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_int32(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Int32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]int32) + fc.Result = res + return ec.marshalOInt2ᚕint32ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_int64(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Int64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]int64) + fc.Result = res + return ec.marshalOInt2ᚕint64ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_uint32(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Uint32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]uint32) + fc.Result = res + return ec.marshalOInt2ᚕuint32ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_uint64(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Uint64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]uint64) + fc.Result = res + return ec.marshalOInt2ᚕuint64ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_sint32(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sint32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]int32) + fc.Result = res + return ec.marshalOInt2ᚕint32ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_sint64(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sint64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]int64) + fc.Result = res + return ec.marshalOInt2ᚕint64ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_fixed32(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fixed32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]uint32) + fc.Result = res + return ec.marshalOInt2ᚕuint32ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_fixed64(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fixed64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]uint64) + fc.Result = res + return ec.marshalOInt2ᚕuint64ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_sfixed32(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sfixed32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]int32) + fc.Result = res + return ec.marshalOInt2ᚕint32ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_sfixed64(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sfixed64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]int64) + fc.Result = res + return ec.marshalOInt2ᚕint64ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_bool(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Bool, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]bool) + fc.Result = res + return ec.marshalOBoolean2ᚕboolᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_stringX(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StringX, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalOString2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_bytes(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Bytes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([][]byte) + fc.Result = res + return ec.marshalOBytes2ᚕᚕbyteᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_foo(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Foo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]*pb.Foo) + fc.Result = res + return ec.marshalOFoo2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFooᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Repeated_bar(ctx context.Context, field graphql.CollectedField, obj *pb.Repeated) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Repeated", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Bar, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]pb.Bar) + fc.Result = res + return ec.marshalOBar2ᚕgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBarᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_double(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Double, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(float64) + fc.Result = res + return ec.marshalOFloat2float64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_float(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Float, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(float32) + fc.Result = res + return ec.marshalOFloat2float32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_int32(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Int32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_int64(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Int64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_uint32(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Uint32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint32) + fc.Result = res + return ec.marshalOInt2uint32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_uint64(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Uint64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint64) + fc.Result = res + return ec.marshalOInt2uint64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_sint32(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sint32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_sint64(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sint64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_fixed32(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fixed32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint32) + fc.Result = res + return ec.marshalOInt2uint32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_fixed64(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fixed64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(uint64) + fc.Result = res + return ec.marshalOInt2uint64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_sfixed32(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sfixed32, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int32) + fc.Result = res + return ec.marshalOInt2int32(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_sfixed64(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Sfixed64, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalOInt2int64(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_bool(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Bool, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalOBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_stringX(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StringX, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Scalars_bytes(ctx context.Context, field graphql.CollectedField, obj *pb.Scalars) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Scalars", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Bytes, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]byte) + fc.Result = res + return ec.marshalOBytes2ᚕbyte(ctx, field.Selections, res) +} + +func (ec *executionContext) _Timestamp_time(ctx context.Context, field graphql.CollectedField, obj *pb.Timestamp) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Timestamp", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Time, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field___Type_fields_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field___Type_enumValues_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputBazInput(ctx context.Context, obj interface{}) (pb.Baz, error) { + var it pb.Baz + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "param1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param1")) + it.Param1, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFooInput(ctx context.Context, obj interface{}) (pb.Foo, error) { + var it pb.Foo + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "param1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param1")) + it.Param1, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "param2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param2")) + it.Param2, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFoo_Foo2Input(ctx context.Context, obj interface{}) (pb.Foo_Foo2, error) { + var it pb.Foo_Foo2 + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "param1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param1")) + it.Param1, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGoogleProtobuf_TimestampInput(ctx context.Context, obj interface{}) (timestamppb.Timestamp, error) { + var it timestamppb.Timestamp + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "seconds": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("seconds")) + it.Seconds, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + case "nanos": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("nanos")) + it.Nanos, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMapsInput(ctx context.Context, obj interface{}) (pb.Maps, error) { + var it pb.Maps + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "int32Int32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("int32Int32")) + data, err := ec.unmarshalOMaps_Int32Int32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int32Int32Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Int32Int32(ctx, &it, data); err != nil { + return it, err + } + case "int64Int64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("int64Int64")) + data, err := ec.unmarshalOMaps_Int64Int64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int64Int64Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Int64Int64(ctx, &it, data); err != nil { + return it, err + } + case "uint32Uint32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uint32Uint32")) + data, err := ec.unmarshalOMaps_Uint32Uint32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint32Uint32Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Uint32Uint32(ctx, &it, data); err != nil { + return it, err + } + case "uint64Uint64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uint64Uint64")) + data, err := ec.unmarshalOMaps_Uint64Uint64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint64Uint64Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Uint64Uint64(ctx, &it, data); err != nil { + return it, err + } + case "sint32Sint32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sint32Sint32")) + data, err := ec.unmarshalOMaps_Sint32Sint32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint32Sint32Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Sint32Sint32(ctx, &it, data); err != nil { + return it, err + } + case "sint64Sint64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sint64Sint64")) + data, err := ec.unmarshalOMaps_Sint64Sint64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint64Sint64Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Sint64Sint64(ctx, &it, data); err != nil { + return it, err + } + case "fixed32Fixed32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fixed32Fixed32")) + data, err := ec.unmarshalOMaps_Fixed32Fixed32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed32Fixed32Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Fixed32Fixed32(ctx, &it, data); err != nil { + return it, err + } + case "fixed64Fixed64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fixed64Fixed64")) + data, err := ec.unmarshalOMaps_Fixed64Fixed64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed64Fixed64Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Fixed64Fixed64(ctx, &it, data); err != nil { + return it, err + } + case "sfixed32Sfixed32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sfixed32Sfixed32")) + data, err := ec.unmarshalOMaps_Sfixed32Sfixed32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed32Sfixed32Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Sfixed32Sfixed32(ctx, &it, data); err != nil { + return it, err + } + case "sfixed64Sfixed64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sfixed64Sfixed64")) + data, err := ec.unmarshalOMaps_Sfixed64Sfixed64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed64Sfixed64Entryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().Sfixed64Sfixed64(ctx, &it, data); err != nil { + return it, err + } + case "boolBool": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("boolBool")) + data, err := ec.unmarshalOMaps_BoolBoolEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_BoolBoolEntryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().BoolBool(ctx, &it, data); err != nil { + return it, err + } + case "stringString": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringString")) + data, err := ec.unmarshalOMaps_StringStringEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringStringEntryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().StringString(ctx, &it, data); err != nil { + return it, err + } + case "stringBytes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringBytes")) + data, err := ec.unmarshalOMaps_StringBytesEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBytesEntryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().StringBytes(ctx, &it, data); err != nil { + return it, err + } + case "stringFloat": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringFloat")) + data, err := ec.unmarshalOMaps_StringFloatEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFloatEntryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().StringFloat(ctx, &it, data); err != nil { + return it, err + } + case "stringDouble": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringDouble")) + data, err := ec.unmarshalOMaps_StringDoubleEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringDoubleEntryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().StringDouble(ctx, &it, data); err != nil { + return it, err + } + case "stringFoo": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringFoo")) + data, err := ec.unmarshalOMaps_StringFooEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFooEntryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().StringFoo(ctx, &it, data); err != nil { + return it, err + } + case "stringBar": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringBar")) + data, err := ec.unmarshalOMaps_StringBarEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBarEntryᚄ(ctx, v) + if err != nil { + return it, err + } + if err = ec.resolvers.MapsInput().StringBar(ctx, &it, data); err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_BoolBoolEntryInput(ctx context.Context, obj interface{}) (pb.Maps_BoolBoolEntry, error) { + var it pb.Maps_BoolBoolEntry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Fixed32Fixed32EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Fixed32Fixed32Entry, error) { + var it pb.Maps_Fixed32Fixed32Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2uint32(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2uint32(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Fixed64Fixed64EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Fixed64Fixed64Entry, error) { + var it pb.Maps_Fixed64Fixed64Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2uint64(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2uint64(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Int32Int32EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Int32Int32Entry, error) { + var it pb.Maps_Int32Int32Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Int64Int64EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Int64Int64Entry, error) { + var it pb.Maps_Int64Int64Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Sfixed32Sfixed32EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Sfixed32Sfixed32Entry, error) { + var it pb.Maps_Sfixed32Sfixed32Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Sfixed64Sfixed64EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Sfixed64Sfixed64Entry, error) { + var it pb.Maps_Sfixed64Sfixed64Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Sint32Sint32EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Sint32Sint32Entry, error) { + var it pb.Maps_Sint32Sint32Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Sint64Sint64EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Sint64Sint64Entry, error) { + var it pb.Maps_Sint64Sint64Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_StringBarEntryInput(ctx context.Context, obj interface{}) (pb.Maps_StringBarEntry, error) { + var it pb.Maps_StringBarEntry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_StringBytesEntryInput(ctx context.Context, obj interface{}) (pb.Maps_StringBytesEntry, error) { + var it pb.Maps_StringBytesEntry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOBytes2ᚕbyte(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_StringDoubleEntryInput(ctx context.Context, obj interface{}) (pb.Maps_StringDoubleEntry, error) { + var it pb.Maps_StringDoubleEntry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOFloat2float64(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_StringFloatEntryInput(ctx context.Context, obj interface{}) (pb.Maps_StringFloatEntry, error) { + var it pb.Maps_StringFloatEntry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOFloat2float32(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_StringFooEntryInput(ctx context.Context, obj interface{}) (pb.Maps_StringFooEntry, error) { + var it pb.Maps_StringFooEntry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOFooInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_StringStringEntryInput(ctx context.Context, obj interface{}) (pb.Maps_StringStringEntry, error) { + var it pb.Maps_StringStringEntry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Uint32Uint32EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Uint32Uint32Entry, error) { + var it pb.Maps_Uint32Uint32Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2uint32(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2uint32(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputMaps_Uint64Uint64EntryInput(ctx context.Context, obj interface{}) (pb.Maps_Uint64Uint64Entry, error) { + var it pb.Maps_Uint64Uint64Entry + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "key": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("key")) + it.Key, err = ec.unmarshalOInt2uint64(ctx, v) + if err != nil { + return it, err + } + case "value": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("value")) + it.Value, err = ec.unmarshalOInt2uint64(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputOneofInput(ctx context.Context, obj interface{}) (pb.Oneof, error) { + var it pb.Oneof + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "param1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param1")) + it.Param1, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "param2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param2")) + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Oneof_Oneof1 == nil { + return nil, errors.New("directive Oneof_Oneof1 is not implemented") + } + return ec.directives.Oneof_Oneof1(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + if err = ec.resolvers.OneofInput().Param2(ctx, &it, data); err != nil { + return it, err + } + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "param3": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param3")) + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Oneof_Oneof1 == nil { + return nil, errors.New("directive Oneof_Oneof1 is not implemented") + } + return ec.directives.Oneof_Oneof1(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + if err = ec.resolvers.OneofInput().Param3(ctx, &it, data); err != nil { + return it, err + } + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "param4": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param4")) + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Oneof_Oneof2 == nil { + return nil, errors.New("directive Oneof_Oneof2 is not implemented") + } + return ec.directives.Oneof_Oneof2(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + if err = ec.resolvers.OneofInput().Param4(ctx, &it, data); err != nil { + return it, err + } + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "param5": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param5")) + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Oneof_Oneof2 == nil { + return nil, errors.New("directive Oneof_Oneof2 is not implemented") + } + return ec.directives.Oneof_Oneof2(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + if err = ec.resolvers.OneofInput().Param5(ctx, &it, data); err != nil { + return it, err + } + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + case "param6": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param6")) + directive0 := func(ctx context.Context) (interface{}, error) { return ec.unmarshalOString2ᚖstring(ctx, v) } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Oneof_Oneof3 == nil { + return nil, errors.New("directive Oneof_Oneof3 is not implemented") + } + return ec.directives.Oneof_Oneof3(ctx, obj, directive0) + } + + tmp, err := directive1(ctx) + if err != nil { + return it, graphql.ErrorOnPath(ctx, err) + } + if data, ok := tmp.(*string); ok { + if err = ec.resolvers.OneofInput().Param6(ctx, &it, data); err != nil { + return it, err + } + } else { + err := fmt.Errorf(`unexpected type %T from directive, should be *string`, tmp) + return it, graphql.ErrorOnPath(ctx, err) + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputRefInput(ctx context.Context, obj interface{}) (pb.Ref, error) { + var it pb.Ref + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "localTime2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("localTime2")) + it.LocalTime2, err = ec.unmarshalOTimestampInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐTimestamp(ctx, v) + if err != nil { + return it, err + } + case "external": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("external")) + it.External, err = ec.unmarshalOGoogleProtobuf_TimestampInput2ᚖgoogleᚗgolangᚗorgᚋprotobufᚋtypesᚋknownᚋtimestamppbᚐTimestamp(ctx, v) + if err != nil { + return it, err + } + case "localTime": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("localTime")) + it.LocalTime, err = ec.unmarshalOTimestampInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐTimestamp(ctx, v) + if err != nil { + return it, err + } + case "file": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("file")) + it.File, err = ec.unmarshalOBazInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBaz(ctx, v) + if err != nil { + return it, err + } + case "fileMsg": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileMsg")) + it.FileMsg, err = ec.unmarshalOFooInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx, v) + if err != nil { + return it, err + } + case "fileEnum": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fileEnum")) + it.FileEnum, err = ec.unmarshalOBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx, v) + if err != nil { + return it, err + } + case "local": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("local")) + it.Local, err = ec.unmarshalORef_FooInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo(ctx, v) + if err != nil { + return it, err + } + case "foreign": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("foreign")) + it.Foreign, err = ec.unmarshalOFoo_Foo2Input2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo_Foo2(ctx, v) + if err != nil { + return it, err + } + case "en1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("en1")) + it.En1, err = ec.unmarshalORef_Foo_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_En(ctx, v) + if err != nil { + return it, err + } + case "en2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("en2")) + it.En2, err = ec.unmarshalORef_Foo_Bar_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar_En(ctx, v) + if err != nil { + return it, err + } + case "gz": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("gz")) + it.Gz, err = ec.unmarshalORef_Foo_Baz_GzInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Baz_Gz(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputRef_BarInput(ctx context.Context, obj interface{}) (pb.Ref_Bar, error) { + var it pb.Ref_Bar + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "param1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param1")) + it.Param1, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputRef_FooInput(ctx context.Context, obj interface{}) (pb.Ref_Foo, error) { + var it pb.Ref_Foo + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "bar1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bar1")) + it.Bar1, err = ec.unmarshalORef_Foo_BarInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar(ctx, v) + if err != nil { + return it, err + } + case "localTime2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("localTime2")) + it.LocalTime2, err = ec.unmarshalOTimestampInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐTimestamp(ctx, v) + if err != nil { + return it, err + } + case "externalTime1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("externalTime1")) + it.ExternalTime1, err = ec.unmarshalOGoogleProtobuf_TimestampInput2ᚖgoogleᚗgolangᚗorgᚋprotobufᚋtypesᚋknownᚋtimestamppbᚐTimestamp(ctx, v) + if err != nil { + return it, err + } + case "bar2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bar2")) + it.Bar2, err = ec.unmarshalORef_BarInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Bar(ctx, v) + if err != nil { + return it, err + } + case "en1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("en1")) + it.En1, err = ec.unmarshalORef_Foo_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_En(ctx, v) + if err != nil { + return it, err + } + case "en2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("en2")) + it.En2, err = ec.unmarshalORef_Foo_Bar_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar_En(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputRef_Foo_BarInput(ctx context.Context, obj interface{}) (pb.Ref_Foo_Bar, error) { + var it pb.Ref_Foo_Bar + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "param1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param1")) + it.Param1, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputRef_Foo_Baz_GzInput(ctx context.Context, obj interface{}) (pb.Ref_Foo_Baz_Gz, error) { + var it pb.Ref_Foo_Baz_Gz + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "param1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param1")) + it.Param1, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputRepeatedInput(ctx context.Context, obj interface{}) (pb.Repeated, error) { + var it pb.Repeated + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "double": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("double")) + it.Double, err = ec.unmarshalOFloat2ᚕfloat64ᚄ(ctx, v) + if err != nil { + return it, err + } + case "float": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("float")) + it.Float, err = ec.unmarshalOFloat2ᚕfloat32ᚄ(ctx, v) + if err != nil { + return it, err + } + case "int32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("int32")) + it.Int32, err = ec.unmarshalOInt2ᚕint32ᚄ(ctx, v) + if err != nil { + return it, err + } + case "int64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("int64")) + it.Int64, err = ec.unmarshalOInt2ᚕint64ᚄ(ctx, v) + if err != nil { + return it, err + } + case "uint32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uint32")) + it.Uint32, err = ec.unmarshalOInt2ᚕuint32ᚄ(ctx, v) + if err != nil { + return it, err + } + case "uint64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uint64")) + it.Uint64, err = ec.unmarshalOInt2ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + case "sint32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sint32")) + it.Sint32, err = ec.unmarshalOInt2ᚕint32ᚄ(ctx, v) + if err != nil { + return it, err + } + case "sint64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sint64")) + it.Sint64, err = ec.unmarshalOInt2ᚕint64ᚄ(ctx, v) + if err != nil { + return it, err + } + case "fixed32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fixed32")) + it.Fixed32, err = ec.unmarshalOInt2ᚕuint32ᚄ(ctx, v) + if err != nil { + return it, err + } + case "fixed64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fixed64")) + it.Fixed64, err = ec.unmarshalOInt2ᚕuint64ᚄ(ctx, v) + if err != nil { + return it, err + } + case "sfixed32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sfixed32")) + it.Sfixed32, err = ec.unmarshalOInt2ᚕint32ᚄ(ctx, v) + if err != nil { + return it, err + } + case "sfixed64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sfixed64")) + it.Sfixed64, err = ec.unmarshalOInt2ᚕint64ᚄ(ctx, v) + if err != nil { + return it, err + } + case "bool": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bool")) + it.Bool, err = ec.unmarshalOBoolean2ᚕboolᚄ(ctx, v) + if err != nil { + return it, err + } + case "stringX": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringX")) + it.StringX, err = ec.unmarshalOString2ᚕstringᚄ(ctx, v) + if err != nil { + return it, err + } + case "bytes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bytes")) + it.Bytes, err = ec.unmarshalOBytes2ᚕᚕbyteᚄ(ctx, v) + if err != nil { + return it, err + } + case "foo": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("foo")) + it.Foo, err = ec.unmarshalOFooInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFooᚄ(ctx, v) + if err != nil { + return it, err + } + case "bar": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bar")) + it.Bar, err = ec.unmarshalOBar2ᚕgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBarᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputScalarsInput(ctx context.Context, obj interface{}) (pb.Scalars, error) { + var it pb.Scalars + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "double": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("double")) + it.Double, err = ec.unmarshalOFloat2float64(ctx, v) + if err != nil { + return it, err + } + case "float": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("float")) + it.Float, err = ec.unmarshalOFloat2float32(ctx, v) + if err != nil { + return it, err + } + case "int32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("int32")) + it.Int32, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + case "int64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("int64")) + it.Int64, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + case "uint32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uint32")) + it.Uint32, err = ec.unmarshalOInt2uint32(ctx, v) + if err != nil { + return it, err + } + case "uint64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uint64")) + it.Uint64, err = ec.unmarshalOInt2uint64(ctx, v) + if err != nil { + return it, err + } + case "sint32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sint32")) + it.Sint32, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + case "sint64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sint64")) + it.Sint64, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + case "fixed32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fixed32")) + it.Fixed32, err = ec.unmarshalOInt2uint32(ctx, v) + if err != nil { + return it, err + } + case "fixed64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("fixed64")) + it.Fixed64, err = ec.unmarshalOInt2uint64(ctx, v) + if err != nil { + return it, err + } + case "sfixed32": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sfixed32")) + it.Sfixed32, err = ec.unmarshalOInt2int32(ctx, v) + if err != nil { + return it, err + } + case "sfixed64": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("sfixed64")) + it.Sfixed64, err = ec.unmarshalOInt2int64(ctx, v) + if err != nil { + return it, err + } + case "bool": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bool")) + it.Bool, err = ec.unmarshalOBoolean2bool(ctx, v) + if err != nil { + return it, err + } + case "stringX": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringX")) + it.StringX, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "bytes": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("bytes")) + it.Bytes, err = ec.unmarshalOBytes2ᚕbyte(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputTimestampInput(ctx context.Context, obj interface{}) (pb.Timestamp, error) { + var it pb.Timestamp + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "time": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("time")) + it.Time, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +func (ec *executionContext) _Oneof_Oneof1(ctx context.Context, sel ast.SelectionSet, obj pb.Oneof_Oneof1) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case pb.Oneof_Param2: + return ec._Oneof_Param2(ctx, sel, &obj) + case *pb.Oneof_Param2: + if obj == nil { + return graphql.Null + } + return ec._Oneof_Param2(ctx, sel, obj) + case pb.Oneof_Param3: + return ec._Oneof_Param3(ctx, sel, &obj) + case *pb.Oneof_Param3: + if obj == nil { + return graphql.Null + } + return ec._Oneof_Param3(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +func (ec *executionContext) _Oneof_Oneof2(ctx context.Context, sel ast.SelectionSet, obj pb.Oneof_Oneof2) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case pb.Oneof_Param4: + return ec._Oneof_Param4(ctx, sel, &obj) + case *pb.Oneof_Param4: + if obj == nil { + return graphql.Null + } + return ec._Oneof_Param4(ctx, sel, obj) + case pb.Oneof_Param5: + return ec._Oneof_Param5(ctx, sel, &obj) + case *pb.Oneof_Param5: + if obj == nil { + return graphql.Null + } + return ec._Oneof_Param5(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +func (ec *executionContext) _Oneof_Oneof3(ctx context.Context, sel ast.SelectionSet, obj pb.Oneof_Oneof3) graphql.Marshaler { + switch obj := (obj).(type) { + case nil: + return graphql.Null + case pb.Oneof_Param6: + return ec._Oneof_Param6(ctx, sel, &obj) + case *pb.Oneof_Param6: + if obj == nil { + return graphql.Null + } + return ec._Oneof_Param6(ctx, sel, obj) + default: + panic(fmt.Errorf("unexpected type %T", obj)) + } +} + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var bazImplementors = []string{"Baz"} + +func (ec *executionContext) _Baz(ctx context.Context, sel ast.SelectionSet, obj *pb.Baz) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, bazImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Baz") + case "param1": + out.Values[i] = ec._Baz_param1(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var fooImplementors = []string{"Foo"} + +func (ec *executionContext) _Foo(ctx context.Context, sel ast.SelectionSet, obj *pb.Foo) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, fooImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Foo") + case "param1": + out.Values[i] = ec._Foo_param1(ctx, field, obj) + case "param2": + out.Values[i] = ec._Foo_param2(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var foo_Foo2Implementors = []string{"Foo_Foo2"} + +func (ec *executionContext) _Foo_Foo2(ctx context.Context, sel ast.SelectionSet, obj *pb.Foo_Foo2) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, foo_Foo2Implementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Foo_Foo2") + case "param1": + out.Values[i] = ec._Foo_Foo2_param1(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var googleProtobuf_TimestampImplementors = []string{"GoogleProtobuf_Timestamp"} + +func (ec *executionContext) _GoogleProtobuf_Timestamp(ctx context.Context, sel ast.SelectionSet, obj *timestamppb.Timestamp) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, googleProtobuf_TimestampImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("GoogleProtobuf_Timestamp") + case "seconds": + out.Values[i] = ec._GoogleProtobuf_Timestamp_seconds(ctx, field, obj) + case "nanos": + out.Values[i] = ec._GoogleProtobuf_Timestamp_nanos(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var mapsImplementors = []string{"Maps"} + +func (ec *executionContext) _Maps(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mapsImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps") + case "int32Int32": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_int32Int32(ctx, field, obj) + return res + }) + case "int64Int64": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_int64Int64(ctx, field, obj) + return res + }) + case "uint32Uint32": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_uint32Uint32(ctx, field, obj) + return res + }) + case "uint64Uint64": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_uint64Uint64(ctx, field, obj) + return res + }) + case "sint32Sint32": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_sint32Sint32(ctx, field, obj) + return res + }) + case "sint64Sint64": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_sint64Sint64(ctx, field, obj) + return res + }) + case "fixed32Fixed32": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_fixed32Fixed32(ctx, field, obj) + return res + }) + case "fixed64Fixed64": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_fixed64Fixed64(ctx, field, obj) + return res + }) + case "sfixed32Sfixed32": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_sfixed32Sfixed32(ctx, field, obj) + return res + }) + case "sfixed64Sfixed64": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_sfixed64Sfixed64(ctx, field, obj) + return res + }) + case "boolBool": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_boolBool(ctx, field, obj) + return res + }) + case "stringString": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_stringString(ctx, field, obj) + return res + }) + case "stringBytes": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_stringBytes(ctx, field, obj) + return res + }) + case "stringFloat": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_stringFloat(ctx, field, obj) + return res + }) + case "stringDouble": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_stringDouble(ctx, field, obj) + return res + }) + case "stringFoo": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_stringFoo(ctx, field, obj) + return res + }) + case "stringBar": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Maps_stringBar(ctx, field, obj) + return res + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_BoolBoolEntryImplementors = []string{"Maps_BoolBoolEntry"} + +func (ec *executionContext) _Maps_BoolBoolEntry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_BoolBoolEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_BoolBoolEntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_BoolBoolEntry") + case "key": + out.Values[i] = ec._Maps_BoolBoolEntry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_BoolBoolEntry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Fixed32Fixed32EntryImplementors = []string{"Maps_Fixed32Fixed32Entry"} + +func (ec *executionContext) _Maps_Fixed32Fixed32Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Fixed32Fixed32Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Fixed32Fixed32EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Fixed32Fixed32Entry") + case "key": + out.Values[i] = ec._Maps_Fixed32Fixed32Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Fixed32Fixed32Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Fixed64Fixed64EntryImplementors = []string{"Maps_Fixed64Fixed64Entry"} + +func (ec *executionContext) _Maps_Fixed64Fixed64Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Fixed64Fixed64Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Fixed64Fixed64EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Fixed64Fixed64Entry") + case "key": + out.Values[i] = ec._Maps_Fixed64Fixed64Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Fixed64Fixed64Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Int32Int32EntryImplementors = []string{"Maps_Int32Int32Entry"} + +func (ec *executionContext) _Maps_Int32Int32Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Int32Int32Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Int32Int32EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Int32Int32Entry") + case "key": + out.Values[i] = ec._Maps_Int32Int32Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Int32Int32Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Int64Int64EntryImplementors = []string{"Maps_Int64Int64Entry"} + +func (ec *executionContext) _Maps_Int64Int64Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Int64Int64Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Int64Int64EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Int64Int64Entry") + case "key": + out.Values[i] = ec._Maps_Int64Int64Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Int64Int64Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Sfixed32Sfixed32EntryImplementors = []string{"Maps_Sfixed32Sfixed32Entry"} + +func (ec *executionContext) _Maps_Sfixed32Sfixed32Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Sfixed32Sfixed32Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Sfixed32Sfixed32EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Sfixed32Sfixed32Entry") + case "key": + out.Values[i] = ec._Maps_Sfixed32Sfixed32Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Sfixed32Sfixed32Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Sfixed64Sfixed64EntryImplementors = []string{"Maps_Sfixed64Sfixed64Entry"} + +func (ec *executionContext) _Maps_Sfixed64Sfixed64Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Sfixed64Sfixed64Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Sfixed64Sfixed64EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Sfixed64Sfixed64Entry") + case "key": + out.Values[i] = ec._Maps_Sfixed64Sfixed64Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Sfixed64Sfixed64Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Sint32Sint32EntryImplementors = []string{"Maps_Sint32Sint32Entry"} + +func (ec *executionContext) _Maps_Sint32Sint32Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Sint32Sint32Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Sint32Sint32EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Sint32Sint32Entry") + case "key": + out.Values[i] = ec._Maps_Sint32Sint32Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Sint32Sint32Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Sint64Sint64EntryImplementors = []string{"Maps_Sint64Sint64Entry"} + +func (ec *executionContext) _Maps_Sint64Sint64Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Sint64Sint64Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Sint64Sint64EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Sint64Sint64Entry") + case "key": + out.Values[i] = ec._Maps_Sint64Sint64Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Sint64Sint64Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_StringBarEntryImplementors = []string{"Maps_StringBarEntry"} + +func (ec *executionContext) _Maps_StringBarEntry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_StringBarEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_StringBarEntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_StringBarEntry") + case "key": + out.Values[i] = ec._Maps_StringBarEntry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_StringBarEntry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_StringBytesEntryImplementors = []string{"Maps_StringBytesEntry"} + +func (ec *executionContext) _Maps_StringBytesEntry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_StringBytesEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_StringBytesEntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_StringBytesEntry") + case "key": + out.Values[i] = ec._Maps_StringBytesEntry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_StringBytesEntry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_StringDoubleEntryImplementors = []string{"Maps_StringDoubleEntry"} + +func (ec *executionContext) _Maps_StringDoubleEntry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_StringDoubleEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_StringDoubleEntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_StringDoubleEntry") + case "key": + out.Values[i] = ec._Maps_StringDoubleEntry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_StringDoubleEntry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_StringFloatEntryImplementors = []string{"Maps_StringFloatEntry"} + +func (ec *executionContext) _Maps_StringFloatEntry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_StringFloatEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_StringFloatEntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_StringFloatEntry") + case "key": + out.Values[i] = ec._Maps_StringFloatEntry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_StringFloatEntry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_StringFooEntryImplementors = []string{"Maps_StringFooEntry"} + +func (ec *executionContext) _Maps_StringFooEntry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_StringFooEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_StringFooEntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_StringFooEntry") + case "key": + out.Values[i] = ec._Maps_StringFooEntry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_StringFooEntry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_StringStringEntryImplementors = []string{"Maps_StringStringEntry"} + +func (ec *executionContext) _Maps_StringStringEntry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_StringStringEntry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_StringStringEntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_StringStringEntry") + case "key": + out.Values[i] = ec._Maps_StringStringEntry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_StringStringEntry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Uint32Uint32EntryImplementors = []string{"Maps_Uint32Uint32Entry"} + +func (ec *executionContext) _Maps_Uint32Uint32Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Uint32Uint32Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Uint32Uint32EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Uint32Uint32Entry") + case "key": + out.Values[i] = ec._Maps_Uint32Uint32Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Uint32Uint32Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var maps_Uint64Uint64EntryImplementors = []string{"Maps_Uint64Uint64Entry"} + +func (ec *executionContext) _Maps_Uint64Uint64Entry(ctx context.Context, sel ast.SelectionSet, obj *pb.Maps_Uint64Uint64Entry) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, maps_Uint64Uint64EntryImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Maps_Uint64Uint64Entry") + case "key": + out.Values[i] = ec._Maps_Uint64Uint64Entry_key(ctx, field, obj) + case "value": + out.Values[i] = ec._Maps_Uint64Uint64Entry_value(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var mutationImplementors = []string{"Mutation"} + +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Mutation") + case "constructsScalars_": + out.Values[i] = ec._Mutation_constructsScalars_(ctx, field) + case "constructsRepeated_": + out.Values[i] = ec._Mutation_constructsRepeated_(ctx, field) + case "constructsMaps_": + out.Values[i] = ec._Mutation_constructsMaps_(ctx, field) + case "constructsAny_": + out.Values[i] = ec._Mutation_constructsAny_(ctx, field) + case "constructsEmpty_": + out.Values[i] = ec._Mutation_constructsEmpty_(ctx, field) + case "constructsEmpty2_": + out.Values[i] = ec._Mutation_constructsEmpty2_(ctx, field) + case "constructsEmpty3_": + out.Values[i] = ec._Mutation_constructsEmpty3_(ctx, field) + case "constructsRef_": + out.Values[i] = ec._Mutation_constructsRef_(ctx, field) + case "constructsOneof_": + out.Values[i] = ec._Mutation_constructsOneof_(ctx, field) + case "constructsCallWithId": + out.Values[i] = ec._Mutation_constructsCallWithId(ctx, field) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var oneofImplementors = []string{"Oneof"} + +func (ec *executionContext) _Oneof(ctx context.Context, sel ast.SelectionSet, obj *pb.Oneof) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oneofImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Oneof") + case "param1": + out.Values[i] = ec._Oneof_param1(ctx, field, obj) + case "oneof1": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Oneof_oneof1(ctx, field, obj) + return res + }) + case "oneof2": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Oneof_oneof2(ctx, field, obj) + return res + }) + case "oneof3": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Oneof_oneof3(ctx, field, obj) + return res + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var oneof_Param2Implementors = []string{"Oneof_Param2", "Oneof_Oneof1"} + +func (ec *executionContext) _Oneof_Param2(ctx context.Context, sel ast.SelectionSet, obj *pb.Oneof_Param2) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oneof_Param2Implementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Oneof_Param2") + case "param2": + out.Values[i] = ec._Oneof_Param2_param2(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var oneof_Param3Implementors = []string{"Oneof_Param3", "Oneof_Oneof1"} + +func (ec *executionContext) _Oneof_Param3(ctx context.Context, sel ast.SelectionSet, obj *pb.Oneof_Param3) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oneof_Param3Implementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Oneof_Param3") + case "param3": + out.Values[i] = ec._Oneof_Param3_param3(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var oneof_Param4Implementors = []string{"Oneof_Param4", "Oneof_Oneof2"} + +func (ec *executionContext) _Oneof_Param4(ctx context.Context, sel ast.SelectionSet, obj *pb.Oneof_Param4) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oneof_Param4Implementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Oneof_Param4") + case "param4": + out.Values[i] = ec._Oneof_Param4_param4(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var oneof_Param5Implementors = []string{"Oneof_Param5", "Oneof_Oneof2"} + +func (ec *executionContext) _Oneof_Param5(ctx context.Context, sel ast.SelectionSet, obj *pb.Oneof_Param5) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oneof_Param5Implementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Oneof_Param5") + case "param5": + out.Values[i] = ec._Oneof_Param5_param5(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var oneof_Param6Implementors = []string{"Oneof_Param6", "Oneof_Oneof3"} + +func (ec *executionContext) _Oneof_Param6(ctx context.Context, sel ast.SelectionSet, obj *pb.Oneof_Param6) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, oneof_Param6Implementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Oneof_Param6") + case "param6": + out.Values[i] = ec._Oneof_Param6_param6(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var pb_AnyImplementors = []string{"Pb_Any"} + +func (ec *executionContext) _Pb_Any(ctx context.Context, sel ast.SelectionSet, obj *pb.Any) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, pb_AnyImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Pb_Any") + case "param1": + out.Values[i] = ec._Pb_Any_param1(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "dummy": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_dummy(ctx, field) + return res + }) + case "__type": + out.Values[i] = ec._Query___type(ctx, field) + case "__schema": + out.Values[i] = ec._Query___schema(ctx, field) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var refImplementors = []string{"Ref"} + +func (ec *executionContext) _Ref(ctx context.Context, sel ast.SelectionSet, obj *pb.Ref) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, refImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Ref") + case "localTime2": + out.Values[i] = ec._Ref_localTime2(ctx, field, obj) + case "external": + out.Values[i] = ec._Ref_external(ctx, field, obj) + case "localTime": + out.Values[i] = ec._Ref_localTime(ctx, field, obj) + case "file": + out.Values[i] = ec._Ref_file(ctx, field, obj) + case "fileMsg": + out.Values[i] = ec._Ref_fileMsg(ctx, field, obj) + case "fileEnum": + out.Values[i] = ec._Ref_fileEnum(ctx, field, obj) + case "local": + out.Values[i] = ec._Ref_local(ctx, field, obj) + case "foreign": + out.Values[i] = ec._Ref_foreign(ctx, field, obj) + case "en1": + out.Values[i] = ec._Ref_en1(ctx, field, obj) + case "en2": + out.Values[i] = ec._Ref_en2(ctx, field, obj) + case "gz": + out.Values[i] = ec._Ref_gz(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var ref_BarImplementors = []string{"Ref_Bar"} + +func (ec *executionContext) _Ref_Bar(ctx context.Context, sel ast.SelectionSet, obj *pb.Ref_Bar) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ref_BarImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Ref_Bar") + case "param1": + out.Values[i] = ec._Ref_Bar_param1(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var ref_FooImplementors = []string{"Ref_Foo"} + +func (ec *executionContext) _Ref_Foo(ctx context.Context, sel ast.SelectionSet, obj *pb.Ref_Foo) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ref_FooImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Ref_Foo") + case "bar1": + out.Values[i] = ec._Ref_Foo_bar1(ctx, field, obj) + case "localTime2": + out.Values[i] = ec._Ref_Foo_localTime2(ctx, field, obj) + case "externalTime1": + out.Values[i] = ec._Ref_Foo_externalTime1(ctx, field, obj) + case "bar2": + out.Values[i] = ec._Ref_Foo_bar2(ctx, field, obj) + case "en1": + out.Values[i] = ec._Ref_Foo_en1(ctx, field, obj) + case "en2": + out.Values[i] = ec._Ref_Foo_en2(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var ref_Foo_BarImplementors = []string{"Ref_Foo_Bar"} + +func (ec *executionContext) _Ref_Foo_Bar(ctx context.Context, sel ast.SelectionSet, obj *pb.Ref_Foo_Bar) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ref_Foo_BarImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Ref_Foo_Bar") + case "param1": + out.Values[i] = ec._Ref_Foo_Bar_param1(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var ref_Foo_Baz_GzImplementors = []string{"Ref_Foo_Baz_Gz"} + +func (ec *executionContext) _Ref_Foo_Baz_Gz(ctx context.Context, sel ast.SelectionSet, obj *pb.Ref_Foo_Baz_Gz) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, ref_Foo_Baz_GzImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Ref_Foo_Baz_Gz") + case "param1": + out.Values[i] = ec._Ref_Foo_Baz_Gz_param1(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var repeatedImplementors = []string{"Repeated"} + +func (ec *executionContext) _Repeated(ctx context.Context, sel ast.SelectionSet, obj *pb.Repeated) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, repeatedImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Repeated") + case "double": + out.Values[i] = ec._Repeated_double(ctx, field, obj) + case "float": + out.Values[i] = ec._Repeated_float(ctx, field, obj) + case "int32": + out.Values[i] = ec._Repeated_int32(ctx, field, obj) + case "int64": + out.Values[i] = ec._Repeated_int64(ctx, field, obj) + case "uint32": + out.Values[i] = ec._Repeated_uint32(ctx, field, obj) + case "uint64": + out.Values[i] = ec._Repeated_uint64(ctx, field, obj) + case "sint32": + out.Values[i] = ec._Repeated_sint32(ctx, field, obj) + case "sint64": + out.Values[i] = ec._Repeated_sint64(ctx, field, obj) + case "fixed32": + out.Values[i] = ec._Repeated_fixed32(ctx, field, obj) + case "fixed64": + out.Values[i] = ec._Repeated_fixed64(ctx, field, obj) + case "sfixed32": + out.Values[i] = ec._Repeated_sfixed32(ctx, field, obj) + case "sfixed64": + out.Values[i] = ec._Repeated_sfixed64(ctx, field, obj) + case "bool": + out.Values[i] = ec._Repeated_bool(ctx, field, obj) + case "stringX": + out.Values[i] = ec._Repeated_stringX(ctx, field, obj) + case "bytes": + out.Values[i] = ec._Repeated_bytes(ctx, field, obj) + case "foo": + out.Values[i] = ec._Repeated_foo(ctx, field, obj) + case "bar": + out.Values[i] = ec._Repeated_bar(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var scalarsImplementors = []string{"Scalars"} + +func (ec *executionContext) _Scalars(ctx context.Context, sel ast.SelectionSet, obj *pb.Scalars) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, scalarsImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Scalars") + case "double": + out.Values[i] = ec._Scalars_double(ctx, field, obj) + case "float": + out.Values[i] = ec._Scalars_float(ctx, field, obj) + case "int32": + out.Values[i] = ec._Scalars_int32(ctx, field, obj) + case "int64": + out.Values[i] = ec._Scalars_int64(ctx, field, obj) + case "uint32": + out.Values[i] = ec._Scalars_uint32(ctx, field, obj) + case "uint64": + out.Values[i] = ec._Scalars_uint64(ctx, field, obj) + case "sint32": + out.Values[i] = ec._Scalars_sint32(ctx, field, obj) + case "sint64": + out.Values[i] = ec._Scalars_sint64(ctx, field, obj) + case "fixed32": + out.Values[i] = ec._Scalars_fixed32(ctx, field, obj) + case "fixed64": + out.Values[i] = ec._Scalars_fixed64(ctx, field, obj) + case "sfixed32": + out.Values[i] = ec._Scalars_sfixed32(ctx, field, obj) + case "sfixed64": + out.Values[i] = ec._Scalars_sfixed64(ctx, field, obj) + case "bool": + out.Values[i] = ec._Scalars_bool(ctx, field, obj) + case "stringX": + out.Values[i] = ec._Scalars_stringX(ctx, field, obj) + case "bytes": + out.Values[i] = ec._Scalars_bytes(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var timestampImplementors = []string{"Timestamp"} + +func (ec *executionContext) _Timestamp(ctx context.Context, sel ast.SelectionSet, obj *pb.Timestamp) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, timestampImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Timestamp") + case "time": + out.Values[i] = ec._Timestamp_time(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) unmarshalNBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx context.Context, v interface{}) (pb.Bar, error) { + res, err := pb.UnmarshalBar(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx context.Context, sel ast.SelectionSet, v pb.Bar) graphql.Marshaler { + res := pb.MarshalBar(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalNBytes2ᚕbyte(ctx context.Context, v interface{}) ([]byte, error) { + res, err := types.UnmarshalBytes(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBytes2ᚕbyte(ctx context.Context, sel ast.SelectionSet, v []byte) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := types.MarshalBytes(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalNFloat2float32(ctx context.Context, v interface{}) (float32, error) { + res, err := types.UnmarshalFloat32(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFloat2float32(ctx context.Context, sel ast.SelectionSet, v float32) graphql.Marshaler { + res := types.MarshalFloat32(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { + res, err := graphql.UnmarshalFloat(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + res := graphql.MarshalFloat(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) marshalNFoo2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx context.Context, sel ast.SelectionSet, v *pb.Foo) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Foo(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFooInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx context.Context, v interface{}) (*pb.Foo, error) { + res, err := ec.unmarshalInputFooInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNInt2int32(ctx context.Context, v interface{}) (int32, error) { + res, err := graphql.UnmarshalInt32(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int32(ctx context.Context, sel ast.SelectionSet, v int32) graphql.Marshaler { + res := graphql.MarshalInt32(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + res := graphql.MarshalInt64(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalNInt2uint32(ctx context.Context, v interface{}) (uint32, error) { + res, err := types.UnmarshalUint32(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2uint32(ctx context.Context, sel ast.SelectionSet, v uint32) graphql.Marshaler { + res := types.MarshalUint32(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalNInt2uint64(ctx context.Context, v interface{}) (uint64, error) { + res, err := types.UnmarshalUint64(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2uint64(ctx context.Context, sel ast.SelectionSet, v uint64) graphql.Marshaler { + res := types.MarshalUint64(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) marshalNMaps_BoolBoolEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_BoolBoolEntry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_BoolBoolEntry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_BoolBoolEntry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_BoolBoolEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_BoolBoolEntry(ctx context.Context, v interface{}) (*pb.Maps_BoolBoolEntry, error) { + res, err := ec.unmarshalInputMaps_BoolBoolEntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Fixed32Fixed32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed32Fixed32Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Fixed32Fixed32Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Fixed32Fixed32Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Fixed32Fixed32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed32Fixed32Entry(ctx context.Context, v interface{}) (*pb.Maps_Fixed32Fixed32Entry, error) { + res, err := ec.unmarshalInputMaps_Fixed32Fixed32EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Fixed64Fixed64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed64Fixed64Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Fixed64Fixed64Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Fixed64Fixed64Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Fixed64Fixed64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed64Fixed64Entry(ctx context.Context, v interface{}) (*pb.Maps_Fixed64Fixed64Entry, error) { + res, err := ec.unmarshalInputMaps_Fixed64Fixed64EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Int32Int32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int32Int32Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Int32Int32Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Int32Int32Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Int32Int32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int32Int32Entry(ctx context.Context, v interface{}) (*pb.Maps_Int32Int32Entry, error) { + res, err := ec.unmarshalInputMaps_Int32Int32EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Int64Int64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int64Int64Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Int64Int64Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Int64Int64Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Int64Int64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int64Int64Entry(ctx context.Context, v interface{}) (*pb.Maps_Int64Int64Entry, error) { + res, err := ec.unmarshalInputMaps_Int64Int64EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Sfixed32Sfixed32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed32Sfixed32Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Sfixed32Sfixed32Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Sfixed32Sfixed32Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Sfixed32Sfixed32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed32Sfixed32Entry(ctx context.Context, v interface{}) (*pb.Maps_Sfixed32Sfixed32Entry, error) { + res, err := ec.unmarshalInputMaps_Sfixed32Sfixed32EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Sfixed64Sfixed64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed64Sfixed64Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Sfixed64Sfixed64Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Sfixed64Sfixed64Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Sfixed64Sfixed64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed64Sfixed64Entry(ctx context.Context, v interface{}) (*pb.Maps_Sfixed64Sfixed64Entry, error) { + res, err := ec.unmarshalInputMaps_Sfixed64Sfixed64EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Sint32Sint32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint32Sint32Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Sint32Sint32Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Sint32Sint32Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Sint32Sint32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint32Sint32Entry(ctx context.Context, v interface{}) (*pb.Maps_Sint32Sint32Entry, error) { + res, err := ec.unmarshalInputMaps_Sint32Sint32EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Sint64Sint64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint64Sint64Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Sint64Sint64Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Sint64Sint64Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Sint64Sint64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint64Sint64Entry(ctx context.Context, v interface{}) (*pb.Maps_Sint64Sint64Entry, error) { + res, err := ec.unmarshalInputMaps_Sint64Sint64EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_StringBarEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBarEntry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_StringBarEntry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_StringBarEntry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_StringBarEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBarEntry(ctx context.Context, v interface{}) (*pb.Maps_StringBarEntry, error) { + res, err := ec.unmarshalInputMaps_StringBarEntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_StringBytesEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBytesEntry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_StringBytesEntry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_StringBytesEntry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_StringBytesEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBytesEntry(ctx context.Context, v interface{}) (*pb.Maps_StringBytesEntry, error) { + res, err := ec.unmarshalInputMaps_StringBytesEntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_StringDoubleEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringDoubleEntry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_StringDoubleEntry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_StringDoubleEntry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_StringDoubleEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringDoubleEntry(ctx context.Context, v interface{}) (*pb.Maps_StringDoubleEntry, error) { + res, err := ec.unmarshalInputMaps_StringDoubleEntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_StringFloatEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFloatEntry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_StringFloatEntry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_StringFloatEntry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_StringFloatEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFloatEntry(ctx context.Context, v interface{}) (*pb.Maps_StringFloatEntry, error) { + res, err := ec.unmarshalInputMaps_StringFloatEntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_StringFooEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFooEntry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_StringFooEntry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_StringFooEntry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_StringFooEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFooEntry(ctx context.Context, v interface{}) (*pb.Maps_StringFooEntry, error) { + res, err := ec.unmarshalInputMaps_StringFooEntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_StringStringEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringStringEntry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_StringStringEntry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_StringStringEntry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_StringStringEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringStringEntry(ctx context.Context, v interface{}) (*pb.Maps_StringStringEntry, error) { + res, err := ec.unmarshalInputMaps_StringStringEntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Uint32Uint32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint32Uint32Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Uint32Uint32Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Uint32Uint32Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Uint32Uint32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint32Uint32Entry(ctx context.Context, v interface{}) (*pb.Maps_Uint32Uint32Entry, error) { + res, err := ec.unmarshalInputMaps_Uint32Uint32EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNMaps_Uint64Uint64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint64Uint64Entry(ctx context.Context, sel ast.SelectionSet, v *pb.Maps_Uint64Uint64Entry) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Maps_Uint64Uint64Entry(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNMaps_Uint64Uint64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint64Uint64Entry(ctx context.Context, v interface{}) (*pb.Maps_Uint64Uint64Entry, error) { + res, err := ec.unmarshalInputMaps_Uint64Uint64EntryInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalOAny2ᚖgoogleᚗgolangᚗorgᚋprotobufᚋtypesᚋknownᚋanypbᚐAny(ctx context.Context, v interface{}) (*anypb.Any, error) { + if v == nil { + return nil, nil + } + res, err := types.UnmarshalAny(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOAny2ᚖgoogleᚗgolangᚗorgᚋprotobufᚋtypesᚋknownᚋanypbᚐAny(ctx context.Context, sel ast.SelectionSet, v *anypb.Any) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return types.MarshalAny(v) +} + +func (ec *executionContext) unmarshalOBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx context.Context, v interface{}) (pb.Bar, error) { + res, err := pb.UnmarshalBar(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx context.Context, sel ast.SelectionSet, v pb.Bar) graphql.Marshaler { + return pb.MarshalBar(v) +} + +func (ec *executionContext) unmarshalOBar2ᚕgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBarᚄ(ctx context.Context, v interface{}) ([]pb.Bar, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]pb.Bar, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOBar2ᚕgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBarᚄ(ctx context.Context, sel ast.SelectionSet, v []pb.Bar) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNBar2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBar(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalOBaz2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBaz(ctx context.Context, sel ast.SelectionSet, v *pb.Baz) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Baz(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOBazInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐBaz(ctx context.Context, v interface{}) (*pb.Baz, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputBazInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + return graphql.MarshalBoolean(v) +} + +func (ec *executionContext) unmarshalOBoolean2ᚕboolᚄ(ctx context.Context, v interface{}) ([]bool, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]bool, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNBoolean2bool(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOBoolean2ᚕboolᚄ(ctx context.Context, sel ast.SelectionSet, v []bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNBoolean2bool(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return graphql.MarshalBoolean(*v) +} + +func (ec *executionContext) unmarshalOBytes2ᚕbyte(ctx context.Context, v interface{}) ([]byte, error) { + if v == nil { + return nil, nil + } + res, err := types.UnmarshalBytes(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBytes2ᚕbyte(ctx context.Context, sel ast.SelectionSet, v []byte) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return types.MarshalBytes(v) +} + +func (ec *executionContext) unmarshalOBytes2ᚕᚕbyteᚄ(ctx context.Context, v interface{}) ([][]byte, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([][]byte, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNBytes2ᚕbyte(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOBytes2ᚕᚕbyteᚄ(ctx context.Context, sel ast.SelectionSet, v [][]byte) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNBytes2ᚕbyte(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) unmarshalOFloat2float32(ctx context.Context, v interface{}) (float32, error) { + res, err := types.UnmarshalFloat32(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOFloat2float32(ctx context.Context, sel ast.SelectionSet, v float32) graphql.Marshaler { + return types.MarshalFloat32(v) +} + +func (ec *executionContext) unmarshalOFloat2float64(ctx context.Context, v interface{}) (float64, error) { + res, err := graphql.UnmarshalFloat(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + return graphql.MarshalFloat(v) +} + +func (ec *executionContext) unmarshalOFloat2ᚕfloat32ᚄ(ctx context.Context, v interface{}) ([]float32, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]float32, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFloat2float32(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOFloat2ᚕfloat32ᚄ(ctx context.Context, sel ast.SelectionSet, v []float32) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNFloat2float32(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) unmarshalOFloat2ᚕfloat64ᚄ(ctx context.Context, v interface{}) ([]float64, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]float64, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFloat2float64(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOFloat2ᚕfloat64ᚄ(ctx context.Context, sel ast.SelectionSet, v []float64) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNFloat2float64(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) marshalOFoo2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFooᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Foo) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNFoo2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalOFoo2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx context.Context, sel ast.SelectionSet, v *pb.Foo) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Foo(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOFooInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFooᚄ(ctx context.Context, v interface{}) ([]*pb.Foo, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Foo, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFooInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) unmarshalOFooInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo(ctx context.Context, v interface{}) (*pb.Foo, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFooInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOFoo_Foo22ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo_Foo2(ctx context.Context, sel ast.SelectionSet, v *pb.Foo_Foo2) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Foo_Foo2(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOFoo_Foo2Input2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo_Foo2(ctx context.Context, v interface{}) (*pb.Foo_Foo2, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFoo_Foo2Input(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOGoogleProtobuf_Timestamp2ᚖgoogleᚗgolangᚗorgᚋprotobufᚋtypesᚋknownᚋtimestamppbᚐTimestamp(ctx context.Context, sel ast.SelectionSet, v *timestamppb.Timestamp) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._GoogleProtobuf_Timestamp(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOGoogleProtobuf_TimestampInput2ᚖgoogleᚗgolangᚗorgᚋprotobufᚋtypesᚋknownᚋtimestamppbᚐTimestamp(ctx context.Context, v interface{}) (*timestamppb.Timestamp, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputGoogleProtobuf_TimestampInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOInt2int32(ctx context.Context, v interface{}) (int32, error) { + res, err := graphql.UnmarshalInt32(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2int32(ctx context.Context, sel ast.SelectionSet, v int32) graphql.Marshaler { + return graphql.MarshalInt32(v) +} + +func (ec *executionContext) unmarshalOInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + return graphql.MarshalInt64(v) +} + +func (ec *executionContext) unmarshalOInt2uint32(ctx context.Context, v interface{}) (uint32, error) { + res, err := types.UnmarshalUint32(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2uint32(ctx context.Context, sel ast.SelectionSet, v uint32) graphql.Marshaler { + return types.MarshalUint32(v) +} + +func (ec *executionContext) unmarshalOInt2uint64(ctx context.Context, v interface{}) (uint64, error) { + res, err := types.UnmarshalUint64(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOInt2uint64(ctx context.Context, sel ast.SelectionSet, v uint64) graphql.Marshaler { + return types.MarshalUint64(v) +} + +func (ec *executionContext) unmarshalOInt2ᚕint32ᚄ(ctx context.Context, v interface{}) ([]int32, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]int32, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInt2int32(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOInt2ᚕint32ᚄ(ctx context.Context, sel ast.SelectionSet, v []int32) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNInt2int32(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) unmarshalOInt2ᚕint64ᚄ(ctx context.Context, v interface{}) ([]int64, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]int64, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInt2int64(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOInt2ᚕint64ᚄ(ctx context.Context, sel ast.SelectionSet, v []int64) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNInt2int64(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) unmarshalOInt2ᚕuint32ᚄ(ctx context.Context, v interface{}) ([]uint32, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]uint32, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInt2uint32(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOInt2ᚕuint32ᚄ(ctx context.Context, sel ast.SelectionSet, v []uint32) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNInt2uint32(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) unmarshalOInt2ᚕuint64ᚄ(ctx context.Context, v interface{}) ([]uint64, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]uint64, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNInt2uint64(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOInt2ᚕuint64ᚄ(ctx context.Context, sel ast.SelectionSet, v []uint64) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNInt2uint64(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) marshalOMaps2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps(ctx context.Context, sel ast.SelectionSet, v *pb.Maps) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Maps(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOMapsInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps(ctx context.Context, v interface{}) (*pb.Maps, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputMapsInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOMaps_BoolBoolEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_BoolBoolEntryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_BoolBoolEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_BoolBoolEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_BoolBoolEntry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_BoolBoolEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_BoolBoolEntryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_BoolBoolEntry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_BoolBoolEntry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_BoolBoolEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_BoolBoolEntry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Fixed32Fixed32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed32Fixed32Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Fixed32Fixed32Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Fixed32Fixed32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed32Fixed32Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Fixed32Fixed32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed32Fixed32Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Fixed32Fixed32Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Fixed32Fixed32Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Fixed32Fixed32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed32Fixed32Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Fixed64Fixed64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed64Fixed64Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Fixed64Fixed64Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Fixed64Fixed64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed64Fixed64Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Fixed64Fixed64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed64Fixed64Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Fixed64Fixed64Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Fixed64Fixed64Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Fixed64Fixed64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Fixed64Fixed64Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Int32Int32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int32Int32Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Int32Int32Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Int32Int32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int32Int32Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Int32Int32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int32Int32Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Int32Int32Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Int32Int32Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Int32Int32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int32Int32Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Int64Int64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int64Int64Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Int64Int64Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Int64Int64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int64Int64Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Int64Int64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int64Int64Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Int64Int64Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Int64Int64Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Int64Int64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Int64Int64Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Sfixed32Sfixed32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed32Sfixed32Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Sfixed32Sfixed32Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Sfixed32Sfixed32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed32Sfixed32Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Sfixed32Sfixed32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed32Sfixed32Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Sfixed32Sfixed32Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Sfixed32Sfixed32Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Sfixed32Sfixed32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed32Sfixed32Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Sfixed64Sfixed64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed64Sfixed64Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Sfixed64Sfixed64Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Sfixed64Sfixed64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed64Sfixed64Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Sfixed64Sfixed64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed64Sfixed64Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Sfixed64Sfixed64Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Sfixed64Sfixed64Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Sfixed64Sfixed64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sfixed64Sfixed64Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Sint32Sint32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint32Sint32Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Sint32Sint32Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Sint32Sint32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint32Sint32Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Sint32Sint32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint32Sint32Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Sint32Sint32Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Sint32Sint32Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Sint32Sint32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint32Sint32Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Sint64Sint64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint64Sint64Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Sint64Sint64Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Sint64Sint64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint64Sint64Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Sint64Sint64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint64Sint64Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Sint64Sint64Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Sint64Sint64Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Sint64Sint64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Sint64Sint64Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_StringBarEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBarEntryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_StringBarEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_StringBarEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBarEntry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_StringBarEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBarEntryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_StringBarEntry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_StringBarEntry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_StringBarEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBarEntry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_StringBytesEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBytesEntryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_StringBytesEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_StringBytesEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBytesEntry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_StringBytesEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBytesEntryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_StringBytesEntry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_StringBytesEntry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_StringBytesEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringBytesEntry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_StringDoubleEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringDoubleEntryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_StringDoubleEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_StringDoubleEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringDoubleEntry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_StringDoubleEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringDoubleEntryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_StringDoubleEntry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_StringDoubleEntry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_StringDoubleEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringDoubleEntry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_StringFloatEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFloatEntryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_StringFloatEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_StringFloatEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFloatEntry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_StringFloatEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFloatEntryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_StringFloatEntry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_StringFloatEntry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_StringFloatEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFloatEntry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_StringFooEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFooEntryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_StringFooEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_StringFooEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFooEntry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_StringFooEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFooEntryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_StringFooEntry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_StringFooEntry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_StringFooEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringFooEntry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_StringStringEntry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringStringEntryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_StringStringEntry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_StringStringEntry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringStringEntry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_StringStringEntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringStringEntryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_StringStringEntry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_StringStringEntry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_StringStringEntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_StringStringEntry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Uint32Uint32Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint32Uint32Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Uint32Uint32Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Uint32Uint32Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint32Uint32Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Uint32Uint32EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint32Uint32Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Uint32Uint32Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Uint32Uint32Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Uint32Uint32EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint32Uint32Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOMaps_Uint64Uint64Entry2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint64Uint64Entryᚄ(ctx context.Context, sel ast.SelectionSet, v []*pb.Maps_Uint64Uint64Entry) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNMaps_Uint64Uint64Entry2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint64Uint64Entry(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalOMaps_Uint64Uint64EntryInput2ᚕᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint64Uint64Entryᚄ(ctx context.Context, v interface{}) ([]*pb.Maps_Uint64Uint64Entry, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]*pb.Maps_Uint64Uint64Entry, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNMaps_Uint64Uint64EntryInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐMaps_Uint64Uint64Entry(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOOneof2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof(ctx context.Context, sel ast.SelectionSet, v *pb.Oneof) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Oneof(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOOneofInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof(ctx context.Context, v interface{}) (*pb.Oneof, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputOneofInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOOneof_Oneof12githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof_Oneof1(ctx context.Context, sel ast.SelectionSet, v pb.Oneof_Oneof1) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Oneof_Oneof1(ctx, sel, v) +} + +func (ec *executionContext) marshalOOneof_Oneof22githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof_Oneof2(ctx context.Context, sel ast.SelectionSet, v pb.Oneof_Oneof2) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Oneof_Oneof2(ctx, sel, v) +} + +func (ec *executionContext) marshalOOneof_Oneof32githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐOneof_Oneof3(ctx context.Context, sel ast.SelectionSet, v pb.Oneof_Oneof3) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Oneof_Oneof3(ctx, sel, v) +} + +func (ec *executionContext) marshalOPb_Any2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐAny(ctx context.Context, sel ast.SelectionSet, v *pb.Any) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Pb_Any(ctx, sel, v) +} + +func (ec *executionContext) marshalORef2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef(ctx context.Context, sel ast.SelectionSet, v *pb.Ref) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Ref(ctx, sel, v) +} + +func (ec *executionContext) unmarshalORefInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef(ctx context.Context, v interface{}) (*pb.Ref, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputRefInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalORef_Bar2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Bar(ctx context.Context, sel ast.SelectionSet, v *pb.Ref_Bar) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Ref_Bar(ctx, sel, v) +} + +func (ec *executionContext) unmarshalORef_BarInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Bar(ctx context.Context, v interface{}) (*pb.Ref_Bar, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputRef_BarInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalORef_Foo2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo(ctx context.Context, sel ast.SelectionSet, v *pb.Ref_Foo) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Ref_Foo(ctx, sel, v) +} + +func (ec *executionContext) unmarshalORef_FooInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo(ctx context.Context, v interface{}) (*pb.Ref_Foo, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputRef_FooInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalORef_Foo_Bar2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar(ctx context.Context, sel ast.SelectionSet, v *pb.Ref_Foo_Bar) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Ref_Foo_Bar(ctx, sel, v) +} + +func (ec *executionContext) unmarshalORef_Foo_BarInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar(ctx context.Context, v interface{}) (*pb.Ref_Foo_Bar, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputRef_Foo_BarInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalORef_Foo_Bar_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar_En(ctx context.Context, v interface{}) (pb.Ref_Foo_Bar_En, error) { + res, err := pb.UnmarshalRef_Foo_Bar_En(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalORef_Foo_Bar_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Bar_En(ctx context.Context, sel ast.SelectionSet, v pb.Ref_Foo_Bar_En) graphql.Marshaler { + return pb.MarshalRef_Foo_Bar_En(v) +} + +func (ec *executionContext) marshalORef_Foo_Baz_Gz2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Baz_Gz(ctx context.Context, sel ast.SelectionSet, v *pb.Ref_Foo_Baz_Gz) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Ref_Foo_Baz_Gz(ctx, sel, v) +} + +func (ec *executionContext) unmarshalORef_Foo_Baz_GzInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_Baz_Gz(ctx context.Context, v interface{}) (*pb.Ref_Foo_Baz_Gz, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputRef_Foo_Baz_GzInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalORef_Foo_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_En(ctx context.Context, v interface{}) (pb.Ref_Foo_En, error) { + res, err := pb.UnmarshalRef_Foo_En(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalORef_Foo_En2githubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRef_Foo_En(ctx context.Context, sel ast.SelectionSet, v pb.Ref_Foo_En) graphql.Marshaler { + return pb.MarshalRef_Foo_En(v) +} + +func (ec *executionContext) marshalORepeated2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRepeated(ctx context.Context, sel ast.SelectionSet, v *pb.Repeated) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Repeated(ctx, sel, v) +} + +func (ec *executionContext) unmarshalORepeatedInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐRepeated(ctx context.Context, v interface{}) (*pb.Repeated, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputRepeatedInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOScalars2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐScalars(ctx context.Context, sel ast.SelectionSet, v *pb.Scalars) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Scalars(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOScalarsInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐScalars(ctx context.Context, v interface{}) (*pb.Scalars, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputScalarsInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + return graphql.MarshalString(v) +} + +func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNString2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOString2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNString2string(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return graphql.MarshalString(*v) +} + +func (ec *executionContext) marshalOTimestamp2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐTimestamp(ctx context.Context, sel ast.SelectionSet, v *pb.Timestamp) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Timestamp(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOTimestampInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐTimestamp(ctx context.Context, v interface{}) (*pb.Timestamp, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputTimestampInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/example/codegen/gql/options/generated.go b/example/codegen/gql/options/generated.go new file mode 100644 index 0000000..008865b --- /dev/null +++ b/example/codegen/gql/options/generated.go @@ -0,0 +1,4515 @@ +// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. + +package options + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "strconv" + "sync" + + "github.com/99designs/gqlgen/graphql" + "github.com/99designs/gqlgen/graphql/introspection" + "github.com/danielvladco/go-proto-gql/example/codegen/pb" + gqlparser "github.com/vektah/gqlparser/v2" + "github.com/vektah/gqlparser/v2/ast" +) + +// region ************************** generated!.gotpl ************************** + +// NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface. +func NewExecutableSchema(cfg Config) graphql.ExecutableSchema { + return &executableSchema{ + resolvers: cfg.Resolvers, + directives: cfg.Directives, + complexity: cfg.Complexity, + } +} + +type Config struct { + Resolvers ResolverRoot + Directives DirectiveRoot + Complexity ComplexityRoot +} + +type ResolverRoot interface { + Mutation() MutationResolver + Query() QueryResolver + Subscription() SubscriptionResolver +} + +type DirectiveRoot struct { + Query func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) + Service func(ctx context.Context, obj interface{}, next graphql.Resolver) (res interface{}, err error) +} + +type ComplexityRoot struct { + Data struct { + Double func(childComplexity int) int + Double2 func(childComplexity int) int + Foo func(childComplexity int) int + Foo2 func(childComplexity int) int + String2 func(childComplexity int) int + StringX func(childComplexity int) int + } + + Foo2 struct { + Param1 func(childComplexity int) int + } + + Mutation struct { + QueryMutate1 func(childComplexity int, in *pb.Data) int + ServiceInvalidSubscribe3 func(childComplexity int, in *pb.Data) int + ServiceMutate1 func(childComplexity int, in *pb.Data) int + ServiceMutate2 func(childComplexity int, in *pb.Data) int + ServicePubSub1 func(childComplexity int, in *pb.Data) int + ServicePubSub2 func(childComplexity int, in *pb.Data) int + ServicePublish func(childComplexity int, in *pb.Data) int + } + + Query struct { + QueryQuery1 func(childComplexity int, in *pb.Data) int + QueryQuery2 func(childComplexity int, in *pb.Data) int + ServiceInvalidSubscribe1 func(childComplexity int, in *pb.Data) int + ServiceQuery1 func(childComplexity int, in *pb.Data) int + } + + Subscription struct { + QuerySubscribe func(childComplexity int, in *pb.Data) int + ServiceInvalidSubscribe2 func(childComplexity int, in *pb.Data) int + ServiceInvalidSubscribe3 func(childComplexity int, in *pb.Data) int + ServicePubSub1 func(childComplexity int, in *pb.Data) int + ServicePubSub2 func(childComplexity int, in *pb.Data) int + ServiceSubscribe func(childComplexity int, in *pb.Data) int + } +} + +type MutationResolver interface { + ServiceMutate1(ctx context.Context, in *pb.Data) (*pb.Data, error) + ServiceMutate2(ctx context.Context, in *pb.Data) (*pb.Data, error) + ServicePublish(ctx context.Context, in *pb.Data) (*pb.Data, error) + ServicePubSub1(ctx context.Context, in *pb.Data) (*pb.Data, error) + ServiceInvalidSubscribe3(ctx context.Context, in *pb.Data) (*pb.Data, error) + ServicePubSub2(ctx context.Context, in *pb.Data) (*pb.Data, error) + QueryMutate1(ctx context.Context, in *pb.Data) (*pb.Data, error) +} +type QueryResolver interface { + ServiceQuery1(ctx context.Context, in *pb.Data) (*pb.Data, error) + ServiceInvalidSubscribe1(ctx context.Context, in *pb.Data) (*pb.Data, error) + QueryQuery1(ctx context.Context, in *pb.Data) (*pb.Data, error) + QueryQuery2(ctx context.Context, in *pb.Data) (*pb.Data, error) +} +type SubscriptionResolver interface { + ServiceSubscribe(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) + ServicePubSub1(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) + ServiceInvalidSubscribe2(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) + ServiceInvalidSubscribe3(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) + ServicePubSub2(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) + QuerySubscribe(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) +} + +type executableSchema struct { + resolvers ResolverRoot + directives DirectiveRoot + complexity ComplexityRoot +} + +func (e *executableSchema) Schema() *ast.Schema { + return parsedSchema +} + +func (e *executableSchema) Complexity(typeName, field string, childComplexity int, rawArgs map[string]interface{}) (int, bool) { + ec := executionContext{nil, e} + _ = ec + switch typeName + "." + field { + + case "Data.double": + if e.complexity.Data.Double == nil { + break + } + + return e.complexity.Data.Double(childComplexity), true + + case "Data.double2": + if e.complexity.Data.Double2 == nil { + break + } + + return e.complexity.Data.Double2(childComplexity), true + + case "Data.foo": + if e.complexity.Data.Foo == nil { + break + } + + return e.complexity.Data.Foo(childComplexity), true + + case "Data.foo2": + if e.complexity.Data.Foo2 == nil { + break + } + + return e.complexity.Data.Foo2(childComplexity), true + + case "Data.string2": + if e.complexity.Data.String2 == nil { + break + } + + return e.complexity.Data.String2(childComplexity), true + + case "Data.stringX": + if e.complexity.Data.StringX == nil { + break + } + + return e.complexity.Data.StringX(childComplexity), true + + case "Foo2.param1": + if e.complexity.Foo2.Param1 == nil { + break + } + + return e.complexity.Foo2.Param1(childComplexity), true + + case "Mutation.queryMutate1": + if e.complexity.Mutation.QueryMutate1 == nil { + break + } + + args, err := ec.field_Mutation_queryMutate1_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.QueryMutate1(childComplexity, args["in"].(*pb.Data)), true + + case "Mutation.serviceInvalidSubscribe3": + if e.complexity.Mutation.ServiceInvalidSubscribe3 == nil { + break + } + + args, err := ec.field_Mutation_serviceInvalidSubscribe3_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ServiceInvalidSubscribe3(childComplexity, args["in"].(*pb.Data)), true + + case "Mutation.serviceMutate1": + if e.complexity.Mutation.ServiceMutate1 == nil { + break + } + + args, err := ec.field_Mutation_serviceMutate1_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ServiceMutate1(childComplexity, args["in"].(*pb.Data)), true + + case "Mutation.serviceMutate2": + if e.complexity.Mutation.ServiceMutate2 == nil { + break + } + + args, err := ec.field_Mutation_serviceMutate2_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ServiceMutate2(childComplexity, args["in"].(*pb.Data)), true + + case "Mutation.servicePubSub1": + if e.complexity.Mutation.ServicePubSub1 == nil { + break + } + + args, err := ec.field_Mutation_servicePubSub1_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ServicePubSub1(childComplexity, args["in"].(*pb.Data)), true + + case "Mutation.servicePubSub2": + if e.complexity.Mutation.ServicePubSub2 == nil { + break + } + + args, err := ec.field_Mutation_servicePubSub2_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ServicePubSub2(childComplexity, args["in"].(*pb.Data)), true + + case "Mutation.servicePublish": + if e.complexity.Mutation.ServicePublish == nil { + break + } + + args, err := ec.field_Mutation_servicePublish_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.ServicePublish(childComplexity, args["in"].(*pb.Data)), true + + case "Query.queryQuery1": + if e.complexity.Query.QueryQuery1 == nil { + break + } + + args, err := ec.field_Query_queryQuery1_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.QueryQuery1(childComplexity, args["in"].(*pb.Data)), true + + case "Query.queryQuery2": + if e.complexity.Query.QueryQuery2 == nil { + break + } + + args, err := ec.field_Query_queryQuery2_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.QueryQuery2(childComplexity, args["in"].(*pb.Data)), true + + case "Query.serviceInvalidSubscribe1": + if e.complexity.Query.ServiceInvalidSubscribe1 == nil { + break + } + + args, err := ec.field_Query_serviceInvalidSubscribe1_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ServiceInvalidSubscribe1(childComplexity, args["in"].(*pb.Data)), true + + case "Query.serviceQuery1": + if e.complexity.Query.ServiceQuery1 == nil { + break + } + + args, err := ec.field_Query_serviceQuery1_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.ServiceQuery1(childComplexity, args["in"].(*pb.Data)), true + + case "Subscription.querySubscribe": + if e.complexity.Subscription.QuerySubscribe == nil { + break + } + + args, err := ec.field_Subscription_querySubscribe_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Subscription.QuerySubscribe(childComplexity, args["in"].(*pb.Data)), true + + case "Subscription.serviceInvalidSubscribe2": + if e.complexity.Subscription.ServiceInvalidSubscribe2 == nil { + break + } + + args, err := ec.field_Subscription_serviceInvalidSubscribe2_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Subscription.ServiceInvalidSubscribe2(childComplexity, args["in"].(*pb.Data)), true + + case "Subscription.serviceInvalidSubscribe3": + if e.complexity.Subscription.ServiceInvalidSubscribe3 == nil { + break + } + + args, err := ec.field_Subscription_serviceInvalidSubscribe3_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Subscription.ServiceInvalidSubscribe3(childComplexity, args["in"].(*pb.Data)), true + + case "Subscription.servicePubSub1": + if e.complexity.Subscription.ServicePubSub1 == nil { + break + } + + args, err := ec.field_Subscription_servicePubSub1_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Subscription.ServicePubSub1(childComplexity, args["in"].(*pb.Data)), true + + case "Subscription.servicePubSub2": + if e.complexity.Subscription.ServicePubSub2 == nil { + break + } + + args, err := ec.field_Subscription_servicePubSub2_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Subscription.ServicePubSub2(childComplexity, args["in"].(*pb.Data)), true + + case "Subscription.serviceSubscribe": + if e.complexity.Subscription.ServiceSubscribe == nil { + break + } + + args, err := ec.field_Subscription_serviceSubscribe_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Subscription.ServiceSubscribe(childComplexity, args["in"].(*pb.Data)), true + + } + return 0, false +} + +func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { + rc := graphql.GetOperationContext(ctx) + ec := executionContext{rc, e} + first := true + + switch rc.Operation.Operation { + case ast.Query: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + data := ec._Query(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + case ast.Mutation: + return func(ctx context.Context) *graphql.Response { + if !first { + return nil + } + first = false + data := ec._Mutation(ctx, rc.Operation.SelectionSet) + var buf bytes.Buffer + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + case ast.Subscription: + next := ec._Subscription(ctx, rc.Operation.SelectionSet) + + var buf bytes.Buffer + return func(ctx context.Context) *graphql.Response { + buf.Reset() + data := next() + + if data == nil { + return nil + } + data.MarshalGQL(&buf) + + return &graphql.Response{ + Data: buf.Bytes(), + } + } + + default: + return graphql.OneShot(graphql.ErrorResponse(ctx, "unsupported GraphQL operation")) + } +} + +type executionContext struct { + *graphql.OperationContext + *executableSchema +} + +func (ec *executionContext) introspectSchema() (*introspection.Schema, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapSchema(parsedSchema), nil +} + +func (ec *executionContext) introspectType(name string) (*introspection.Type, error) { + if ec.DisableIntrospection { + return nil, errors.New("introspection disabled") + } + return introspection.WrapTypeFromDef(parsedSchema, parsedSchema.Types[name]), nil +} + +var sources = []*ast.Source{ + {Name: "pb/options.graphqls", Input: `directive @Query on FIELD_DEFINITION +directive @Service on FIELD_DEFINITION +type Data { + """ + must be required + + """ + stringX: String! + """ + must be required + + """ + foo: Foo2! + """ + must be required because its greater than 0 + + """ + double: [Float!]! + """ + simple + + """ + string2: String + """ + simple + + """ + foo2: Foo2 + """ + simple + + """ + double2: [Float!] +} +input DataInput { + """ + must be required + + """ + stringX: String! + """ + must be required + + """ + foo: Foo2Input! + """ + must be required because its greater than 0 + + """ + double: [Float!]! + """ + simple + + """ + string2: String + """ + simple + + """ + foo2: Foo2Input + """ + simple + + """ + double2: [Float!] +} +type Foo2 { + param1: String +} +input Foo2Input { + param1: String +} +type Mutation { + """ + must be a mutation + + """ + serviceMutate1(in: DataInput): Data @Service + """ + must be a mutation + + """ + serviceMutate2(in: DataInput): Data @Service + """ + must be a mutation + + """ + servicePublish(in: DataInput): Data @Service + """ + must be a mutation and a subscription + + """ + servicePubSub1(in: DataInput): Data @Service + serviceInvalidSubscribe3(in: DataInput): Data @Service + servicePubSub2(in: DataInput): Data @Service + queryMutate1(in: DataInput): Data @Query +} +type Query { + serviceQuery1(in: DataInput): Data @Service + serviceInvalidSubscribe1(in: DataInput): Data @Service + """ + must be a query + + """ + queryQuery1(in: DataInput): Data @Query + """ + must be a query + + """ + queryQuery2(in: DataInput): Data @Query +} +type Subscription { + """ + must be a subscription + + """ + serviceSubscribe(in: DataInput): Data @Service + """ + must be a mutation and a subscription + + """ + servicePubSub1(in: DataInput): Data @Service + serviceInvalidSubscribe2(in: DataInput): Data @Service + serviceInvalidSubscribe3(in: DataInput): Data @Service + servicePubSub2(in: DataInput): Data @Service + """ + must be a subscription + + """ + querySubscribe(in: DataInput): Data @Query +} +`, BuiltIn: false}, +} +var parsedSchema = gqlparser.MustLoadSchema(sources...) + +// endregion ************************** generated!.gotpl ************************** + +// region ***************************** args.gotpl ***************************** + +func (ec *executionContext) field_Mutation_queryMutate1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_serviceInvalidSubscribe3_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_serviceMutate1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_serviceMutate2_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_servicePubSub1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_servicePubSub2_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_servicePublish_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 string + if tmp, ok := rawArgs["name"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + arg0, err = ec.unmarshalNString2string(ctx, tmp) + if err != nil { + return nil, err + } + } + args["name"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_queryQuery1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_queryQuery2_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_serviceInvalidSubscribe1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_serviceQuery1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Subscription_querySubscribe_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Subscription_serviceInvalidSubscribe2_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Subscription_serviceInvalidSubscribe3_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Subscription_servicePubSub1_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Subscription_servicePubSub2_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Subscription_serviceSubscribe_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 *pb.Data + if tmp, ok := rawArgs["in"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("in")) + arg0, err = ec.unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, tmp) + if err != nil { + return nil, err + } + } + args["in"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_enumValues_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +func (ec *executionContext) field___Type_fields_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 bool + if tmp, ok := rawArgs["includeDeprecated"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("includeDeprecated")) + arg0, err = ec.unmarshalOBoolean2bool(ctx, tmp) + if err != nil { + return nil, err + } + } + args["includeDeprecated"] = arg0 + return args, nil +} + +// endregion ***************************** args.gotpl ***************************** + +// region ************************** directives.gotpl ************************** + +// endregion ************************** directives.gotpl ************************** + +// region **************************** field.gotpl ***************************** + +func (ec *executionContext) _Data_stringX(ctx context.Context, field graphql.CollectedField, obj *pb.Data) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Data", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.StringX, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Data_foo(ctx context.Context, field graphql.CollectedField, obj *pb.Data) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Data", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Foo, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*pb.Foo2) + fc.Result = res + return ec.marshalNFoo22ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo2(ctx, field.Selections, res) +} + +func (ec *executionContext) _Data_double(ctx context.Context, field graphql.CollectedField, obj *pb.Data) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Data", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Double, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]float64) + fc.Result = res + return ec.marshalNFloat2ᚕfloat64ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Data_string2(ctx context.Context, field graphql.CollectedField, obj *pb.Data) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Data", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.String2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Data_foo2(ctx context.Context, field graphql.CollectedField, obj *pb.Data) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Data", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Foo2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Foo2) + fc.Result = res + return ec.marshalOFoo22ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo2(ctx, field.Selections, res) +} + +func (ec *executionContext) _Data_double2(ctx context.Context, field graphql.CollectedField, obj *pb.Data) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Data", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Double2, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]float64) + fc.Result = res + return ec.marshalOFloat2ᚕfloat64ᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) _Foo2_param1(ctx context.Context, field graphql.CollectedField, obj *pb.Foo2) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Foo2", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Param1, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_serviceMutate1(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_serviceMutate1_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ServiceMutate1(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_serviceMutate2(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_serviceMutate2_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ServiceMutate2(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_servicePublish(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_servicePublish_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ServicePublish(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_servicePubSub1(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_servicePubSub1_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ServicePubSub1(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_serviceInvalidSubscribe3(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_serviceInvalidSubscribe3_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ServiceInvalidSubscribe3(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_servicePubSub2(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_servicePubSub2_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ServicePubSub2(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_queryMutate1(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_queryMutate1_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().QueryMutate1(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Query == nil { + return nil, errors.New("directive Query is not implemented") + } + return ec.directives.Query(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query_serviceQuery1(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query_serviceQuery1_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ServiceQuery1(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query_serviceInvalidSubscribe1(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query_serviceInvalidSubscribe1_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().ServiceInvalidSubscribe1(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query_queryQuery1(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query_queryQuery1_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().QueryQuery1(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Query == nil { + return nil, errors.New("directive Query is not implemented") + } + return ec.directives.Query(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query_queryQuery2(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query_queryQuery2_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().QueryQuery2(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Query == nil { + return nil, errors.New("directive Query is not implemented") + } + return ec.directives.Query(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(*pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*pb.Data) + fc.Result = res + return ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query___type_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectType(args["name"].(string)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.introspectSchema() + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Schema) + fc.Result = res + return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) +} + +func (ec *executionContext) _Subscription_serviceSubscribe(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + fc := &graphql.FieldContext{ + Object: "Subscription", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Subscription_serviceSubscribe_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return nil + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().ServiceSubscribe(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(<-chan *pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be <-chan *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + return nil + } + return func() graphql.Marshaler { + res, ok := <-resTmp.(<-chan *pb.Data) + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + } +} + +func (ec *executionContext) _Subscription_servicePubSub1(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + fc := &graphql.FieldContext{ + Object: "Subscription", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Subscription_servicePubSub1_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return nil + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().ServicePubSub1(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(<-chan *pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be <-chan *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + return nil + } + return func() graphql.Marshaler { + res, ok := <-resTmp.(<-chan *pb.Data) + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + } +} + +func (ec *executionContext) _Subscription_serviceInvalidSubscribe2(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + fc := &graphql.FieldContext{ + Object: "Subscription", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Subscription_serviceInvalidSubscribe2_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return nil + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().ServiceInvalidSubscribe2(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(<-chan *pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be <-chan *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + return nil + } + return func() graphql.Marshaler { + res, ok := <-resTmp.(<-chan *pb.Data) + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + } +} + +func (ec *executionContext) _Subscription_serviceInvalidSubscribe3(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + fc := &graphql.FieldContext{ + Object: "Subscription", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Subscription_serviceInvalidSubscribe3_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return nil + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().ServiceInvalidSubscribe3(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(<-chan *pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be <-chan *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + return nil + } + return func() graphql.Marshaler { + res, ok := <-resTmp.(<-chan *pb.Data) + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + } +} + +func (ec *executionContext) _Subscription_servicePubSub2(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + fc := &graphql.FieldContext{ + Object: "Subscription", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Subscription_servicePubSub2_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return nil + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().ServicePubSub2(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Service == nil { + return nil, errors.New("directive Service is not implemented") + } + return ec.directives.Service(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(<-chan *pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be <-chan *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + return nil + } + return func() graphql.Marshaler { + res, ok := <-resTmp.(<-chan *pb.Data) + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + } +} + +func (ec *executionContext) _Subscription_querySubscribe(ctx context.Context, field graphql.CollectedField) (ret func() graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + fc := &graphql.FieldContext{ + Object: "Subscription", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Subscription_querySubscribe_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return nil + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + directive0 := func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Subscription().QuerySubscribe(rctx, args["in"].(*pb.Data)) + } + directive1 := func(ctx context.Context) (interface{}, error) { + if ec.directives.Query == nil { + return nil, errors.New("directive Query is not implemented") + } + return ec.directives.Query(ctx, nil, directive0) + } + + tmp, err := directive1(rctx) + if err != nil { + return nil, graphql.ErrorOnPath(ctx, err) + } + if tmp == nil { + return nil, nil + } + if data, ok := tmp.(<-chan *pb.Data); ok { + return data, nil + } + return nil, fmt.Errorf(`unexpected type %T from directive, should be <-chan *github.com/danielvladco/go-proto-gql/example/codegen/pb.Data`, tmp) + }) + if err != nil { + ec.Error(ctx, err) + return nil + } + if resTmp == nil { + return nil + } + return func() graphql.Marshaler { + res, ok := <-resTmp.(<-chan *pb.Data) + if !ok { + return nil + } + return graphql.WriterFunc(func(w io.Writer) { + w.Write([]byte{'{'}) + graphql.MarshalString(field.Alias).MarshalGQL(w) + w.Write([]byte{':'}) + ec.marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx, field.Selections, res).MarshalGQL(w) + w.Write([]byte{'}'}) + }) + } +} + +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Locations, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]string) + fc.Result = res + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalOString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field___Type_fields_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field___Type_enumValues_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputDataInput(ctx context.Context, obj interface{}) (pb.Data, error) { + var it pb.Data + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "stringX": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("stringX")) + it.StringX, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "foo": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("foo")) + it.Foo, err = ec.unmarshalNFoo2Input2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo2(ctx, v) + if err != nil { + return it, err + } + case "double": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("double")) + it.Double, err = ec.unmarshalNFloat2ᚕfloat64ᚄ(ctx, v) + if err != nil { + return it, err + } + case "string2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("string2")) + it.String2, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + case "foo2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("foo2")) + it.Foo2, err = ec.unmarshalOFoo2Input2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo2(ctx, v) + if err != nil { + return it, err + } + case "double2": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("double2")) + it.Double2, err = ec.unmarshalOFloat2ᚕfloat64ᚄ(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputFoo2Input(ctx context.Context, obj interface{}) (pb.Foo2, error) { + var it pb.Foo2 + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "param1": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("param1")) + it.Param1, err = ec.unmarshalOString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var dataImplementors = []string{"Data"} + +func (ec *executionContext) _Data(ctx context.Context, sel ast.SelectionSet, obj *pb.Data) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, dataImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Data") + case "stringX": + out.Values[i] = ec._Data_stringX(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "foo": + out.Values[i] = ec._Data_foo(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "double": + out.Values[i] = ec._Data_double(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "string2": + out.Values[i] = ec._Data_string2(ctx, field, obj) + case "foo2": + out.Values[i] = ec._Data_foo2(ctx, field, obj) + case "double2": + out.Values[i] = ec._Data_double2(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var foo2Implementors = []string{"Foo2"} + +func (ec *executionContext) _Foo2(ctx context.Context, sel ast.SelectionSet, obj *pb.Foo2) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, foo2Implementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Foo2") + case "param1": + out.Values[i] = ec._Foo2_param1(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var mutationImplementors = []string{"Mutation"} + +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Mutation") + case "serviceMutate1": + out.Values[i] = ec._Mutation_serviceMutate1(ctx, field) + case "serviceMutate2": + out.Values[i] = ec._Mutation_serviceMutate2(ctx, field) + case "servicePublish": + out.Values[i] = ec._Mutation_servicePublish(ctx, field) + case "servicePubSub1": + out.Values[i] = ec._Mutation_servicePubSub1(ctx, field) + case "serviceInvalidSubscribe3": + out.Values[i] = ec._Mutation_serviceInvalidSubscribe3(ctx, field) + case "servicePubSub2": + out.Values[i] = ec._Mutation_servicePubSub2(ctx, field) + case "queryMutate1": + out.Values[i] = ec._Mutation_queryMutate1(ctx, field) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "serviceQuery1": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_serviceQuery1(ctx, field) + return res + }) + case "serviceInvalidSubscribe1": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_serviceInvalidSubscribe1(ctx, field) + return res + }) + case "queryQuery1": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_queryQuery1(ctx, field) + return res + }) + case "queryQuery2": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Query_queryQuery2(ctx, field) + return res + }) + case "__type": + out.Values[i] = ec._Query___type(ctx, field) + case "__schema": + out.Values[i] = ec._Query___schema(ctx, field) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var subscriptionImplementors = []string{"Subscription"} + +func (ec *executionContext) _Subscription(ctx context.Context, sel ast.SelectionSet) func() graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, subscriptionImplementors) + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Subscription", + }) + if len(fields) != 1 { + ec.Errorf(ctx, "must subscribe to exactly one stream") + return nil + } + + switch fields[0].Name { + case "serviceSubscribe": + return ec._Subscription_serviceSubscribe(ctx, fields[0]) + case "servicePubSub1": + return ec._Subscription_servicePubSub1(ctx, fields[0]) + case "serviceInvalidSubscribe2": + return ec._Subscription_serviceInvalidSubscribe2(ctx, fields[0]) + case "serviceInvalidSubscribe3": + return ec._Subscription_serviceInvalidSubscribe3(ctx, fields[0]) + case "servicePubSub2": + return ec._Subscription_servicePubSub2(ctx, fields[0]) + case "querySubscribe": + return ec._Subscription_querySubscribe(ctx, fields[0]) + default: + panic("unknown field " + strconv.Quote(fields[0].Name)) + } +} + +var __DirectiveImplementors = []string{"__Directive"} + +func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __DirectiveImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Directive") + case "name": + out.Values[i] = ec.___Directive_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___Directive_description(ctx, field, obj) + case "locations": + out.Values[i] = ec.___Directive_locations(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "args": + out.Values[i] = ec.___Directive_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __EnumValueImplementors = []string{"__EnumValue"} + +func (ec *executionContext) ___EnumValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.EnumValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __EnumValueImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__EnumValue") + case "name": + out.Values[i] = ec.___EnumValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___EnumValue_description(ctx, field, obj) + case "isDeprecated": + out.Values[i] = ec.___EnumValue_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___EnumValue_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __FieldImplementors = []string{"__Field"} + +func (ec *executionContext) ___Field(ctx context.Context, sel ast.SelectionSet, obj *introspection.Field) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __FieldImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Field") + case "name": + out.Values[i] = ec.___Field_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___Field_description(ctx, field, obj) + case "args": + out.Values[i] = ec.___Field_args(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "type": + out.Values[i] = ec.___Field_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "isDeprecated": + out.Values[i] = ec.___Field_isDeprecated(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "deprecationReason": + out.Values[i] = ec.___Field_deprecationReason(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __InputValueImplementors = []string{"__InputValue"} + +func (ec *executionContext) ___InputValue(ctx context.Context, sel ast.SelectionSet, obj *introspection.InputValue) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __InputValueImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__InputValue") + case "name": + out.Values[i] = ec.___InputValue_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "description": + out.Values[i] = ec.___InputValue_description(ctx, field, obj) + case "type": + out.Values[i] = ec.___InputValue_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "defaultValue": + out.Values[i] = ec.___InputValue_defaultValue(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __SchemaImplementors = []string{"__Schema"} + +func (ec *executionContext) ___Schema(ctx context.Context, sel ast.SelectionSet, obj *introspection.Schema) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __SchemaImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Schema") + case "types": + out.Values[i] = ec.___Schema_types(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "queryType": + out.Values[i] = ec.___Schema_queryType(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "mutationType": + out.Values[i] = ec.___Schema_mutationType(ctx, field, obj) + case "subscriptionType": + out.Values[i] = ec.___Schema_subscriptionType(ctx, field, obj) + case "directives": + out.Values[i] = ec.___Schema_directives(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var __TypeImplementors = []string{"__Type"} + +func (ec *executionContext) ___Type(ctx context.Context, sel ast.SelectionSet, obj *introspection.Type) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, __TypeImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("__Type") + case "kind": + out.Values[i] = ec.___Type_kind(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + out.Values[i] = ec.___Type_name(ctx, field, obj) + case "description": + out.Values[i] = ec.___Type_description(ctx, field, obj) + case "fields": + out.Values[i] = ec.___Type_fields(ctx, field, obj) + case "interfaces": + out.Values[i] = ec.___Type_interfaces(ctx, field, obj) + case "possibleTypes": + out.Values[i] = ec.___Type_possibleTypes(ctx, field, obj) + case "enumValues": + out.Values[i] = ec.___Type_enumValues(ctx, field, obj) + case "inputFields": + out.Values[i] = ec.___Type_inputFields(ctx, field, obj) + case "ofType": + out.Values[i] = ec.___Type_ofType(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +// endregion **************************** object.gotpl **************************** + +// region ***************************** type.gotpl ***************************** + +func (ec *executionContext) unmarshalNBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + res := graphql.MarshalBoolean(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalNFloat2float64(ctx context.Context, v interface{}) (float64, error) { + res, err := graphql.UnmarshalFloat(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNFloat2float64(ctx context.Context, sel ast.SelectionSet, v float64) graphql.Marshaler { + res := graphql.MarshalFloat(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalNFloat2ᚕfloat64ᚄ(ctx context.Context, v interface{}) ([]float64, error) { + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]float64, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFloat2float64(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalNFloat2ᚕfloat64ᚄ(ctx context.Context, sel ast.SelectionSet, v []float64) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNFloat2float64(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) marshalNFoo22ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo2(ctx context.Context, sel ast.SelectionSet, v *pb.Foo2) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Foo2(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNFoo2Input2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo2(ctx context.Context, v interface{}) (*pb.Foo2, error) { + res, err := ec.unmarshalInputFoo2Input(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { + return ec.___Directive(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Directive) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__DirectiveLocation2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]string, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalN__DirectiveLocation2string(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalN__DirectiveLocation2ᚕstringᚄ(ctx context.Context, sel ast.SelectionSet, v []string) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__DirectiveLocation2string(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx context.Context, sel ast.SelectionSet, v introspection.EnumValue) graphql.Marshaler { + return ec.___EnumValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx context.Context, sel ast.SelectionSet, v introspection.Field) graphql.Marshaler { + return ec.___Field(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx context.Context, sel ast.SelectionSet, v introspection.InputValue) graphql.Marshaler { + return ec.___InputValue(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v introspection.Type) graphql.Marshaler { + return ec.___Type(ctx, sel, &v) +} + +func (ec *executionContext) marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +func (ec *executionContext) unmarshalN__TypeKind2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + res := graphql.MarshalString(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + +func (ec *executionContext) unmarshalOBoolean2bool(ctx context.Context, v interface{}) (bool, error) { + res, err := graphql.UnmarshalBoolean(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2bool(ctx context.Context, sel ast.SelectionSet, v bool) graphql.Marshaler { + return graphql.MarshalBoolean(v) +} + +func (ec *executionContext) unmarshalOBoolean2ᚖbool(ctx context.Context, v interface{}) (*bool, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalBoolean(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast.SelectionSet, v *bool) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return graphql.MarshalBoolean(*v) +} + +func (ec *executionContext) marshalOData2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx context.Context, sel ast.SelectionSet, v *pb.Data) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Data(ctx, sel, v) +} + +func (ec *executionContext) unmarshalODataInput2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐData(ctx context.Context, v interface{}) (*pb.Data, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputDataInput(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOFloat2ᚕfloat64ᚄ(ctx context.Context, v interface{}) ([]float64, error) { + if v == nil { + return nil, nil + } + var vSlice []interface{} + if v != nil { + if tmp1, ok := v.([]interface{}); ok { + vSlice = tmp1 + } else { + vSlice = []interface{}{v} + } + } + var err error + res := make([]float64, len(vSlice)) + for i := range vSlice { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithIndex(i)) + res[i], err = ec.unmarshalNFloat2float64(ctx, vSlice[i]) + if err != nil { + return nil, err + } + } + return res, nil +} + +func (ec *executionContext) marshalOFloat2ᚕfloat64ᚄ(ctx context.Context, sel ast.SelectionSet, v []float64) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + for i := range v { + ret[i] = ec.marshalNFloat2float64(ctx, sel, v[i]) + } + + return ret +} + +func (ec *executionContext) marshalOFoo22ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo2(ctx context.Context, sel ast.SelectionSet, v *pb.Foo2) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._Foo2(ctx, sel, v) +} + +func (ec *executionContext) unmarshalOFoo2Input2ᚖgithubᚗcomᚋdanielvladcoᚋgoᚑprotoᚑgqlᚋexampleᚋcodegenᚋpbᚐFoo2(ctx context.Context, v interface{}) (*pb.Foo2, error) { + if v == nil { + return nil, nil + } + res, err := ec.unmarshalInputFoo2Input(ctx, v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalOString2string(ctx context.Context, v interface{}) (string, error) { + res, err := graphql.UnmarshalString(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2string(ctx context.Context, sel ast.SelectionSet, v string) graphql.Marshaler { + return graphql.MarshalString(v) +} + +func (ec *executionContext) unmarshalOString2ᚖstring(ctx context.Context, v interface{}) (*string, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalString(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOString2ᚖstring(ctx context.Context, sel ast.SelectionSet, v *string) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return graphql.MarshalString(*v) +} + +func (ec *executionContext) marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.EnumValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__EnumValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Field) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Field2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐField(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.InputValue) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__InputValue2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValue(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx context.Context, sel ast.SelectionSet, v *introspection.Schema) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Schema(ctx, sel, v) +} + +func (ec *executionContext) marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx context.Context, sel ast.SelectionSet, v []introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalN__Type2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx context.Context, sel ast.SelectionSet, v *introspection.Type) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec.___Type(ctx, sel, v) +} + +// endregion ***************************** type.gotpl ***************************** diff --git a/example/codegen/gqlgen-constructs.yaml b/example/codegen/gqlgen-constructs.yaml new file mode 100644 index 0000000..679354d --- /dev/null +++ b/example/codegen/gqlgen-constructs.yaml @@ -0,0 +1,43 @@ +schema: + - pb/constructs.graphqls + +exec: + filename: gql/constructs/generated.go + package: constructs + +autobind: + - "github.com/danielvladco/go-proto-gql/example/codegen/pb" + +models: + Pb_Any: + model: + - github.com/danielvladco/go-proto-gql/example/codegen/pb.Any + GoogleProtobuf_TimestampInput: + model: + - google.golang.org/protobuf/types/known/timestamppb.Timestamp + GoogleProtobuf_Timestamp: + model: + - google.golang.org/protobuf/types/known/timestamppb.Timestamp + ID: + model: + - github.com/99designs/gqlgen/graphql.ID + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + Int: + model: + - github.com/99designs/gqlgen/graphql.Int + - github.com/99designs/gqlgen/graphql.Int64 + - github.com/99designs/gqlgen/graphql.Int32 + - github.com/danielvladco/go-proto-gql/pkg/types.Uint32 + - github.com/danielvladco/go-proto-gql/pkg/types.Uint64 + Any: + model: + - github.com/danielvladco/go-proto-gql/pkg/types.Any + Bytes: + model: + - github.com/danielvladco/go-proto-gql/pkg/types.Bytes + Float: + model: + - github.com/99designs/gqlgen/graphql.Float + - github.com/danielvladco/go-proto-gql/pkg/types.Float32 diff --git a/example/codegen/gqlgen-options.yaml b/example/codegen/gqlgen-options.yaml new file mode 100644 index 0000000..0112405 --- /dev/null +++ b/example/codegen/gqlgen-options.yaml @@ -0,0 +1,9 @@ +schema: + - pb/options.graphqls + +exec: + filename: gql/options/generated.go + package: options + +autobind: + - "github.com/danielvladco/go-proto-gql/example/codegen/pb" diff --git a/example/codegen/main.go b/example/codegen/main.go new file mode 100644 index 0000000..426f6d4 --- /dev/null +++ b/example/codegen/main.go @@ -0,0 +1,131 @@ +package main + +import ( + "context" + "log" + "net/http" + "os" + + "github.com/99designs/gqlgen/graphql/handler" + "github.com/99designs/gqlgen/graphql/playground" + + "github.com/danielvladco/go-proto-gql/example/codegen/gql/constructs" + "github.com/danielvladco/go-proto-gql/example/codegen/gql/options" + "github.com/danielvladco/go-proto-gql/example/codegen/pb" +) + +const defaultPort = "8088" + +func main() { + port := os.Getenv("PORT") + if port == "" { + port = defaultPort + } + + constructsHandler := handler.NewDefaultServer(constructs.NewExecutableSchema(constructs.Config{ + Resolvers: constructsRoot{}, + })) + + optionsHandler := handler.NewDefaultServer(options.NewExecutableSchema(options.Config{ + Resolvers: optionsRoot{}, + })) + http.Handle("/", playground.Handler("GraphQL playground", "/constructs-query")) + http.Handle("/constructs-query", constructsHandler) + http.Handle("/options-query", optionsHandler) + + log.Printf("connect to http://localhost:%s/ for GraphQL playground", port) + log.Fatal(http.ListenAndServe(":"+port, nil)) +} + +// constructsRoot implements constructs.ResolverRoot showcasing that all resolvers were generated successfully +// we need a bit of binding like in example bellow and we are ready to go + +type constructsRoot struct{} + +func (r constructsRoot) Maps() constructs.MapsResolver { return pb.MapsResolvers{} } +func (r constructsRoot) MapsInput() constructs.MapsInputResolver { return pb.MapsInputResolvers{} } +func (r constructsRoot) OneofInput() constructs.OneofInputResolver { return pb.OneofInputResolvers{} } +func (r constructsRoot) Mutation() constructs.MutationResolver { + return &pb.ConstructsResolvers{Service: pb.ConstructsServer(nil)} +} +func (r constructsRoot) Oneof() constructs.OneofResolver { + return pb.OneofResolvers{} +} +func (r constructsRoot) Query() constructs.QueryResolver { + return dummy{} +} + +// dummy is generated when graphql schema doesn't have any query resolvers. +// In this case the dummy resolver will not be generated by the library and +// you should do it yourself like in example bellow +type dummy struct{} + +func (d dummy) Dummy(ctx context.Context) (*bool, error) { panic("implement me") } + +// optionsRoot implements options.ResolverRoot to showcase the generated resolvers +// as well as the missing ones. Some resolvers are missing because they use grpc streams +// which is too complex for graphql to deal with it by default. +// +// I might consider implementing it on the future. If you need this feature let me know by +// submitting an issue or if the issue already exists, show activity on it so I know there is real interest. +type optionsRoot struct{} + +func (r optionsRoot) Mutation() options.MutationResolver { + return &optionsMutationQueryResolver{ + ServiceResolvers: &pb.ServiceResolvers{Service: pb.ServiceServer(nil)}, + QueryResolvers: &pb.QueryResolvers{Service: pb.QueryServer(nil)}, + } +} + +func (r optionsRoot) Query() options.QueryResolver { + return &optionsMutationQueryResolver{ + ServiceResolvers: &pb.ServiceResolvers{Service: pb.ServiceServer(nil)}, + QueryResolvers: &pb.QueryResolvers{Service: pb.QueryServer(nil)}, + } +} + +func (r optionsRoot) Subscription() options.SubscriptionResolver { + return &optionsSubscriptionResolver{} +} + +type optionsMutationQueryResolver struct { + *pb.ServiceResolvers + *pb.QueryResolvers +} + +func (o optionsMutationQueryResolver) ServicePublish(ctx context.Context, in *pb.Data) (*pb.Data, error) { + panic("implement me") +} +func (o optionsMutationQueryResolver) ServicePubSub1(ctx context.Context, in *pb.Data) (*pb.Data, error) { + panic("implement me") +} +func (o optionsMutationQueryResolver) ServiceInvalidSubscribe3(ctx context.Context, in *pb.Data) (*pb.Data, error) { + panic("implement me") +} +func (o optionsMutationQueryResolver) ServicePubSub2(ctx context.Context, in *pb.Data) (*pb.Data, error) { + panic("implement me") +} +func (o optionsMutationQueryResolver) ServiceInvalidSubscribe1(ctx context.Context, in *pb.Data) (*pb.Data, error) { + panic("implement me") +} + +type optionsSubscriptionResolver struct{} + +func (o optionsSubscriptionResolver) ServiceSubscribe(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) { + panic("implement me") +} +func (o optionsSubscriptionResolver) ServicePubSub1(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) { + panic("implement me") +} +func (o optionsSubscriptionResolver) ServiceInvalidSubscribe2(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) { + panic("implement me") +} +func (o optionsSubscriptionResolver) ServiceInvalidSubscribe3(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) { + panic("implement me") +} +func (o optionsSubscriptionResolver) ServicePubSub2(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) { + panic("implement me") +} +func (o optionsSubscriptionResolver) QuerySubscribe(ctx context.Context, in *pb.Data) (<-chan *pb.Data, error) { + panic("implement me") +} diff --git a/example/codegen/pb/constructs.gqlgen.pb.go b/example/codegen/pb/constructs.gqlgen.pb.go new file mode 100644 index 0000000..60e2146 --- /dev/null +++ b/example/codegen/pb/constructs.gqlgen.pb.go @@ -0,0 +1,553 @@ +package pb + +import ( + context "context" + fmt "fmt" + graphql "github.com/99designs/gqlgen/graphql" + any "github.com/golang/protobuf/ptypes/any" + empty "github.com/golang/protobuf/ptypes/empty" + io "io" +) + +type ConstructsResolvers struct{ Service ConstructsServer } + +func (s *ConstructsResolvers) ConstructsScalars(ctx context.Context, in *Scalars) (*Scalars, error) { + return s.Service.Scalars_(ctx, in) +} +func (s *ConstructsResolvers) ConstructsRepeated(ctx context.Context, in *Repeated) (*Repeated, error) { + return s.Service.Repeated_(ctx, in) +} +func (s *ConstructsResolvers) ConstructsMaps(ctx context.Context, in *Maps) (*Maps, error) { + return s.Service.Maps_(ctx, in) +} +func (s *ConstructsResolvers) ConstructsAny(ctx context.Context, in *any.Any) (*Any, error) { + return s.Service.Any_(ctx, in) +} +func (s *ConstructsResolvers) ConstructsEmpty(ctx context.Context) (*bool, error) { + _, err := s.Service.Empty_(ctx, &empty.Empty{}) + return nil, err +} +func (s *ConstructsResolvers) ConstructsEmpty2(ctx context.Context) (*bool, error) { + _, err := s.Service.Empty2_(ctx, &EmptyRecursive{}) + return nil, err +} +func (s *ConstructsResolvers) ConstructsEmpty3(ctx context.Context) (*bool, error) { + _, err := s.Service.Empty3_(ctx, &Empty3{}) + return nil, err +} +func (s *ConstructsResolvers) ConstructsRef(ctx context.Context, in *Ref) (*Ref, error) { + return s.Service.Ref_(ctx, in) +} +func (s *ConstructsResolvers) ConstructsOneof(ctx context.Context, in *Oneof) (*Oneof, error) { + return s.Service.Oneof_(ctx, in) +} +func (s *ConstructsResolvers) ConstructsCallWithID(ctx context.Context) (*bool, error) { + _, err := s.Service.CallWithId(ctx, &Empty{}) + return nil, err +} + +type Empty3Input = Empty3 +type Empty3_IntInput = Empty3_Int +type FooInput = Foo +type Foo_Foo2Input = Foo_Foo2 +type BazInput = Baz +type ScalarsInput = Scalars +type RepeatedInput = Repeated +type MapsInput = Maps +type MapsResolvers struct{} +type MapsInputResolvers struct{} + +func (r MapsResolvers) Int32Int32(_ context.Context, obj *Maps) (list []*Maps_Int32Int32Entry, _ error) { + for k, v := range obj.Int32Int32 { + list = append(list, &Maps_Int32Int32Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Int32Int32(_ context.Context, obj *Maps, data []*Maps_Int32Int32Entry) error { + for _, v := range data { + obj.Int32Int32[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) Int64Int64(_ context.Context, obj *Maps) (list []*Maps_Int64Int64Entry, _ error) { + for k, v := range obj.Int64Int64 { + list = append(list, &Maps_Int64Int64Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Int64Int64(_ context.Context, obj *Maps, data []*Maps_Int64Int64Entry) error { + for _, v := range data { + obj.Int64Int64[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) Uint32Uint32(_ context.Context, obj *Maps) (list []*Maps_Uint32Uint32Entry, _ error) { + for k, v := range obj.Uint32Uint32 { + list = append(list, &Maps_Uint32Uint32Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Uint32Uint32(_ context.Context, obj *Maps, data []*Maps_Uint32Uint32Entry) error { + for _, v := range data { + obj.Uint32Uint32[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) Uint64Uint64(_ context.Context, obj *Maps) (list []*Maps_Uint64Uint64Entry, _ error) { + for k, v := range obj.Uint64Uint64 { + list = append(list, &Maps_Uint64Uint64Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Uint64Uint64(_ context.Context, obj *Maps, data []*Maps_Uint64Uint64Entry) error { + for _, v := range data { + obj.Uint64Uint64[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) Sint32Sint32(_ context.Context, obj *Maps) (list []*Maps_Sint32Sint32Entry, _ error) { + for k, v := range obj.Sint32Sint32 { + list = append(list, &Maps_Sint32Sint32Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Sint32Sint32(_ context.Context, obj *Maps, data []*Maps_Sint32Sint32Entry) error { + for _, v := range data { + obj.Sint32Sint32[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) Sint64Sint64(_ context.Context, obj *Maps) (list []*Maps_Sint64Sint64Entry, _ error) { + for k, v := range obj.Sint64Sint64 { + list = append(list, &Maps_Sint64Sint64Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Sint64Sint64(_ context.Context, obj *Maps, data []*Maps_Sint64Sint64Entry) error { + for _, v := range data { + obj.Sint64Sint64[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) Fixed32Fixed32(_ context.Context, obj *Maps) (list []*Maps_Fixed32Fixed32Entry, _ error) { + for k, v := range obj.Fixed32Fixed32 { + list = append(list, &Maps_Fixed32Fixed32Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Fixed32Fixed32(_ context.Context, obj *Maps, data []*Maps_Fixed32Fixed32Entry) error { + for _, v := range data { + obj.Fixed32Fixed32[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) Fixed64Fixed64(_ context.Context, obj *Maps) (list []*Maps_Fixed64Fixed64Entry, _ error) { + for k, v := range obj.Fixed64Fixed64 { + list = append(list, &Maps_Fixed64Fixed64Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Fixed64Fixed64(_ context.Context, obj *Maps, data []*Maps_Fixed64Fixed64Entry) error { + for _, v := range data { + obj.Fixed64Fixed64[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) Sfixed32Sfixed32(_ context.Context, obj *Maps) (list []*Maps_Sfixed32Sfixed32Entry, _ error) { + for k, v := range obj.Sfixed32Sfixed32 { + list = append(list, &Maps_Sfixed32Sfixed32Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Sfixed32Sfixed32(_ context.Context, obj *Maps, data []*Maps_Sfixed32Sfixed32Entry) error { + for _, v := range data { + obj.Sfixed32Sfixed32[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) Sfixed64Sfixed64(_ context.Context, obj *Maps) (list []*Maps_Sfixed64Sfixed64Entry, _ error) { + for k, v := range obj.Sfixed64Sfixed64 { + list = append(list, &Maps_Sfixed64Sfixed64Entry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) Sfixed64Sfixed64(_ context.Context, obj *Maps, data []*Maps_Sfixed64Sfixed64Entry) error { + for _, v := range data { + obj.Sfixed64Sfixed64[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) BoolBool(_ context.Context, obj *Maps) (list []*Maps_BoolBoolEntry, _ error) { + for k, v := range obj.BoolBool { + list = append(list, &Maps_BoolBoolEntry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) BoolBool(_ context.Context, obj *Maps, data []*Maps_BoolBoolEntry) error { + for _, v := range data { + obj.BoolBool[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) StringString(_ context.Context, obj *Maps) (list []*Maps_StringStringEntry, _ error) { + for k, v := range obj.StringString { + list = append(list, &Maps_StringStringEntry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) StringString(_ context.Context, obj *Maps, data []*Maps_StringStringEntry) error { + for _, v := range data { + obj.StringString[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) StringBytes(_ context.Context, obj *Maps) (list []*Maps_StringBytesEntry, _ error) { + for k, v := range obj.StringBytes { + list = append(list, &Maps_StringBytesEntry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) StringBytes(_ context.Context, obj *Maps, data []*Maps_StringBytesEntry) error { + for _, v := range data { + obj.StringBytes[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) StringFloat(_ context.Context, obj *Maps) (list []*Maps_StringFloatEntry, _ error) { + for k, v := range obj.StringFloat { + list = append(list, &Maps_StringFloatEntry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) StringFloat(_ context.Context, obj *Maps, data []*Maps_StringFloatEntry) error { + for _, v := range data { + obj.StringFloat[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) StringDouble(_ context.Context, obj *Maps) (list []*Maps_StringDoubleEntry, _ error) { + for k, v := range obj.StringDouble { + list = append(list, &Maps_StringDoubleEntry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) StringDouble(_ context.Context, obj *Maps, data []*Maps_StringDoubleEntry) error { + for _, v := range data { + obj.StringDouble[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) StringFoo(_ context.Context, obj *Maps) (list []*Maps_StringFooEntry, _ error) { + for k, v := range obj.StringFoo { + list = append(list, &Maps_StringFooEntry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) StringFoo(_ context.Context, obj *Maps, data []*Maps_StringFooEntry) error { + for _, v := range data { + obj.StringFoo[v.Key] = v.Value + } + return nil +} + +func (r MapsResolvers) StringBar(_ context.Context, obj *Maps) (list []*Maps_StringBarEntry, _ error) { + for k, v := range obj.StringBar { + list = append(list, &Maps_StringBarEntry{ + Key: k, + Value: v, + }) + } + return +} + +func (m MapsInputResolvers) StringBar(_ context.Context, obj *Maps, data []*Maps_StringBarEntry) error { + for _, v := range data { + obj.StringBar[v.Key] = v.Value + } + return nil +} + +type Maps_Int32Int32EntryInput = Maps_Int32Int32Entry +type Maps_Int32Int32Entry struct { + Key int32 + Value int32 +} + +type Maps_Int64Int64EntryInput = Maps_Int64Int64Entry +type Maps_Int64Int64Entry struct { + Key int64 + Value int64 +} + +type Maps_Uint32Uint32EntryInput = Maps_Uint32Uint32Entry +type Maps_Uint32Uint32Entry struct { + Key uint32 + Value uint32 +} + +type Maps_Uint64Uint64EntryInput = Maps_Uint64Uint64Entry +type Maps_Uint64Uint64Entry struct { + Key uint64 + Value uint64 +} + +type Maps_Sint32Sint32EntryInput = Maps_Sint32Sint32Entry +type Maps_Sint32Sint32Entry struct { + Key int32 + Value int32 +} + +type Maps_Sint64Sint64EntryInput = Maps_Sint64Sint64Entry +type Maps_Sint64Sint64Entry struct { + Key int64 + Value int64 +} + +type Maps_Fixed32Fixed32EntryInput = Maps_Fixed32Fixed32Entry +type Maps_Fixed32Fixed32Entry struct { + Key uint32 + Value uint32 +} + +type Maps_Fixed64Fixed64EntryInput = Maps_Fixed64Fixed64Entry +type Maps_Fixed64Fixed64Entry struct { + Key uint64 + Value uint64 +} + +type Maps_Sfixed32Sfixed32EntryInput = Maps_Sfixed32Sfixed32Entry +type Maps_Sfixed32Sfixed32Entry struct { + Key int32 + Value int32 +} + +type Maps_Sfixed64Sfixed64EntryInput = Maps_Sfixed64Sfixed64Entry +type Maps_Sfixed64Sfixed64Entry struct { + Key int64 + Value int64 +} + +type Maps_BoolBoolEntryInput = Maps_BoolBoolEntry +type Maps_BoolBoolEntry struct { + Key bool + Value bool +} + +type Maps_StringStringEntryInput = Maps_StringStringEntry +type Maps_StringStringEntry struct { + Key string + Value string +} + +type Maps_StringBytesEntryInput = Maps_StringBytesEntry +type Maps_StringBytesEntry struct { + Key string + Value []byte +} + +type Maps_StringFloatEntryInput = Maps_StringFloatEntry +type Maps_StringFloatEntry struct { + Key string + Value float32 +} + +type Maps_StringDoubleEntryInput = Maps_StringDoubleEntry +type Maps_StringDoubleEntry struct { + Key string + Value float64 +} + +type Maps_StringFooEntryInput = Maps_StringFooEntry +type Maps_StringFooEntry struct { + Key string + Value *Foo +} + +type Maps_StringBarEntryInput = Maps_StringBarEntry +type Maps_StringBarEntry struct { + Key string + Value Bar +} + +type AnyInput = Any +type EmptyInput = Empty +type EmptyRecursiveInput = EmptyRecursive +type EmptyNestedInput = EmptyNested +type EmptyNested_EmptyNested1Input = EmptyNested_EmptyNested1 +type EmptyNested_EmptyNested1_EmptyNested2Input = EmptyNested_EmptyNested1_EmptyNested2 +type TimestampInput = Timestamp +type RefInput = Ref +type Ref_BarInput = Ref_Bar +type Ref_FooInput = Ref_Foo + +func MarshalRef_Foo_En(x Ref_Foo_En) graphql.Marshaler { + return graphql.WriterFunc(func(w io.Writer) { + _, _ = fmt.Fprintf(w, "%q", x.String()) + }) +} + +func UnmarshalRef_Foo_En(v interface{}) (Ref_Foo_En, error) { + code, ok := v.(string) + if ok { + return Ref_Foo_En(Ref_Foo_En_value[code]), nil + } + return 0, fmt.Errorf("cannot unmarshal Ref_Foo_En enum") +} + +type Ref_Foo_BazInput = Ref_Foo_Baz +type Ref_Foo_Baz_GzInput = Ref_Foo_Baz_Gz +type Ref_Foo_BarInput = Ref_Foo_Bar + +func MarshalRef_Foo_Bar_En(x Ref_Foo_Bar_En) graphql.Marshaler { + return graphql.WriterFunc(func(w io.Writer) { + _, _ = fmt.Fprintf(w, "%q", x.String()) + }) +} + +func UnmarshalRef_Foo_Bar_En(v interface{}) (Ref_Foo_Bar_En, error) { + code, ok := v.(string) + if ok { + return Ref_Foo_Bar_En(Ref_Foo_Bar_En_value[code]), nil + } + return 0, fmt.Errorf("cannot unmarshal Ref_Foo_Bar_En enum") +} + +type OneofInput = Oneof +type OneofResolvers struct{} +type OneofInputResolvers struct{} + +func (o OneofInputResolvers) Param2(_ context.Context, obj *Oneof, data *string) error { + obj.Oneof1 = &Oneof_Param2{Param2: *data} + return nil +} + +func (o OneofInputResolvers) Param3(_ context.Context, obj *Oneof, data *string) error { + obj.Oneof1 = &Oneof_Param3{Param3: *data} + return nil +} + +func (o OneofResolvers) Oneof1(_ context.Context, obj *Oneof) (Oneof_Oneof1, error) { + return obj.Oneof1, nil +} + +type Oneof_Oneof1 interface{} + +func (o OneofInputResolvers) Param4(_ context.Context, obj *Oneof, data *string) error { + obj.Oneof2 = &Oneof_Param4{Param4: *data} + return nil +} + +func (o OneofInputResolvers) Param5(_ context.Context, obj *Oneof, data *string) error { + obj.Oneof2 = &Oneof_Param5{Param5: *data} + return nil +} + +func (o OneofResolvers) Oneof2(_ context.Context, obj *Oneof) (Oneof_Oneof2, error) { + return obj.Oneof2, nil +} + +type Oneof_Oneof2 interface{} + +func (o OneofInputResolvers) Param6(_ context.Context, obj *Oneof, data *string) error { + obj.Oneof3 = &Oneof_Param6{Param6: *data} + return nil +} + +func (o OneofResolvers) Oneof3(_ context.Context, obj *Oneof) (Oneof_Oneof3, error) { + return obj.Oneof3, nil +} + +type Oneof_Oneof3 interface{} + +func MarshalBar(x Bar) graphql.Marshaler { + return graphql.WriterFunc(func(w io.Writer) { + _, _ = fmt.Fprintf(w, "%q", x.String()) + }) +} + +func UnmarshalBar(v interface{}) (Bar, error) { + code, ok := v.(string) + if ok { + return Bar(Bar_value[code]), nil + } + return 0, fmt.Errorf("cannot unmarshal Bar enum") +} diff --git a/example/codegen/pb/constructs.graphqls b/example/codegen/pb/constructs.graphqls new file mode 100644 index 0000000..a0b7c2c --- /dev/null +++ b/example/codegen/pb/constructs.graphqls @@ -0,0 +1,648 @@ +directive @Constructs on FIELD_DEFINITION +directive @Oneof_Oneof1 on INPUT_FIELD_DEFINITION +directive @Oneof_Oneof2 on INPUT_FIELD_DEFINITION +directive @Oneof_Oneof3 on INPUT_FIELD_DEFINITION +""" +Any is any json type +""" +scalar Any +enum Bar { + BAR1 + BAR2 + BAR3 +} +type Baz { + param1: String +} +input BazInput { + param1: String +} +scalar Bytes +type Foo { + param1: String + param2: String +} +input FooInput { + param1: String + param2: String +} +type Foo_Foo2 { + param1: String +} +input Foo_Foo2Input { + param1: String +} +""" + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at + nanosecond resolution. The count is relative to an epoch at UTC midnight on + January 1, 1970, in the proleptic Gregorian calendar which extends the + Gregorian calendar backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a [24-hour linear + smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from [RFC + 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + + Example 5: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + where {year} is always expressed using four digits while {month}, {day}, + {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + is required. A proto3 JSON serializer should always use UTC (as indicated by + "Z") when printing the Timestamp type and a proto3 JSON parser should be + able to accept both UTC and other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + 01:30 UTC on January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the + standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted + to this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + the Joda Time's [`ISODateTimeFormat.dateTime()`]( + http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + ) to obtain a formatter capable of generating timestamps in this format. + + + +""" +type GoogleProtobuf_Timestamp { + """ + Represents seconds of UTC time since Unix epoch + 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + 9999-12-31T23:59:59Z inclusive. + + """ + seconds: Int + """ + Non-negative fractions of a second at nanosecond resolution. Negative + second values with fractions must still have non-negative nanos values + that count forward in time. Must be from 0 to 999,999,999 + inclusive. + + """ + nanos: Int +} +""" + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at + nanosecond resolution. The count is relative to an epoch at UTC midnight on + January 1, 1970, in the proleptic Gregorian calendar which extends the + Gregorian calendar backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a [24-hour linear + smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from [RFC + 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + + Example 5: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + where {year} is always expressed using four digits while {month}, {day}, + {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + is required. A proto3 JSON serializer should always use UTC (as indicated by + "Z") when printing the Timestamp type and a proto3 JSON parser should be + able to accept both UTC and other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + 01:30 UTC on January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the + standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted + to this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + the Joda Time's [`ISODateTimeFormat.dateTime()`]( + http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + ) to obtain a formatter capable of generating timestamps in this format. + + + +""" +input GoogleProtobuf_TimestampInput { + """ + Represents seconds of UTC time since Unix epoch + 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + 9999-12-31T23:59:59Z inclusive. + + """ + seconds: Int + """ + Non-negative fractions of a second at nanosecond resolution. Negative + second values with fractions must still have non-negative nanos values + that count forward in time. Must be from 0 to 999,999,999 + inclusive. + + """ + nanos: Int +} +type Maps { + int32Int32: [Maps_Int32Int32Entry!] + int64Int64: [Maps_Int64Int64Entry!] + uint32Uint32: [Maps_Uint32Uint32Entry!] + uint64Uint64: [Maps_Uint64Uint64Entry!] + sint32Sint32: [Maps_Sint32Sint32Entry!] + sint64Sint64: [Maps_Sint64Sint64Entry!] + fixed32Fixed32: [Maps_Fixed32Fixed32Entry!] + fixed64Fixed64: [Maps_Fixed64Fixed64Entry!] + sfixed32Sfixed32: [Maps_Sfixed32Sfixed32Entry!] + sfixed64Sfixed64: [Maps_Sfixed64Sfixed64Entry!] + boolBool: [Maps_BoolBoolEntry!] + stringString: [Maps_StringStringEntry!] + stringBytes: [Maps_StringBytesEntry!] + stringFloat: [Maps_StringFloatEntry!] + stringDouble: [Maps_StringDoubleEntry!] + stringFoo: [Maps_StringFooEntry!] + stringBar: [Maps_StringBarEntry!] +} +input MapsInput { + int32Int32: [Maps_Int32Int32EntryInput!] + int64Int64: [Maps_Int64Int64EntryInput!] + uint32Uint32: [Maps_Uint32Uint32EntryInput!] + uint64Uint64: [Maps_Uint64Uint64EntryInput!] + sint32Sint32: [Maps_Sint32Sint32EntryInput!] + sint64Sint64: [Maps_Sint64Sint64EntryInput!] + fixed32Fixed32: [Maps_Fixed32Fixed32EntryInput!] + fixed64Fixed64: [Maps_Fixed64Fixed64EntryInput!] + sfixed32Sfixed32: [Maps_Sfixed32Sfixed32EntryInput!] + sfixed64Sfixed64: [Maps_Sfixed64Sfixed64EntryInput!] + boolBool: [Maps_BoolBoolEntryInput!] + stringString: [Maps_StringStringEntryInput!] + stringBytes: [Maps_StringBytesEntryInput!] + stringFloat: [Maps_StringFloatEntryInput!] + stringDouble: [Maps_StringDoubleEntryInput!] + stringFoo: [Maps_StringFooEntryInput!] + stringBar: [Maps_StringBarEntryInput!] +} +type Maps_BoolBoolEntry { + key: Boolean + value: Boolean +} +input Maps_BoolBoolEntryInput { + key: Boolean + value: Boolean +} +type Maps_Fixed32Fixed32Entry { + key: Int + value: Int +} +input Maps_Fixed32Fixed32EntryInput { + key: Int + value: Int +} +type Maps_Fixed64Fixed64Entry { + key: Int + value: Int +} +input Maps_Fixed64Fixed64EntryInput { + key: Int + value: Int +} +type Maps_Int32Int32Entry { + key: Int + value: Int +} +input Maps_Int32Int32EntryInput { + key: Int + value: Int +} +type Maps_Int64Int64Entry { + key: Int + value: Int +} +input Maps_Int64Int64EntryInput { + key: Int + value: Int +} +type Maps_Sfixed32Sfixed32Entry { + key: Int + value: Int +} +input Maps_Sfixed32Sfixed32EntryInput { + key: Int + value: Int +} +type Maps_Sfixed64Sfixed64Entry { + key: Int + value: Int +} +input Maps_Sfixed64Sfixed64EntryInput { + key: Int + value: Int +} +type Maps_Sint32Sint32Entry { + key: Int + value: Int +} +input Maps_Sint32Sint32EntryInput { + key: Int + value: Int +} +type Maps_Sint64Sint64Entry { + key: Int + value: Int +} +input Maps_Sint64Sint64EntryInput { + key: Int + value: Int +} +type Maps_StringBarEntry { + key: String + value: Bar +} +input Maps_StringBarEntryInput { + key: String + value: Bar +} +type Maps_StringBytesEntry { + key: String + value: Bytes +} +input Maps_StringBytesEntryInput { + key: String + value: Bytes +} +type Maps_StringDoubleEntry { + key: String + value: Float +} +input Maps_StringDoubleEntryInput { + key: String + value: Float +} +type Maps_StringFloatEntry { + key: String + value: Float +} +input Maps_StringFloatEntryInput { + key: String + value: Float +} +type Maps_StringFooEntry { + key: String + value: Foo +} +input Maps_StringFooEntryInput { + key: String + value: FooInput +} +type Maps_StringStringEntry { + key: String + value: String +} +input Maps_StringStringEntryInput { + key: String + value: String +} +type Maps_Uint32Uint32Entry { + key: Int + value: Int +} +input Maps_Uint32Uint32EntryInput { + key: Int + value: Int +} +type Maps_Uint64Uint64Entry { + key: Int + value: Int +} +input Maps_Uint64Uint64EntryInput { + key: Int + value: Int +} +type Mutation { + """ + all possible scalars and same message as input and output + + """ + constructsScalars_(in: ScalarsInput): Scalars @Constructs + """ + all scalars messages and enums as repeated + + """ + constructsRepeated_(in: RepeatedInput): Repeated @Constructs + """ + all possible maps and different messages as input and output + + """ + constructsMaps_(in: MapsInput): Maps @Constructs + """ + same name different types + + """ + constructsAny_(in: Any): Pb_Any @Constructs + """ + empty input and empty output + + """ + constructsEmpty_: Boolean @Constructs + """ + messages with all empty fields + + """ + constructsEmpty2_: Boolean @Constructs + """ + messages with all empty fields + + """ + constructsEmpty3_: Boolean @Constructs + constructsRef_(in: RefInput): Ref @Constructs + constructsOneof_(in: OneofInput): Oneof @Constructs + constructsCallWithId: Boolean @Constructs +} +type Oneof { + param1: String + oneof1: Oneof_Oneof1 + oneof2: Oneof_Oneof2 + oneof3: Oneof_Oneof3 +} +input OneofInput { + param1: String + param2: String @Oneof_Oneof1 + param3: String @Oneof_Oneof1 + param4: String @Oneof_Oneof2 + param5: String @Oneof_Oneof2 + param6: String @Oneof_Oneof3 +} +union Oneof_Oneof1 = Oneof_Param2 | Oneof_Param3 +union Oneof_Oneof2 = Oneof_Param4 | Oneof_Param5 +union Oneof_Oneof3 = Oneof_Param6 +type Oneof_Param2 { + param2: String +} +type Oneof_Param3 { + param3: String +} +type Oneof_Param4 { + param4: String +} +type Oneof_Param5 { + param5: String +} +type Oneof_Param6 { + param6: String +} +type Pb_Any { + param1: String +} +type Query { + dummy: Boolean +} +type Ref { + localTime2: Timestamp + external: GoogleProtobuf_Timestamp + localTime: Timestamp + file: Baz + fileMsg: Foo + fileEnum: Bar + local: Ref_Foo + foreign: Foo_Foo2 + en1: Ref_Foo_En + en2: Ref_Foo_Bar_En + gz: Ref_Foo_Baz_Gz +} +input RefInput { + localTime2: TimestampInput + external: GoogleProtobuf_TimestampInput + localTime: TimestampInput + file: BazInput + fileMsg: FooInput + fileEnum: Bar + local: Ref_FooInput + foreign: Foo_Foo2Input + en1: Ref_Foo_En + en2: Ref_Foo_Bar_En + gz: Ref_Foo_Baz_GzInput +} +type Ref_Bar { + param1: String +} +input Ref_BarInput { + param1: String +} +type Ref_Foo { + bar1: Ref_Foo_Bar + localTime2: Timestamp + externalTime1: GoogleProtobuf_Timestamp + bar2: Ref_Bar + en1: Ref_Foo_En + en2: Ref_Foo_Bar_En +} +input Ref_FooInput { + bar1: Ref_Foo_BarInput + localTime2: TimestampInput + externalTime1: GoogleProtobuf_TimestampInput + bar2: Ref_BarInput + en1: Ref_Foo_En + en2: Ref_Foo_Bar_En +} +type Ref_Foo_Bar { + param1: String +} +input Ref_Foo_BarInput { + param1: String +} +enum Ref_Foo_Bar_En { + A0 + A1 +} +type Ref_Foo_Baz_Gz { + param1: String +} +input Ref_Foo_Baz_GzInput { + param1: String +} +enum Ref_Foo_En { + A0 + A1 +} +type Repeated { + double: [Float!] + float: [Float!] + int32: [Int!] + int64: [Int!] + uint32: [Int!] + uint64: [Int!] + sint32: [Int!] + sint64: [Int!] + fixed32: [Int!] + fixed64: [Int!] + sfixed32: [Int!] + sfixed64: [Int!] + bool: [Boolean!] + stringX: [String!] + bytes: [Bytes!] + foo: [Foo!] + bar: [Bar!] +} +input RepeatedInput { + double: [Float!] + float: [Float!] + int32: [Int!] + int64: [Int!] + uint32: [Int!] + uint64: [Int!] + sint32: [Int!] + sint64: [Int!] + fixed32: [Int!] + fixed64: [Int!] + sfixed32: [Int!] + sfixed64: [Int!] + bool: [Boolean!] + stringX: [String!] + bytes: [Bytes!] + foo: [FooInput!] + bar: [Bar!] +} +type Scalars { + double: Float + float: Float + int32: Int + int64: Int + uint32: Int + uint64: Int + sint32: Int + sint64: Int + fixed32: Int + fixed64: Int + sfixed32: Int + sfixed64: Int + bool: Boolean + """ + x for collisions with go method String + + """ + stringX: String + bytes: Bytes +} +input ScalarsInput { + double: Float + float: Float + int32: Int + int64: Int + uint32: Int + uint64: Int + sint32: Int + sint64: Int + fixed32: Int + fixed64: Int + sfixed32: Int + sfixed64: Int + bool: Boolean + """ + x for collisions with go method String + + """ + stringX: String + bytes: Bytes +} +type Timestamp { + time: String +} +input TimestampInput { + time: String +} diff --git a/example/codegen/pb/constructs.pb.go b/example/codegen/pb/constructs.pb.go new file mode 100644 index 0000000..af21813 --- /dev/null +++ b/example/codegen/pb/constructs.pb.go @@ -0,0 +1,2565 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: pb/constructs.proto + +package pb + +import ( + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + empty "github.com/golang/protobuf/ptypes/empty" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Bar int32 + +const ( + Bar_BAR1 Bar = 0 + Bar_BAR2 Bar = 1 + Bar_BAR3 Bar = 2 +) + +// Enum value maps for Bar. +var ( + Bar_name = map[int32]string{ + 0: "BAR1", + 1: "BAR2", + 2: "BAR3", + } + Bar_value = map[string]int32{ + "BAR1": 0, + "BAR2": 1, + "BAR3": 2, + } +) + +func (x Bar) Enum() *Bar { + p := new(Bar) + *p = x + return p +} + +func (x Bar) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Bar) Descriptor() protoreflect.EnumDescriptor { + return file_pb_constructs_proto_enumTypes[0].Descriptor() +} + +func (Bar) Type() protoreflect.EnumType { + return &file_pb_constructs_proto_enumTypes[0] +} + +func (x Bar) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Bar.Descriptor instead. +func (Bar) EnumDescriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{0} +} + +type Ref_Foo_En int32 + +const ( + Ref_Foo_A0 Ref_Foo_En = 0 + Ref_Foo_A1 Ref_Foo_En = 1 +) + +// Enum value maps for Ref_Foo_En. +var ( + Ref_Foo_En_name = map[int32]string{ + 0: "A0", + 1: "A1", + } + Ref_Foo_En_value = map[string]int32{ + "A0": 0, + "A1": 1, + } +) + +func (x Ref_Foo_En) Enum() *Ref_Foo_En { + p := new(Ref_Foo_En) + *p = x + return p +} + +func (x Ref_Foo_En) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Ref_Foo_En) Descriptor() protoreflect.EnumDescriptor { + return file_pb_constructs_proto_enumTypes[1].Descriptor() +} + +func (Ref_Foo_En) Type() protoreflect.EnumType { + return &file_pb_constructs_proto_enumTypes[1] +} + +func (x Ref_Foo_En) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Ref_Foo_En.Descriptor instead. +func (Ref_Foo_En) EnumDescriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{11, 1, 0} +} + +type Ref_Foo_Bar_En int32 + +const ( + Ref_Foo_Bar_A0 Ref_Foo_Bar_En = 0 + Ref_Foo_Bar_A1 Ref_Foo_Bar_En = 1 +) + +// Enum value maps for Ref_Foo_Bar_En. +var ( + Ref_Foo_Bar_En_name = map[int32]string{ + 0: "A0", + 1: "A1", + } + Ref_Foo_Bar_En_value = map[string]int32{ + "A0": 0, + "A1": 1, + } +) + +func (x Ref_Foo_Bar_En) Enum() *Ref_Foo_Bar_En { + p := new(Ref_Foo_Bar_En) + *p = x + return p +} + +func (x Ref_Foo_Bar_En) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Ref_Foo_Bar_En) Descriptor() protoreflect.EnumDescriptor { + return file_pb_constructs_proto_enumTypes[2].Descriptor() +} + +func (Ref_Foo_Bar_En) Type() protoreflect.EnumType { + return &file_pb_constructs_proto_enumTypes[2] +} + +func (x Ref_Foo_Bar_En) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Ref_Foo_Bar_En.Descriptor instead. +func (Ref_Foo_Bar_En) EnumDescriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{11, 1, 1, 0} +} + +type Empty3 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + I *Empty3_Int `protobuf:"bytes,1,opt,name=i,proto3" json:"i,omitempty"` +} + +func (x *Empty3) Reset() { + *x = Empty3{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty3) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty3) ProtoMessage() {} + +func (x *Empty3) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty3.ProtoReflect.Descriptor instead. +func (*Empty3) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{0} +} + +func (x *Empty3) GetI() *Empty3_Int { + if x != nil { + return x.I + } + return nil +} + +type Foo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` + Param2 string `protobuf:"bytes,2,opt,name=param2,proto3" json:"param2,omitempty"` +} + +func (x *Foo) Reset() { + *x = Foo{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Foo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Foo) ProtoMessage() {} + +func (x *Foo) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Foo.ProtoReflect.Descriptor instead. +func (*Foo) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{1} +} + +func (x *Foo) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +func (x *Foo) GetParam2() string { + if x != nil { + return x.Param2 + } + return "" +} + +type Baz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Baz) Reset() { + *x = Baz{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Baz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Baz) ProtoMessage() {} + +func (x *Baz) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Baz.ProtoReflect.Descriptor instead. +func (*Baz) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{2} +} + +func (x *Baz) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +type Scalars struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Double float64 `protobuf:"fixed64,1,opt,name=double,proto3" json:"double,omitempty"` + Float float32 `protobuf:"fixed32,2,opt,name=float,proto3" json:"float,omitempty"` + Int32 int32 `protobuf:"varint,3,opt,name=int32,proto3" json:"int32,omitempty"` + Int64 int64 `protobuf:"varint,4,opt,name=int64,proto3" json:"int64,omitempty"` + Uint32 uint32 `protobuf:"varint,5,opt,name=uint32,proto3" json:"uint32,omitempty"` + Uint64 uint64 `protobuf:"varint,6,opt,name=uint64,proto3" json:"uint64,omitempty"` + Sint32 int32 `protobuf:"zigzag32,7,opt,name=sint32,proto3" json:"sint32,omitempty"` + Sint64 int64 `protobuf:"zigzag64,8,opt,name=sint64,proto3" json:"sint64,omitempty"` + Fixed32 uint32 `protobuf:"fixed32,9,opt,name=fixed32,proto3" json:"fixed32,omitempty"` + Fixed64 uint64 `protobuf:"fixed64,10,opt,name=fixed64,proto3" json:"fixed64,omitempty"` + Sfixed32 int32 `protobuf:"fixed32,11,opt,name=sfixed32,proto3" json:"sfixed32,omitempty"` + Sfixed64 int64 `protobuf:"fixed64,12,opt,name=sfixed64,proto3" json:"sfixed64,omitempty"` + Bool bool `protobuf:"varint,13,opt,name=bool,proto3" json:"bool,omitempty"` + StringX string `protobuf:"bytes,14,opt,name=string_x,json=stringX,proto3" json:"string_x,omitempty"` // x for collisions with go method String + Bytes []byte `protobuf:"bytes,15,opt,name=bytes,proto3" json:"bytes,omitempty"` +} + +func (x *Scalars) Reset() { + *x = Scalars{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Scalars) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Scalars) ProtoMessage() {} + +func (x *Scalars) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Scalars.ProtoReflect.Descriptor instead. +func (*Scalars) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{3} +} + +func (x *Scalars) GetDouble() float64 { + if x != nil { + return x.Double + } + return 0 +} + +func (x *Scalars) GetFloat() float32 { + if x != nil { + return x.Float + } + return 0 +} + +func (x *Scalars) GetInt32() int32 { + if x != nil { + return x.Int32 + } + return 0 +} + +func (x *Scalars) GetInt64() int64 { + if x != nil { + return x.Int64 + } + return 0 +} + +func (x *Scalars) GetUint32() uint32 { + if x != nil { + return x.Uint32 + } + return 0 +} + +func (x *Scalars) GetUint64() uint64 { + if x != nil { + return x.Uint64 + } + return 0 +} + +func (x *Scalars) GetSint32() int32 { + if x != nil { + return x.Sint32 + } + return 0 +} + +func (x *Scalars) GetSint64() int64 { + if x != nil { + return x.Sint64 + } + return 0 +} + +func (x *Scalars) GetFixed32() uint32 { + if x != nil { + return x.Fixed32 + } + return 0 +} + +func (x *Scalars) GetFixed64() uint64 { + if x != nil { + return x.Fixed64 + } + return 0 +} + +func (x *Scalars) GetSfixed32() int32 { + if x != nil { + return x.Sfixed32 + } + return 0 +} + +func (x *Scalars) GetSfixed64() int64 { + if x != nil { + return x.Sfixed64 + } + return 0 +} + +func (x *Scalars) GetBool() bool { + if x != nil { + return x.Bool + } + return false +} + +func (x *Scalars) GetStringX() string { + if x != nil { + return x.StringX + } + return "" +} + +func (x *Scalars) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +type Repeated struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Double []float64 `protobuf:"fixed64,1,rep,packed,name=double,proto3" json:"double,omitempty"` + Float []float32 `protobuf:"fixed32,2,rep,packed,name=float,proto3" json:"float,omitempty"` + Int32 []int32 `protobuf:"varint,3,rep,packed,name=int32,proto3" json:"int32,omitempty"` + Int64 []int64 `protobuf:"varint,4,rep,packed,name=int64,proto3" json:"int64,omitempty"` + Uint32 []uint32 `protobuf:"varint,5,rep,packed,name=uint32,proto3" json:"uint32,omitempty"` + Uint64 []uint64 `protobuf:"varint,6,rep,packed,name=uint64,proto3" json:"uint64,omitempty"` + Sint32 []int32 `protobuf:"zigzag32,7,rep,packed,name=sint32,proto3" json:"sint32,omitempty"` + Sint64 []int64 `protobuf:"zigzag64,8,rep,packed,name=sint64,proto3" json:"sint64,omitempty"` + Fixed32 []uint32 `protobuf:"fixed32,9,rep,packed,name=fixed32,proto3" json:"fixed32,omitempty"` + Fixed64 []uint64 `protobuf:"fixed64,10,rep,packed,name=fixed64,proto3" json:"fixed64,omitempty"` + Sfixed32 []int32 `protobuf:"fixed32,11,rep,packed,name=sfixed32,proto3" json:"sfixed32,omitempty"` + Sfixed64 []int64 `protobuf:"fixed64,12,rep,packed,name=sfixed64,proto3" json:"sfixed64,omitempty"` + Bool []bool `protobuf:"varint,13,rep,packed,name=bool,proto3" json:"bool,omitempty"` + StringX []string `protobuf:"bytes,14,rep,name=string_x,json=stringX,proto3" json:"string_x,omitempty"` + Bytes [][]byte `protobuf:"bytes,15,rep,name=bytes,proto3" json:"bytes,omitempty"` + Foo []*Foo `protobuf:"bytes,16,rep,name=foo,proto3" json:"foo,omitempty"` + Bar []Bar `protobuf:"varint,17,rep,packed,name=bar,proto3,enum=pb.Bar" json:"bar,omitempty"` +} + +func (x *Repeated) Reset() { + *x = Repeated{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Repeated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Repeated) ProtoMessage() {} + +func (x *Repeated) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Repeated.ProtoReflect.Descriptor instead. +func (*Repeated) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{4} +} + +func (x *Repeated) GetDouble() []float64 { + if x != nil { + return x.Double + } + return nil +} + +func (x *Repeated) GetFloat() []float32 { + if x != nil { + return x.Float + } + return nil +} + +func (x *Repeated) GetInt32() []int32 { + if x != nil { + return x.Int32 + } + return nil +} + +func (x *Repeated) GetInt64() []int64 { + if x != nil { + return x.Int64 + } + return nil +} + +func (x *Repeated) GetUint32() []uint32 { + if x != nil { + return x.Uint32 + } + return nil +} + +func (x *Repeated) GetUint64() []uint64 { + if x != nil { + return x.Uint64 + } + return nil +} + +func (x *Repeated) GetSint32() []int32 { + if x != nil { + return x.Sint32 + } + return nil +} + +func (x *Repeated) GetSint64() []int64 { + if x != nil { + return x.Sint64 + } + return nil +} + +func (x *Repeated) GetFixed32() []uint32 { + if x != nil { + return x.Fixed32 + } + return nil +} + +func (x *Repeated) GetFixed64() []uint64 { + if x != nil { + return x.Fixed64 + } + return nil +} + +func (x *Repeated) GetSfixed32() []int32 { + if x != nil { + return x.Sfixed32 + } + return nil +} + +func (x *Repeated) GetSfixed64() []int64 { + if x != nil { + return x.Sfixed64 + } + return nil +} + +func (x *Repeated) GetBool() []bool { + if x != nil { + return x.Bool + } + return nil +} + +func (x *Repeated) GetStringX() []string { + if x != nil { + return x.StringX + } + return nil +} + +func (x *Repeated) GetBytes() [][]byte { + if x != nil { + return x.Bytes + } + return nil +} + +func (x *Repeated) GetFoo() []*Foo { + if x != nil { + return x.Foo + } + return nil +} + +func (x *Repeated) GetBar() []Bar { + if x != nil { + return x.Bar + } + return nil +} + +type Maps struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Int32Int32 map[int32]int32 `protobuf:"bytes,1,rep,name=int32_int32,json=int32Int32,proto3" json:"int32_int32,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Int64Int64 map[int64]int64 `protobuf:"bytes,2,rep,name=int64_int64,json=int64Int64,proto3" json:"int64_int64,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint32Uint32 map[uint32]uint32 `protobuf:"bytes,3,rep,name=uint32_uint32,json=uint32Uint32,proto3" json:"uint32_uint32,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint64Uint64 map[uint64]uint64 `protobuf:"bytes,4,rep,name=uint64_uint64,json=uint64Uint64,proto3" json:"uint64_uint64,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Sint32Sint32 map[int32]int32 `protobuf:"bytes,5,rep,name=sint32_sint32,json=sint32Sint32,proto3" json:"sint32_sint32,omitempty" protobuf_key:"zigzag32,1,opt,name=key,proto3" protobuf_val:"zigzag32,2,opt,name=value,proto3"` + Sint64Sint64 map[int64]int64 `protobuf:"bytes,6,rep,name=sint64_sint64,json=sint64Sint64,proto3" json:"sint64_sint64,omitempty" protobuf_key:"zigzag64,1,opt,name=key,proto3" protobuf_val:"zigzag64,2,opt,name=value,proto3"` + Fixed32Fixed32 map[uint32]uint32 `protobuf:"bytes,7,rep,name=fixed32_fixed32,json=fixed32Fixed32,proto3" json:"fixed32_fixed32,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Fixed64Fixed64 map[uint64]uint64 `protobuf:"bytes,8,rep,name=fixed64_fixed64,json=fixed64Fixed64,proto3" json:"fixed64_fixed64,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + Sfixed32Sfixed32 map[int32]int32 `protobuf:"bytes,9,rep,name=sfixed32_sfixed32,json=sfixed32Sfixed32,proto3" json:"sfixed32_sfixed32,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Sfixed64Sfixed64 map[int64]int64 `protobuf:"bytes,10,rep,name=sfixed64_sfixed64,json=sfixed64Sfixed64,proto3" json:"sfixed64_sfixed64,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + BoolBool map[bool]bool `protobuf:"bytes,11,rep,name=bool_bool,json=boolBool,proto3" json:"bool_bool,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + StringString map[string]string `protobuf:"bytes,12,rep,name=string_string,json=stringString,proto3" json:"string_string,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBytes map[string][]byte `protobuf:"bytes,15,rep,name=string_bytes,json=stringBytes,proto3" json:"string_bytes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFloat map[string]float32 `protobuf:"bytes,16,rep,name=string_float,json=stringFloat,proto3" json:"string_float,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + StringDouble map[string]float64 `protobuf:"bytes,17,rep,name=string_double,json=stringDouble,proto3" json:"string_double,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + StringFoo map[string]*Foo `protobuf:"bytes,13,rep,name=string_foo,json=stringFoo,proto3" json:"string_foo,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBar map[string]Bar `protobuf:"bytes,14,rep,name=string_bar,json=stringBar,proto3" json:"string_bar,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=pb.Bar"` +} + +func (x *Maps) Reset() { + *x = Maps{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Maps) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Maps) ProtoMessage() {} + +func (x *Maps) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Maps.ProtoReflect.Descriptor instead. +func (*Maps) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{5} +} + +func (x *Maps) GetInt32Int32() map[int32]int32 { + if x != nil { + return x.Int32Int32 + } + return nil +} + +func (x *Maps) GetInt64Int64() map[int64]int64 { + if x != nil { + return x.Int64Int64 + } + return nil +} + +func (x *Maps) GetUint32Uint32() map[uint32]uint32 { + if x != nil { + return x.Uint32Uint32 + } + return nil +} + +func (x *Maps) GetUint64Uint64() map[uint64]uint64 { + if x != nil { + return x.Uint64Uint64 + } + return nil +} + +func (x *Maps) GetSint32Sint32() map[int32]int32 { + if x != nil { + return x.Sint32Sint32 + } + return nil +} + +func (x *Maps) GetSint64Sint64() map[int64]int64 { + if x != nil { + return x.Sint64Sint64 + } + return nil +} + +func (x *Maps) GetFixed32Fixed32() map[uint32]uint32 { + if x != nil { + return x.Fixed32Fixed32 + } + return nil +} + +func (x *Maps) GetFixed64Fixed64() map[uint64]uint64 { + if x != nil { + return x.Fixed64Fixed64 + } + return nil +} + +func (x *Maps) GetSfixed32Sfixed32() map[int32]int32 { + if x != nil { + return x.Sfixed32Sfixed32 + } + return nil +} + +func (x *Maps) GetSfixed64Sfixed64() map[int64]int64 { + if x != nil { + return x.Sfixed64Sfixed64 + } + return nil +} + +func (x *Maps) GetBoolBool() map[bool]bool { + if x != nil { + return x.BoolBool + } + return nil +} + +func (x *Maps) GetStringString() map[string]string { + if x != nil { + return x.StringString + } + return nil +} + +func (x *Maps) GetStringBytes() map[string][]byte { + if x != nil { + return x.StringBytes + } + return nil +} + +func (x *Maps) GetStringFloat() map[string]float32 { + if x != nil { + return x.StringFloat + } + return nil +} + +func (x *Maps) GetStringDouble() map[string]float64 { + if x != nil { + return x.StringDouble + } + return nil +} + +func (x *Maps) GetStringFoo() map[string]*Foo { + if x != nil { + return x.StringFoo + } + return nil +} + +func (x *Maps) GetStringBar() map[string]Bar { + if x != nil { + return x.StringBar + } + return nil +} + +type Any struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Any) Reset() { + *x = Any{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Any) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Any) ProtoMessage() {} + +func (x *Any) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Any.ProtoReflect.Descriptor instead. +func (*Any) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{6} +} + +func (x *Any) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{7} +} + +type EmptyRecursive struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nested1 *empty.Empty `protobuf:"bytes,1,opt,name=nested1,proto3" json:"nested1,omitempty"` + Empty *EmptyRecursive `protobuf:"bytes,2,opt,name=empty,proto3" json:"empty,omitempty"` +} + +func (x *EmptyRecursive) Reset() { + *x = EmptyRecursive{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyRecursive) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyRecursive) ProtoMessage() {} + +func (x *EmptyRecursive) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyRecursive.ProtoReflect.Descriptor instead. +func (*EmptyRecursive) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{8} +} + +func (x *EmptyRecursive) GetNested1() *empty.Empty { + if x != nil { + return x.Nested1 + } + return nil +} + +func (x *EmptyRecursive) GetEmpty() *EmptyRecursive { + if x != nil { + return x.Empty + } + return nil +} + +type EmptyNested struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nested1 *EmptyNested_EmptyNested1 `protobuf:"bytes,1,opt,name=nested1,proto3" json:"nested1,omitempty"` +} + +func (x *EmptyNested) Reset() { + *x = EmptyNested{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyNested) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyNested) ProtoMessage() {} + +func (x *EmptyNested) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyNested.ProtoReflect.Descriptor instead. +func (*EmptyNested) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{9} +} + +func (x *EmptyNested) GetNested1() *EmptyNested_EmptyNested1 { + if x != nil { + return x.Nested1 + } + return nil +} + +type Timestamp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Time string `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` +} + +func (x *Timestamp) Reset() { + *x = Timestamp{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Timestamp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Timestamp) ProtoMessage() {} + +func (x *Timestamp) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Timestamp.ProtoReflect.Descriptor instead. +func (*Timestamp) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{10} +} + +func (x *Timestamp) GetTime() string { + if x != nil { + return x.Time + } + return "" +} + +type Ref struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Empty *empty.Empty `protobuf:"bytes,10,opt,name=empty,proto3" json:"empty,omitempty"` // must disappear as part of is empty validation + LocalTime2 *Timestamp `protobuf:"bytes,12,opt,name=local_time2,json=localTime2,proto3" json:"local_time2,omitempty"` + External *timestamp.Timestamp `protobuf:"bytes,1,opt,name=external,proto3" json:"external,omitempty"` + LocalTime *Timestamp `protobuf:"bytes,11,opt,name=local_time,json=localTime,proto3" json:"local_time,omitempty"` + File *Baz `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"` + FileMsg *Foo `protobuf:"bytes,8,opt,name=file_msg,json=fileMsg,proto3" json:"file_msg,omitempty"` + FileEnum Bar `protobuf:"varint,9,opt,name=file_enum,json=fileEnum,proto3,enum=pb.Bar" json:"file_enum,omitempty"` + Local *Ref_Foo `protobuf:"bytes,3,opt,name=local,proto3" json:"local,omitempty"` + Foreign *Foo_Foo2 `protobuf:"bytes,4,opt,name=foreign,proto3" json:"foreign,omitempty"` + En1 Ref_Foo_En `protobuf:"varint,5,opt,name=en1,proto3,enum=pb.Ref_Foo_En" json:"en1,omitempty"` + En2 Ref_Foo_Bar_En `protobuf:"varint,6,opt,name=en2,proto3,enum=pb.Ref_Foo_Bar_En" json:"en2,omitempty"` + Gz *Ref_Foo_Baz_Gz `protobuf:"bytes,7,opt,name=gz,proto3" json:"gz,omitempty"` +} + +func (x *Ref) Reset() { + *x = Ref{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref) ProtoMessage() {} + +func (x *Ref) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref.ProtoReflect.Descriptor instead. +func (*Ref) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{11} +} + +func (x *Ref) GetEmpty() *empty.Empty { + if x != nil { + return x.Empty + } + return nil +} + +func (x *Ref) GetLocalTime2() *Timestamp { + if x != nil { + return x.LocalTime2 + } + return nil +} + +func (x *Ref) GetExternal() *timestamp.Timestamp { + if x != nil { + return x.External + } + return nil +} + +func (x *Ref) GetLocalTime() *Timestamp { + if x != nil { + return x.LocalTime + } + return nil +} + +func (x *Ref) GetFile() *Baz { + if x != nil { + return x.File + } + return nil +} + +func (x *Ref) GetFileMsg() *Foo { + if x != nil { + return x.FileMsg + } + return nil +} + +func (x *Ref) GetFileEnum() Bar { + if x != nil { + return x.FileEnum + } + return Bar_BAR1 +} + +func (x *Ref) GetLocal() *Ref_Foo { + if x != nil { + return x.Local + } + return nil +} + +func (x *Ref) GetForeign() *Foo_Foo2 { + if x != nil { + return x.Foreign + } + return nil +} + +func (x *Ref) GetEn1() Ref_Foo_En { + if x != nil { + return x.En1 + } + return Ref_Foo_A0 +} + +func (x *Ref) GetEn2() Ref_Foo_Bar_En { + if x != nil { + return x.En2 + } + return Ref_Foo_Bar_A0 +} + +func (x *Ref) GetGz() *Ref_Foo_Baz_Gz { + if x != nil { + return x.Gz + } + return nil +} + +type Oneof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` + // Types that are assignable to Oneof1: + // *Oneof_Param2 + // *Oneof_Param3 + Oneof1 isOneof_Oneof1 `protobuf_oneof:"Oneof1"` + // Types that are assignable to Oneof2: + // *Oneof_Param4 + // *Oneof_Param5 + Oneof2 isOneof_Oneof2 `protobuf_oneof:"Oneof2"` + // Types that are assignable to Oneof3: + // *Oneof_Param6 + Oneof3 isOneof_Oneof3 `protobuf_oneof:"Oneof3"` +} + +func (x *Oneof) Reset() { + *x = Oneof{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Oneof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Oneof) ProtoMessage() {} + +func (x *Oneof) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Oneof.ProtoReflect.Descriptor instead. +func (*Oneof) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{12} +} + +func (x *Oneof) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +func (m *Oneof) GetOneof1() isOneof_Oneof1 { + if m != nil { + return m.Oneof1 + } + return nil +} + +func (x *Oneof) GetParam2() string { + if x, ok := x.GetOneof1().(*Oneof_Param2); ok { + return x.Param2 + } + return "" +} + +func (x *Oneof) GetParam3() string { + if x, ok := x.GetOneof1().(*Oneof_Param3); ok { + return x.Param3 + } + return "" +} + +func (m *Oneof) GetOneof2() isOneof_Oneof2 { + if m != nil { + return m.Oneof2 + } + return nil +} + +func (x *Oneof) GetParam4() string { + if x, ok := x.GetOneof2().(*Oneof_Param4); ok { + return x.Param4 + } + return "" +} + +func (x *Oneof) GetParam5() string { + if x, ok := x.GetOneof2().(*Oneof_Param5); ok { + return x.Param5 + } + return "" +} + +func (m *Oneof) GetOneof3() isOneof_Oneof3 { + if m != nil { + return m.Oneof3 + } + return nil +} + +func (x *Oneof) GetParam6() string { + if x, ok := x.GetOneof3().(*Oneof_Param6); ok { + return x.Param6 + } + return "" +} + +type isOneof_Oneof1 interface { + isOneof_Oneof1() +} + +type Oneof_Param2 struct { + Param2 string `protobuf:"bytes,2,opt,name=param2,proto3,oneof"` +} + +type Oneof_Param3 struct { + Param3 string `protobuf:"bytes,3,opt,name=param3,proto3,oneof"` +} + +func (*Oneof_Param2) isOneof_Oneof1() {} + +func (*Oneof_Param3) isOneof_Oneof1() {} + +type isOneof_Oneof2 interface { + isOneof_Oneof2() +} + +type Oneof_Param4 struct { + Param4 string `protobuf:"bytes,4,opt,name=param4,proto3,oneof"` +} + +type Oneof_Param5 struct { + Param5 string `protobuf:"bytes,5,opt,name=param5,proto3,oneof"` +} + +func (*Oneof_Param4) isOneof_Oneof2() {} + +func (*Oneof_Param5) isOneof_Oneof2() {} + +type isOneof_Oneof3 interface { + isOneof_Oneof3() +} + +type Oneof_Param6 struct { + Param6 string `protobuf:"bytes,6,opt,name=param6,proto3,oneof"` +} + +func (*Oneof_Param6) isOneof_Oneof3() {} + +type Empty3_Int struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + E *Empty3 `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"` +} + +func (x *Empty3_Int) Reset() { + *x = Empty3_Int{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty3_Int) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty3_Int) ProtoMessage() {} + +func (x *Empty3_Int) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty3_Int.ProtoReflect.Descriptor instead. +func (*Empty3_Int) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *Empty3_Int) GetE() *Empty3 { + if x != nil { + return x.E + } + return nil +} + +type Foo_Foo2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Foo_Foo2) Reset() { + *x = Foo_Foo2{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Foo_Foo2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Foo_Foo2) ProtoMessage() {} + +func (x *Foo_Foo2) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Foo_Foo2.ProtoReflect.Descriptor instead. +func (*Foo_Foo2) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *Foo_Foo2) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +type EmptyNested_EmptyNested1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nested2 *EmptyNested_EmptyNested1_EmptyNested2 `protobuf:"bytes,1,opt,name=nested2,proto3" json:"nested2,omitempty"` +} + +func (x *EmptyNested_EmptyNested1) Reset() { + *x = EmptyNested_EmptyNested1{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyNested_EmptyNested1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyNested_EmptyNested1) ProtoMessage() {} + +func (x *EmptyNested_EmptyNested1) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[32] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyNested_EmptyNested1.ProtoReflect.Descriptor instead. +func (*EmptyNested_EmptyNested1) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{9, 0} +} + +func (x *EmptyNested_EmptyNested1) GetNested2() *EmptyNested_EmptyNested1_EmptyNested2 { + if x != nil { + return x.Nested2 + } + return nil +} + +type EmptyNested_EmptyNested1_EmptyNested2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EmptyNested_EmptyNested1_EmptyNested2) Reset() { + *x = EmptyNested_EmptyNested1_EmptyNested2{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyNested_EmptyNested1_EmptyNested2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyNested_EmptyNested1_EmptyNested2) ProtoMessage() {} + +func (x *EmptyNested_EmptyNested1_EmptyNested2) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyNested_EmptyNested1_EmptyNested2.ProtoReflect.Descriptor instead. +func (*EmptyNested_EmptyNested1_EmptyNested2) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{9, 0, 0} +} + +type Ref_Bar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Ref_Bar) Reset() { + *x = Ref_Bar{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Bar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Bar) ProtoMessage() {} + +func (x *Ref_Bar) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Bar.ProtoReflect.Descriptor instead. +func (*Ref_Bar) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{11, 0} +} + +func (x *Ref_Bar) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +type Ref_Foo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bar1 *Ref_Foo_Bar `protobuf:"bytes,1,opt,name=bar1,proto3" json:"bar1,omitempty"` + LocalTime2 *Timestamp `protobuf:"bytes,12,opt,name=local_time2,json=localTime2,proto3" json:"local_time2,omitempty"` + ExternalTime1 *timestamp.Timestamp `protobuf:"bytes,13,opt,name=external_time1,json=externalTime1,proto3" json:"external_time1,omitempty"` + Bar2 *Ref_Bar `protobuf:"bytes,2,opt,name=bar2,proto3" json:"bar2,omitempty"` + En1 Ref_Foo_En `protobuf:"varint,3,opt,name=en1,proto3,enum=pb.Ref_Foo_En" json:"en1,omitempty"` + En2 Ref_Foo_Bar_En `protobuf:"varint,4,opt,name=en2,proto3,enum=pb.Ref_Foo_Bar_En" json:"en2,omitempty"` +} + +func (x *Ref_Foo) Reset() { + *x = Ref_Foo{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Foo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Foo) ProtoMessage() {} + +func (x *Ref_Foo) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Foo.ProtoReflect.Descriptor instead. +func (*Ref_Foo) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{11, 1} +} + +func (x *Ref_Foo) GetBar1() *Ref_Foo_Bar { + if x != nil { + return x.Bar1 + } + return nil +} + +func (x *Ref_Foo) GetLocalTime2() *Timestamp { + if x != nil { + return x.LocalTime2 + } + return nil +} + +func (x *Ref_Foo) GetExternalTime1() *timestamp.Timestamp { + if x != nil { + return x.ExternalTime1 + } + return nil +} + +func (x *Ref_Foo) GetBar2() *Ref_Bar { + if x != nil { + return x.Bar2 + } + return nil +} + +func (x *Ref_Foo) GetEn1() Ref_Foo_En { + if x != nil { + return x.En1 + } + return Ref_Foo_A0 +} + +func (x *Ref_Foo) GetEn2() Ref_Foo_Bar_En { + if x != nil { + return x.En2 + } + return Ref_Foo_Bar_A0 +} + +type Ref_Foo_Baz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Ref_Foo_Baz) Reset() { + *x = Ref_Foo_Baz{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Foo_Baz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Foo_Baz) ProtoMessage() {} + +func (x *Ref_Foo_Baz) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Foo_Baz.ProtoReflect.Descriptor instead. +func (*Ref_Foo_Baz) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{11, 1, 0} +} + +type Ref_Foo_Bar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Ref_Foo_Bar) Reset() { + *x = Ref_Foo_Bar{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Foo_Bar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Foo_Bar) ProtoMessage() {} + +func (x *Ref_Foo_Bar) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Foo_Bar.ProtoReflect.Descriptor instead. +func (*Ref_Foo_Bar) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{11, 1, 1} +} + +func (x *Ref_Foo_Bar) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +type Ref_Foo_Baz_Gz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Ref_Foo_Baz_Gz) Reset() { + *x = Ref_Foo_Baz_Gz{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_constructs_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Foo_Baz_Gz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Foo_Baz_Gz) ProtoMessage() {} + +func (x *Ref_Foo_Baz_Gz) ProtoReflect() protoreflect.Message { + mi := &file_pb_constructs_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Foo_Baz_Gz.ProtoReflect.Descriptor instead. +func (*Ref_Foo_Baz_Gz) Descriptor() ([]byte, []int) { + return file_pb_constructs_proto_rawDescGZIP(), []int{11, 1, 0, 0} +} + +func (x *Ref_Foo_Baz_Gz) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +var File_pb_constructs_proto protoreflect.FileDescriptor + +var file_pb_constructs_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x70, 0x62, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x47, 0x0a, 0x06, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x33, 0x12, 0x1c, 0x0a, 0x01, + 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x33, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x01, 0x69, 0x1a, 0x1f, 0x0a, 0x03, 0x49, 0x6e, + 0x74, 0x12, 0x18, 0x0a, 0x01, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, + 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x33, 0x52, 0x01, 0x65, 0x22, 0x55, 0x0a, 0x03, 0x46, + 0x6f, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x32, 0x1a, 0x1e, 0x0a, 0x04, 0x46, 0x6f, 0x6f, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x31, 0x22, 0x1d, 0x0a, 0x03, 0x42, 0x61, 0x7a, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x31, 0x22, 0xf4, 0x02, 0x0a, 0x07, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x64, + 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, + 0x16, 0x0a, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x06, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x18, 0x07, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x08, 0x20, 0x01, 0x28, 0x12, 0x52, + 0x06, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x33, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x07, 0x52, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, + 0x32, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x06, 0x52, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, 0x1a, 0x0a, 0x08, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x08, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x10, 0x52, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x0d, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x78, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x58, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0xab, 0x03, 0x0a, 0x08, 0x52, 0x65, 0x70, + 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x01, 0x52, 0x06, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x02, 0x52, 0x05, 0x66, 0x6c, + 0x6f, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, + 0x16, 0x0a, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, + 0x06, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x18, 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, + 0x16, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x07, 0x20, 0x03, 0x28, 0x11, 0x52, + 0x06, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x18, 0x08, 0x20, 0x03, 0x28, 0x12, 0x52, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, + 0x18, 0x0a, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x09, 0x20, 0x03, 0x28, 0x07, + 0x52, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x06, 0x52, 0x07, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, + 0x0b, 0x20, 0x03, 0x28, 0x0f, 0x52, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0c, 0x20, 0x03, 0x28, + 0x10, 0x52, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x62, + 0x6f, 0x6f, 0x6c, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x08, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, + 0x19, 0x0a, 0x08, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x78, 0x18, 0x0e, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x58, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x12, 0x19, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, + 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x19, 0x0a, 0x03, 0x62, + 0x61, 0x72, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, + 0x72, 0x52, 0x03, 0x62, 0x61, 0x72, 0x22, 0xaa, 0x11, 0x0a, 0x04, 0x4d, 0x61, 0x70, 0x73, 0x12, + 0x39, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x39, 0x0a, 0x0b, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x5f, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x49, + 0x6e, 0x74, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x3f, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, + 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, + 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x55, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x3f, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x55, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x3f, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x74, + 0x33, 0x32, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x3f, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x5f, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x45, 0x0a, 0x0f, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0e, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, + 0x12, 0x45, 0x0a, 0x0f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x36, 0x34, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, + 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, 0x4b, 0x0a, 0x11, 0x73, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x33, 0x32, 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x10, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x12, 0x4b, 0x0a, 0x11, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, + 0x5f, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x10, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, + 0x34, 0x12, 0x33, 0x0a, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x0b, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x42, + 0x6f, 0x6f, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x62, 0x6f, + 0x6f, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x12, 0x3f, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x3c, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, + 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, + 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, + 0x6f, 0x61, 0x74, 0x12, 0x3f, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, + 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, + 0x6f, 0x6f, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, + 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x6f, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x09, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x6f, 0x12, 0x36, 0x0a, 0x0a, + 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x61, 0x72, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x42, 0x61, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x42, 0x61, 0x72, 0x1a, 0x3d, 0x0a, 0x0f, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x49, 0x6e, 0x74, + 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x3d, 0x0a, 0x0f, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x49, 0x6e, 0x74, 0x36, + 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x55, 0x69, 0x6e, 0x74, + 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x55, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x69, + 0x6e, 0x74, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x11, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, + 0x32, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x46, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x06, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, + 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0f, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x10, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x10, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x42, 0x6f, 0x6f, 0x6c, 0x42, 0x6f, + 0x6f, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, + 0x6f, 0x61, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, + 0x75, 0x62, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x45, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, + 0x6f, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x6f, + 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x45, 0x0a, 0x0e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x1d, 0x0a, 0x03, 0x41, 0x6e, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x31, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x6c, 0x0a, 0x0e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x12, 0x30, 0x0a, + 0x07, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x07, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x31, 0x12, + 0x28, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, + 0x76, 0x65, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x22, 0xaa, 0x01, 0x0a, 0x0b, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x6e, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x31, 0x52, 0x07, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x31, 0x1a, 0x63, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x31, 0x12, 0x43, 0x0a, 0x07, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x32, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x31, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x32, 0x52, 0x07, 0x6e, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x32, 0x1a, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x32, 0x22, 0x1f, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xff, 0x06, 0x0a, 0x03, 0x52, 0x65, 0x66, 0x12, + 0x2c, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2e, 0x0a, + 0x0b, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x32, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x12, 0x36, 0x0a, + 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x2c, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x54, + 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x7a, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, + 0x12, 0x22, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x52, 0x07, 0x66, 0x69, 0x6c, + 0x65, 0x4d, 0x73, 0x67, 0x12, 0x24, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x65, 0x6e, 0x75, + 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x72, + 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x05, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x52, + 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x52, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x26, 0x0a, + 0x07, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, 0x46, 0x6f, 0x6f, 0x32, 0x52, 0x07, 0x66, 0x6f, + 0x72, 0x65, 0x69, 0x67, 0x6e, 0x12, 0x20, 0x0a, 0x03, 0x65, 0x6e, 0x31, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, + 0x45, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x31, 0x12, 0x24, 0x0a, 0x03, 0x65, 0x6e, 0x32, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, + 0x6f, 0x2e, 0x42, 0x61, 0x72, 0x2e, 0x45, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x32, 0x12, 0x22, 0x0a, + 0x02, 0x67, 0x7a, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x52, + 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, 0x42, 0x61, 0x7a, 0x2e, 0x47, 0x7a, 0x52, 0x02, 0x67, + 0x7a, 0x1a, 0x1d, 0x0a, 0x03, 0x42, 0x61, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, + 0x1a, 0xf6, 0x02, 0x0a, 0x03, 0x46, 0x6f, 0x6f, 0x12, 0x23, 0x0a, 0x04, 0x62, 0x61, 0x72, 0x31, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, + 0x46, 0x6f, 0x6f, 0x2e, 0x42, 0x61, 0x72, 0x52, 0x04, 0x62, 0x61, 0x72, 0x31, 0x12, 0x2e, 0x0a, + 0x0b, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x32, 0x18, 0x0c, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x12, 0x41, 0x0a, + 0x0e, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x31, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x31, + 0x12, 0x1f, 0x0a, 0x04, 0x62, 0x61, 0x72, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, + 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x42, 0x61, 0x72, 0x52, 0x04, 0x62, 0x61, 0x72, + 0x32, 0x12, 0x20, 0x0a, 0x03, 0x65, 0x6e, 0x31, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, + 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, 0x45, 0x6e, 0x52, 0x03, + 0x65, 0x6e, 0x31, 0x12, 0x24, 0x0a, 0x03, 0x65, 0x6e, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, 0x42, 0x61, + 0x72, 0x2e, 0x45, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x32, 0x1a, 0x23, 0x0a, 0x03, 0x42, 0x61, 0x7a, + 0x1a, 0x1c, 0x0a, 0x02, 0x47, 0x7a, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x1a, 0x33, + 0x0a, 0x03, 0x42, 0x61, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x22, 0x14, 0x0a, + 0x02, 0x45, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x41, 0x30, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x41, + 0x31, 0x10, 0x01, 0x22, 0x14, 0x0a, 0x02, 0x45, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x41, 0x30, 0x10, + 0x00, 0x12, 0x06, 0x0a, 0x02, 0x41, 0x31, 0x10, 0x01, 0x22, 0xbf, 0x01, 0x0a, 0x05, 0x4f, 0x6e, + 0x65, 0x6f, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x12, 0x18, 0x0a, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x32, 0x12, 0x18, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x33, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x33, 0x12, + 0x18, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x34, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x34, 0x12, 0x18, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x35, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x35, 0x12, 0x18, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x36, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x36, 0x42, 0x08, 0x0a, + 0x06, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x31, 0x42, 0x08, 0x0a, 0x06, 0x4f, 0x6e, 0x65, 0x6f, 0x66, + 0x32, 0x42, 0x08, 0x0a, 0x06, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x33, 0x2a, 0x23, 0x0a, 0x03, 0x42, + 0x61, 0x72, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x41, 0x52, 0x31, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, + 0x42, 0x41, 0x52, 0x32, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x41, 0x52, 0x33, 0x10, 0x02, + 0x32, 0xfd, 0x02, 0x0a, 0x0a, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x73, 0x12, + 0x24, 0x0a, 0x08, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x5f, 0x12, 0x0b, 0x2e, 0x70, 0x62, + 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x63, + 0x61, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x27, 0x0a, 0x09, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x12, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x1a, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1b, + 0x0a, 0x05, 0x4d, 0x61, 0x70, 0x73, 0x5f, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, + 0x73, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x12, 0x25, 0x0a, 0x04, 0x41, + 0x6e, 0x79, 0x5f, 0x12, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x1a, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x41, + 0x6e, 0x79, 0x12, 0x2b, 0x0a, 0x06, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x12, 0x16, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, + 0x2e, 0x0a, 0x07, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x5f, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x1a, 0x0f, + 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, + 0x21, 0x0a, 0x07, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x33, 0x5f, 0x12, 0x0a, 0x2e, 0x70, 0x62, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x33, 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x33, 0x12, 0x18, 0x0a, 0x04, 0x52, 0x65, 0x66, 0x5f, 0x12, 0x07, 0x2e, 0x70, 0x62, 0x2e, + 0x52, 0x65, 0x66, 0x1a, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x12, 0x1e, 0x0a, 0x06, + 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x12, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, + 0x66, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x12, 0x22, 0x0a, 0x0a, + 0x43, 0x61, 0x6c, 0x6c, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x12, 0x09, 0x2e, 0x70, 0x62, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, + 0x61, 0x6e, 0x69, 0x65, 0x6c, 0x76, 0x6c, 0x61, 0x64, 0x63, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x67, 0x71, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, + 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pb_constructs_proto_rawDescOnce sync.Once + file_pb_constructs_proto_rawDescData = file_pb_constructs_proto_rawDesc +) + +func file_pb_constructs_proto_rawDescGZIP() []byte { + file_pb_constructs_proto_rawDescOnce.Do(func() { + file_pb_constructs_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_constructs_proto_rawDescData) + }) + return file_pb_constructs_proto_rawDescData +} + +var file_pb_constructs_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_pb_constructs_proto_msgTypes = make([]protoimpl.MessageInfo, 39) +var file_pb_constructs_proto_goTypes = []interface{}{ + (Bar)(0), // 0: pb.Bar + (Ref_Foo_En)(0), // 1: pb.Ref.Foo.En + (Ref_Foo_Bar_En)(0), // 2: pb.Ref.Foo.Bar.En + (*Empty3)(nil), // 3: pb.Empty3 + (*Foo)(nil), // 4: pb.Foo + (*Baz)(nil), // 5: pb.Baz + (*Scalars)(nil), // 6: pb.Scalars + (*Repeated)(nil), // 7: pb.Repeated + (*Maps)(nil), // 8: pb.Maps + (*Any)(nil), // 9: pb.Any + (*Empty)(nil), // 10: pb.Empty + (*EmptyRecursive)(nil), // 11: pb.EmptyRecursive + (*EmptyNested)(nil), // 12: pb.EmptyNested + (*Timestamp)(nil), // 13: pb.Timestamp + (*Ref)(nil), // 14: pb.Ref + (*Oneof)(nil), // 15: pb.Oneof + (*Empty3_Int)(nil), // 16: pb.Empty3.Int + (*Foo_Foo2)(nil), // 17: pb.Foo.Foo2 + nil, // 18: pb.Maps.Int32Int32Entry + nil, // 19: pb.Maps.Int64Int64Entry + nil, // 20: pb.Maps.Uint32Uint32Entry + nil, // 21: pb.Maps.Uint64Uint64Entry + nil, // 22: pb.Maps.Sint32Sint32Entry + nil, // 23: pb.Maps.Sint64Sint64Entry + nil, // 24: pb.Maps.Fixed32Fixed32Entry + nil, // 25: pb.Maps.Fixed64Fixed64Entry + nil, // 26: pb.Maps.Sfixed32Sfixed32Entry + nil, // 27: pb.Maps.Sfixed64Sfixed64Entry + nil, // 28: pb.Maps.BoolBoolEntry + nil, // 29: pb.Maps.StringStringEntry + nil, // 30: pb.Maps.StringBytesEntry + nil, // 31: pb.Maps.StringFloatEntry + nil, // 32: pb.Maps.StringDoubleEntry + nil, // 33: pb.Maps.StringFooEntry + nil, // 34: pb.Maps.StringBarEntry + (*EmptyNested_EmptyNested1)(nil), // 35: pb.EmptyNested.EmptyNested1 + (*EmptyNested_EmptyNested1_EmptyNested2)(nil), // 36: pb.EmptyNested.EmptyNested1.EmptyNested2 + (*Ref_Bar)(nil), // 37: pb.Ref.Bar + (*Ref_Foo)(nil), // 38: pb.Ref.Foo + (*Ref_Foo_Baz)(nil), // 39: pb.Ref.Foo.Baz + (*Ref_Foo_Bar)(nil), // 40: pb.Ref.Foo.Bar + (*Ref_Foo_Baz_Gz)(nil), // 41: pb.Ref.Foo.Baz.Gz + (*empty.Empty)(nil), // 42: google.protobuf.Empty + (*timestamp.Timestamp)(nil), // 43: google.protobuf.Timestamp + (*any.Any)(nil), // 44: google.protobuf.Any +} +var file_pb_constructs_proto_depIdxs = []int32{ + 16, // 0: pb.Empty3.i:type_name -> pb.Empty3.Int + 4, // 1: pb.Repeated.foo:type_name -> pb.Foo + 0, // 2: pb.Repeated.bar:type_name -> pb.Bar + 18, // 3: pb.Maps.int32_int32:type_name -> pb.Maps.Int32Int32Entry + 19, // 4: pb.Maps.int64_int64:type_name -> pb.Maps.Int64Int64Entry + 20, // 5: pb.Maps.uint32_uint32:type_name -> pb.Maps.Uint32Uint32Entry + 21, // 6: pb.Maps.uint64_uint64:type_name -> pb.Maps.Uint64Uint64Entry + 22, // 7: pb.Maps.sint32_sint32:type_name -> pb.Maps.Sint32Sint32Entry + 23, // 8: pb.Maps.sint64_sint64:type_name -> pb.Maps.Sint64Sint64Entry + 24, // 9: pb.Maps.fixed32_fixed32:type_name -> pb.Maps.Fixed32Fixed32Entry + 25, // 10: pb.Maps.fixed64_fixed64:type_name -> pb.Maps.Fixed64Fixed64Entry + 26, // 11: pb.Maps.sfixed32_sfixed32:type_name -> pb.Maps.Sfixed32Sfixed32Entry + 27, // 12: pb.Maps.sfixed64_sfixed64:type_name -> pb.Maps.Sfixed64Sfixed64Entry + 28, // 13: pb.Maps.bool_bool:type_name -> pb.Maps.BoolBoolEntry + 29, // 14: pb.Maps.string_string:type_name -> pb.Maps.StringStringEntry + 30, // 15: pb.Maps.string_bytes:type_name -> pb.Maps.StringBytesEntry + 31, // 16: pb.Maps.string_float:type_name -> pb.Maps.StringFloatEntry + 32, // 17: pb.Maps.string_double:type_name -> pb.Maps.StringDoubleEntry + 33, // 18: pb.Maps.string_foo:type_name -> pb.Maps.StringFooEntry + 34, // 19: pb.Maps.string_bar:type_name -> pb.Maps.StringBarEntry + 42, // 20: pb.EmptyRecursive.nested1:type_name -> google.protobuf.Empty + 11, // 21: pb.EmptyRecursive.empty:type_name -> pb.EmptyRecursive + 35, // 22: pb.EmptyNested.nested1:type_name -> pb.EmptyNested.EmptyNested1 + 42, // 23: pb.Ref.empty:type_name -> google.protobuf.Empty + 13, // 24: pb.Ref.local_time2:type_name -> pb.Timestamp + 43, // 25: pb.Ref.external:type_name -> google.protobuf.Timestamp + 13, // 26: pb.Ref.local_time:type_name -> pb.Timestamp + 5, // 27: pb.Ref.file:type_name -> pb.Baz + 4, // 28: pb.Ref.file_msg:type_name -> pb.Foo + 0, // 29: pb.Ref.file_enum:type_name -> pb.Bar + 38, // 30: pb.Ref.local:type_name -> pb.Ref.Foo + 17, // 31: pb.Ref.foreign:type_name -> pb.Foo.Foo2 + 1, // 32: pb.Ref.en1:type_name -> pb.Ref.Foo.En + 2, // 33: pb.Ref.en2:type_name -> pb.Ref.Foo.Bar.En + 41, // 34: pb.Ref.gz:type_name -> pb.Ref.Foo.Baz.Gz + 3, // 35: pb.Empty3.Int.e:type_name -> pb.Empty3 + 4, // 36: pb.Maps.StringFooEntry.value:type_name -> pb.Foo + 0, // 37: pb.Maps.StringBarEntry.value:type_name -> pb.Bar + 36, // 38: pb.EmptyNested.EmptyNested1.nested2:type_name -> pb.EmptyNested.EmptyNested1.EmptyNested2 + 40, // 39: pb.Ref.Foo.bar1:type_name -> pb.Ref.Foo.Bar + 13, // 40: pb.Ref.Foo.local_time2:type_name -> pb.Timestamp + 43, // 41: pb.Ref.Foo.external_time1:type_name -> google.protobuf.Timestamp + 37, // 42: pb.Ref.Foo.bar2:type_name -> pb.Ref.Bar + 1, // 43: pb.Ref.Foo.en1:type_name -> pb.Ref.Foo.En + 2, // 44: pb.Ref.Foo.en2:type_name -> pb.Ref.Foo.Bar.En + 6, // 45: pb.Constructs.Scalars_:input_type -> pb.Scalars + 7, // 46: pb.Constructs.Repeated_:input_type -> pb.Repeated + 8, // 47: pb.Constructs.Maps_:input_type -> pb.Maps + 44, // 48: pb.Constructs.Any_:input_type -> google.protobuf.Any + 42, // 49: pb.Constructs.Empty_:input_type -> google.protobuf.Empty + 11, // 50: pb.Constructs.Empty2_:input_type -> pb.EmptyRecursive + 3, // 51: pb.Constructs.Empty3_:input_type -> pb.Empty3 + 14, // 52: pb.Constructs.Ref_:input_type -> pb.Ref + 15, // 53: pb.Constructs.Oneof_:input_type -> pb.Oneof + 10, // 54: pb.Constructs.CallWithId:input_type -> pb.Empty + 6, // 55: pb.Constructs.Scalars_:output_type -> pb.Scalars + 7, // 56: pb.Constructs.Repeated_:output_type -> pb.Repeated + 8, // 57: pb.Constructs.Maps_:output_type -> pb.Maps + 9, // 58: pb.Constructs.Any_:output_type -> pb.Any + 10, // 59: pb.Constructs.Empty_:output_type -> pb.Empty + 12, // 60: pb.Constructs.Empty2_:output_type -> pb.EmptyNested + 3, // 61: pb.Constructs.Empty3_:output_type -> pb.Empty3 + 14, // 62: pb.Constructs.Ref_:output_type -> pb.Ref + 15, // 63: pb.Constructs.Oneof_:output_type -> pb.Oneof + 10, // 64: pb.Constructs.CallWithId:output_type -> pb.Empty + 55, // [55:65] is the sub-list for method output_type + 45, // [45:55] is the sub-list for method input_type + 45, // [45:45] is the sub-list for extension type_name + 45, // [45:45] is the sub-list for extension extendee + 0, // [0:45] is the sub-list for field type_name +} + +func init() { file_pb_constructs_proto_init() } +func file_pb_constructs_proto_init() { + if File_pb_constructs_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pb_constructs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty3); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Foo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Baz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Scalars); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Repeated); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Maps); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Any); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyRecursive); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyNested); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Timestamp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Oneof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty3_Int); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Foo_Foo2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyNested_EmptyNested1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyNested_EmptyNested1_EmptyNested2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Bar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Foo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Foo_Baz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Foo_Bar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_constructs_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Foo_Baz_Gz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_pb_constructs_proto_msgTypes[12].OneofWrappers = []interface{}{ + (*Oneof_Param2)(nil), + (*Oneof_Param3)(nil), + (*Oneof_Param4)(nil), + (*Oneof_Param5)(nil), + (*Oneof_Param6)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pb_constructs_proto_rawDesc, + NumEnums: 3, + NumMessages: 39, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_pb_constructs_proto_goTypes, + DependencyIndexes: file_pb_constructs_proto_depIdxs, + EnumInfos: file_pb_constructs_proto_enumTypes, + MessageInfos: file_pb_constructs_proto_msgTypes, + }.Build() + File_pb_constructs_proto = out.File + file_pb_constructs_proto_rawDesc = nil + file_pb_constructs_proto_goTypes = nil + file_pb_constructs_proto_depIdxs = nil +} diff --git a/example/constructs.proto b/example/codegen/pb/constructs.proto similarity index 97% rename from example/constructs.proto rename to example/codegen/pb/constructs.proto index b9c2cee..160e76f 100644 --- a/example/constructs.proto +++ b/example/codegen/pb/constructs.proto @@ -58,7 +58,7 @@ message Scalars { sfixed32 sfixed32 = 11; sfixed64 sfixed64 = 12; bool bool = 13; - string string = 14; + string string_x = 14; // x for collisions with go method String bytes bytes = 15; } @@ -76,7 +76,7 @@ message Repeated { repeated sfixed32 sfixed32 = 11; repeated sfixed64 sfixed64 = 12; repeated bool bool = 13; - repeated string string = 14; + repeated string string_x = 14; repeated bytes bytes = 15; repeated Foo foo = 16; repeated Bar bar = 17; diff --git a/example/codegen/pb/constructs_grpc.pb.go b/example/codegen/pb/constructs_grpc.pb.go new file mode 100644 index 0000000..6e48b18 --- /dev/null +++ b/example/codegen/pb/constructs_grpc.pb.go @@ -0,0 +1,423 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package pb + +import ( + context "context" + any "github.com/golang/protobuf/ptypes/any" + empty "github.com/golang/protobuf/ptypes/empty" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion7 + +// ConstructsClient is the client API for Constructs service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ConstructsClient interface { + Scalars_(ctx context.Context, in *Scalars, opts ...grpc.CallOption) (*Scalars, error) + Repeated_(ctx context.Context, in *Repeated, opts ...grpc.CallOption) (*Repeated, error) + Maps_(ctx context.Context, in *Maps, opts ...grpc.CallOption) (*Maps, error) + Any_(ctx context.Context, in *any.Any, opts ...grpc.CallOption) (*Any, error) + Empty_(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Empty, error) + Empty2_(ctx context.Context, in *EmptyRecursive, opts ...grpc.CallOption) (*EmptyNested, error) + Empty3_(ctx context.Context, in *Empty3, opts ...grpc.CallOption) (*Empty3, error) + Ref_(ctx context.Context, in *Ref, opts ...grpc.CallOption) (*Ref, error) + Oneof_(ctx context.Context, in *Oneof, opts ...grpc.CallOption) (*Oneof, error) + CallWithId(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) +} + +type constructsClient struct { + cc grpc.ClientConnInterface +} + +func NewConstructsClient(cc grpc.ClientConnInterface) ConstructsClient { + return &constructsClient{cc} +} + +func (c *constructsClient) Scalars_(ctx context.Context, in *Scalars, opts ...grpc.CallOption) (*Scalars, error) { + out := new(Scalars) + err := c.cc.Invoke(ctx, "/pb.Constructs/Scalars_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Repeated_(ctx context.Context, in *Repeated, opts ...grpc.CallOption) (*Repeated, error) { + out := new(Repeated) + err := c.cc.Invoke(ctx, "/pb.Constructs/Repeated_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Maps_(ctx context.Context, in *Maps, opts ...grpc.CallOption) (*Maps, error) { + out := new(Maps) + err := c.cc.Invoke(ctx, "/pb.Constructs/Maps_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Any_(ctx context.Context, in *any.Any, opts ...grpc.CallOption) (*Any, error) { + out := new(Any) + err := c.cc.Invoke(ctx, "/pb.Constructs/Any_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Empty_(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.Constructs/Empty_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Empty2_(ctx context.Context, in *EmptyRecursive, opts ...grpc.CallOption) (*EmptyNested, error) { + out := new(EmptyNested) + err := c.cc.Invoke(ctx, "/pb.Constructs/Empty2_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Empty3_(ctx context.Context, in *Empty3, opts ...grpc.CallOption) (*Empty3, error) { + out := new(Empty3) + err := c.cc.Invoke(ctx, "/pb.Constructs/Empty3_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Ref_(ctx context.Context, in *Ref, opts ...grpc.CallOption) (*Ref, error) { + out := new(Ref) + err := c.cc.Invoke(ctx, "/pb.Constructs/Ref_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Oneof_(ctx context.Context, in *Oneof, opts ...grpc.CallOption) (*Oneof, error) { + out := new(Oneof) + err := c.cc.Invoke(ctx, "/pb.Constructs/Oneof_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) CallWithId(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.Constructs/CallWithId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ConstructsServer is the server API for Constructs service. +// All implementations must embed UnimplementedConstructsServer +// for forward compatibility +type ConstructsServer interface { + Scalars_(context.Context, *Scalars) (*Scalars, error) + Repeated_(context.Context, *Repeated) (*Repeated, error) + Maps_(context.Context, *Maps) (*Maps, error) + Any_(context.Context, *any.Any) (*Any, error) + Empty_(context.Context, *empty.Empty) (*Empty, error) + Empty2_(context.Context, *EmptyRecursive) (*EmptyNested, error) + Empty3_(context.Context, *Empty3) (*Empty3, error) + Ref_(context.Context, *Ref) (*Ref, error) + Oneof_(context.Context, *Oneof) (*Oneof, error) + CallWithId(context.Context, *Empty) (*Empty, error) + mustEmbedUnimplementedConstructsServer() +} + +// UnimplementedConstructsServer must be embedded to have forward compatible implementations. +type UnimplementedConstructsServer struct { +} + +func (UnimplementedConstructsServer) Scalars_(context.Context, *Scalars) (*Scalars, error) { + return nil, status.Errorf(codes.Unimplemented, "method Scalars_ not implemented") +} +func (UnimplementedConstructsServer) Repeated_(context.Context, *Repeated) (*Repeated, error) { + return nil, status.Errorf(codes.Unimplemented, "method Repeated_ not implemented") +} +func (UnimplementedConstructsServer) Maps_(context.Context, *Maps) (*Maps, error) { + return nil, status.Errorf(codes.Unimplemented, "method Maps_ not implemented") +} +func (UnimplementedConstructsServer) Any_(context.Context, *any.Any) (*Any, error) { + return nil, status.Errorf(codes.Unimplemented, "method Any_ not implemented") +} +func (UnimplementedConstructsServer) Empty_(context.Context, *empty.Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Empty_ not implemented") +} +func (UnimplementedConstructsServer) Empty2_(context.Context, *EmptyRecursive) (*EmptyNested, error) { + return nil, status.Errorf(codes.Unimplemented, "method Empty2_ not implemented") +} +func (UnimplementedConstructsServer) Empty3_(context.Context, *Empty3) (*Empty3, error) { + return nil, status.Errorf(codes.Unimplemented, "method Empty3_ not implemented") +} +func (UnimplementedConstructsServer) Ref_(context.Context, *Ref) (*Ref, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ref_ not implemented") +} +func (UnimplementedConstructsServer) Oneof_(context.Context, *Oneof) (*Oneof, error) { + return nil, status.Errorf(codes.Unimplemented, "method Oneof_ not implemented") +} +func (UnimplementedConstructsServer) CallWithId(context.Context, *Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CallWithId not implemented") +} +func (UnimplementedConstructsServer) mustEmbedUnimplementedConstructsServer() {} + +// UnsafeConstructsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ConstructsServer will +// result in compilation errors. +type UnsafeConstructsServer interface { + mustEmbedUnimplementedConstructsServer() +} + +func RegisterConstructsServer(s grpc.ServiceRegistrar, srv ConstructsServer) { + s.RegisterService(&_Constructs_serviceDesc, srv) +} + +func _Constructs_Scalars__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Scalars) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Scalars_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Scalars_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Scalars_(ctx, req.(*Scalars)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Repeated__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Repeated) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Repeated_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Repeated_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Repeated_(ctx, req.(*Repeated)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Maps__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Maps) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Maps_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Maps_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Maps_(ctx, req.(*Maps)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Any__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(any.Any) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Any_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Any_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Any_(ctx, req.(*any.Any)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Empty__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Empty_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Empty_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Empty_(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Empty2__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRecursive) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Empty2_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Empty2_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Empty2_(ctx, req.(*EmptyRecursive)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Empty3__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty3) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Empty3_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Empty3_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Empty3_(ctx, req.(*Empty3)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Ref__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Ref) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Ref_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Ref_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Ref_(ctx, req.(*Ref)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Oneof__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Oneof) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Oneof_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Oneof_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Oneof_(ctx, req.(*Oneof)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_CallWithId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).CallWithId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/CallWithId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).CallWithId(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _Constructs_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.Constructs", + HandlerType: (*ConstructsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Scalars_", + Handler: _Constructs_Scalars__Handler, + }, + { + MethodName: "Repeated_", + Handler: _Constructs_Repeated__Handler, + }, + { + MethodName: "Maps_", + Handler: _Constructs_Maps__Handler, + }, + { + MethodName: "Any_", + Handler: _Constructs_Any__Handler, + }, + { + MethodName: "Empty_", + Handler: _Constructs_Empty__Handler, + }, + { + MethodName: "Empty2_", + Handler: _Constructs_Empty2__Handler, + }, + { + MethodName: "Empty3_", + Handler: _Constructs_Empty3__Handler, + }, + { + MethodName: "Ref_", + Handler: _Constructs_Ref__Handler, + }, + { + MethodName: "Oneof_", + Handler: _Constructs_Oneof__Handler, + }, + { + MethodName: "CallWithId", + Handler: _Constructs_CallWithId_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pb/constructs.proto", +} diff --git a/example/codegen/pb/options.gqlgen.pb.go b/example/codegen/pb/options.gqlgen.pb.go new file mode 100644 index 0000000..f7e14f1 --- /dev/null +++ b/example/codegen/pb/options.gqlgen.pb.go @@ -0,0 +1,32 @@ +package pb + +import ( + context "context" +) + +type ServiceResolvers struct{ Service ServiceServer } + +func (s *ServiceResolvers) ServiceMutate1(ctx context.Context, in *Data) (*Data, error) { + return s.Service.Mutate1(ctx, in) +} +func (s *ServiceResolvers) ServiceMutate2(ctx context.Context, in *Data) (*Data, error) { + return s.Service.Mutate2(ctx, in) +} +func (s *ServiceResolvers) ServiceQuery1(ctx context.Context, in *Data) (*Data, error) { + return s.Service.Query1(ctx, in) +} + +type QueryResolvers struct{ Service QueryServer } + +func (s *QueryResolvers) QueryQuery1(ctx context.Context, in *Data) (*Data, error) { + return s.Service.Query1(ctx, in) +} +func (s *QueryResolvers) QueryQuery2(ctx context.Context, in *Data) (*Data, error) { + return s.Service.Query2(ctx, in) +} +func (s *QueryResolvers) QueryMutate1(ctx context.Context, in *Data) (*Data, error) { + return s.Service.Mutate1(ctx, in) +} + +type DataInput = Data +type Foo2Input = Foo2 diff --git a/example/codegen/pb/options.graphqls b/example/codegen/pb/options.graphqls new file mode 100644 index 0000000..2cc941f --- /dev/null +++ b/example/codegen/pb/options.graphqls @@ -0,0 +1,131 @@ +directive @Query on FIELD_DEFINITION +directive @Service on FIELD_DEFINITION +type Data { + """ + must be required + + """ + stringX: String! + """ + must be required + + """ + foo: Foo2! + """ + must be required because its greater than 0 + + """ + double: [Float!]! + """ + simple + + """ + string2: String + """ + simple + + """ + foo2: Foo2 + """ + simple + + """ + double2: [Float!] +} +input DataInput { + """ + must be required + + """ + stringX: String! + """ + must be required + + """ + foo: Foo2Input! + """ + must be required because its greater than 0 + + """ + double: [Float!]! + """ + simple + + """ + string2: String + """ + simple + + """ + foo2: Foo2Input + """ + simple + + """ + double2: [Float!] +} +type Foo2 { + param1: String +} +input Foo2Input { + param1: String +} +type Mutation { + """ + must be a mutation + + """ + serviceMutate1(in: DataInput): Data @Service + """ + must be a mutation + + """ + serviceMutate2(in: DataInput): Data @Service + """ + must be a mutation + + """ + servicePublish(in: DataInput): Data @Service + """ + must be a mutation and a subscription + + """ + servicePubSub1(in: DataInput): Data @Service + serviceInvalidSubscribe3(in: DataInput): Data @Service + servicePubSub2(in: DataInput): Data @Service + queryMutate1(in: DataInput): Data @Query +} +type Query { + serviceQuery1(in: DataInput): Data @Service + serviceInvalidSubscribe1(in: DataInput): Data @Service + """ + must be a query + + """ + queryQuery1(in: DataInput): Data @Query + """ + must be a query + + """ + queryQuery2(in: DataInput): Data @Query +} +type Subscription { + """ + must be a subscription + + """ + serviceSubscribe(in: DataInput): Data @Service + """ + must be a mutation and a subscription + + """ + servicePubSub1(in: DataInput): Data @Service + serviceInvalidSubscribe2(in: DataInput): Data @Service + serviceInvalidSubscribe3(in: DataInput): Data @Service + servicePubSub2(in: DataInput): Data @Service + """ + must be a subscription + + """ + querySubscribe(in: DataInput): Data @Query +} diff --git a/example/codegen/pb/options.pb.go b/example/codegen/pb/options.pb.go new file mode 100644 index 0000000..0be2c6b --- /dev/null +++ b/example/codegen/pb/options.pb.go @@ -0,0 +1,327 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: pb/options.proto + +package pb + +import ( + _ "github.com/danielvladco/go-proto-gql/pb" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Data struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + StringX string `protobuf:"bytes,1,opt,name=string_x,json=stringX,proto3" json:"string_x,omitempty"` // must be required + Foo *Foo2 `protobuf:"bytes,2,opt,name=foo,proto3" json:"foo,omitempty"` // must be required + Double []float64 `protobuf:"fixed64,3,rep,packed,name=double,proto3" json:"double,omitempty"` // must be required because its greater than 0 + String2 string `protobuf:"bytes,4,opt,name=string2,proto3" json:"string2,omitempty"` // simple + Foo2 *Foo2 `protobuf:"bytes,5,opt,name=foo2,proto3" json:"foo2,omitempty"` // simple + Double2 []float64 `protobuf:"fixed64,6,rep,packed,name=double2,proto3" json:"double2,omitempty"` // simple +} + +func (x *Data) Reset() { + *x = Data{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_options_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Data) ProtoMessage() {} + +func (x *Data) ProtoReflect() protoreflect.Message { + mi := &file_pb_options_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Data.ProtoReflect.Descriptor instead. +func (*Data) Descriptor() ([]byte, []int) { + return file_pb_options_proto_rawDescGZIP(), []int{0} +} + +func (x *Data) GetStringX() string { + if x != nil { + return x.StringX + } + return "" +} + +func (x *Data) GetFoo() *Foo2 { + if x != nil { + return x.Foo + } + return nil +} + +func (x *Data) GetDouble() []float64 { + if x != nil { + return x.Double + } + return nil +} + +func (x *Data) GetString2() string { + if x != nil { + return x.String2 + } + return "" +} + +func (x *Data) GetFoo2() *Foo2 { + if x != nil { + return x.Foo2 + } + return nil +} + +func (x *Data) GetDouble2() []float64 { + if x != nil { + return x.Double2 + } + return nil +} + +type Foo2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Foo2) Reset() { + *x = Foo2{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_options_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Foo2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Foo2) ProtoMessage() {} + +func (x *Foo2) ProtoReflect() protoreflect.Message { + mi := &file_pb_options_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Foo2.ProtoReflect.Descriptor instead. +func (*Foo2) Descriptor() ([]byte, []int) { + return file_pb_options_proto_rawDescGZIP(), []int{1} +} + +func (x *Foo2) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +var File_pb_options_proto protoreflect.FileDescriptor + +var file_pb_options_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x70, 0x62, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x10, 0x70, 0x62, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbf, 0x01, 0x0a, 0x04, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x21, 0x0a, 0x08, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x06, 0xb2, 0xe0, 0x1f, 0x02, 0x08, 0x01, 0x52, 0x07, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x58, 0x12, 0x22, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x32, 0x42, 0x06, 0xb2, 0xe0, 0x1f, + 0x02, 0x08, 0x01, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x1e, 0x0a, 0x06, 0x64, 0x6f, 0x75, 0x62, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x01, 0x42, 0x06, 0xb2, 0xe0, 0x1f, 0x02, 0x08, 0x01, + 0x52, 0x06, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x32, 0x12, 0x1c, 0x0a, 0x04, 0x66, 0x6f, 0x6f, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x32, 0x52, 0x04, 0x66, 0x6f, 0x6f, 0x32, + 0x12, 0x18, 0x0a, 0x07, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x32, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x01, 0x52, 0x07, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x32, 0x22, 0x1e, 0x0a, 0x04, 0x46, 0x6f, + 0x6f, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x32, 0x90, 0x03, 0x0a, 0x07, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x65, + 0x31, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x07, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x65, 0x32, + 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x06, 0x51, 0x75, 0x65, 0x72, 0x79, 0x31, 0x12, 0x08, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x02, 0x12, 0x1f, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, + 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x53, 0x75, 0x62, + 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x30, 0x01, 0x12, 0x21, 0x0a, 0x07, + 0x50, 0x75, 0x62, 0x53, 0x75, 0x62, 0x31, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, + 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x12, + 0x2f, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, + 0x69, 0x62, 0x65, 0x31, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x02, 0x28, 0x01, + 0x12, 0x2f, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x75, 0x62, 0x73, 0x63, + 0x72, 0x69, 0x62, 0x65, 0x32, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, + 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x01, 0x30, + 0x01, 0x12, 0x31, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x53, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x33, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x02, + 0x28, 0x01, 0x30, 0x01, 0x12, 0x27, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x53, 0x75, 0x62, 0x32, 0x12, + 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x00, 0x28, 0x01, 0x30, 0x01, 0x32, 0x91, 0x01, + 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x06, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x31, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x06, 0x51, 0x75, 0x65, 0x72, 0x79, 0x32, 0x12, + 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x07, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x65, 0x31, 0x12, 0x08, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, + 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x30, 0x01, 0x1a, 0x04, 0xb0, 0xe0, 0x1f, + 0x02, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x64, 0x61, 0x6e, 0x69, 0x65, 0x6c, 0x76, 0x6c, 0x61, 0x64, 0x63, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x67, 0x71, 0x6c, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_pb_options_proto_rawDescOnce sync.Once + file_pb_options_proto_rawDescData = file_pb_options_proto_rawDesc +) + +func file_pb_options_proto_rawDescGZIP() []byte { + file_pb_options_proto_rawDescOnce.Do(func() { + file_pb_options_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_options_proto_rawDescData) + }) + return file_pb_options_proto_rawDescData +} + +var file_pb_options_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_pb_options_proto_goTypes = []interface{}{ + (*Data)(nil), // 0: pb.Data + (*Foo2)(nil), // 1: pb.Foo2 +} +var file_pb_options_proto_depIdxs = []int32{ + 1, // 0: pb.Data.foo:type_name -> pb.Foo2 + 1, // 1: pb.Data.foo2:type_name -> pb.Foo2 + 0, // 2: pb.Service.Mutate1:input_type -> pb.Data + 0, // 3: pb.Service.Mutate2:input_type -> pb.Data + 0, // 4: pb.Service.Query1:input_type -> pb.Data + 0, // 5: pb.Service.Publish:input_type -> pb.Data + 0, // 6: pb.Service.Subscribe:input_type -> pb.Data + 0, // 7: pb.Service.PubSub1:input_type -> pb.Data + 0, // 8: pb.Service.InvalidSubscribe1:input_type -> pb.Data + 0, // 9: pb.Service.InvalidSubscribe2:input_type -> pb.Data + 0, // 10: pb.Service.InvalidSubscribe3:input_type -> pb.Data + 0, // 11: pb.Service.PubSub2:input_type -> pb.Data + 0, // 12: pb.Query.Query1:input_type -> pb.Data + 0, // 13: pb.Query.Query2:input_type -> pb.Data + 0, // 14: pb.Query.Mutate1:input_type -> pb.Data + 0, // 15: pb.Query.Subscribe:input_type -> pb.Data + 0, // 16: pb.Service.Mutate1:output_type -> pb.Data + 0, // 17: pb.Service.Mutate2:output_type -> pb.Data + 0, // 18: pb.Service.Query1:output_type -> pb.Data + 0, // 19: pb.Service.Publish:output_type -> pb.Data + 0, // 20: pb.Service.Subscribe:output_type -> pb.Data + 0, // 21: pb.Service.PubSub1:output_type -> pb.Data + 0, // 22: pb.Service.InvalidSubscribe1:output_type -> pb.Data + 0, // 23: pb.Service.InvalidSubscribe2:output_type -> pb.Data + 0, // 24: pb.Service.InvalidSubscribe3:output_type -> pb.Data + 0, // 25: pb.Service.PubSub2:output_type -> pb.Data + 0, // 26: pb.Query.Query1:output_type -> pb.Data + 0, // 27: pb.Query.Query2:output_type -> pb.Data + 0, // 28: pb.Query.Mutate1:output_type -> pb.Data + 0, // 29: pb.Query.Subscribe:output_type -> pb.Data + 16, // [16:30] is the sub-list for method output_type + 2, // [2:16] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_pb_options_proto_init() } +func file_pb_options_proto_init() { + if File_pb_options_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pb_options_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Data); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pb_options_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Foo2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pb_options_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_pb_options_proto_goTypes, + DependencyIndexes: file_pb_options_proto_depIdxs, + MessageInfos: file_pb_options_proto_msgTypes, + }.Build() + File_pb_options_proto = out.File + file_pb_options_proto_rawDesc = nil + file_pb_options_proto_goTypes = nil + file_pb_options_proto_depIdxs = nil +} diff --git a/example/codegen/pb/options.proto b/example/codegen/pb/options.proto new file mode 100644 index 0000000..01d7d3a --- /dev/null +++ b/example/codegen/pb/options.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; +package pb; +option go_package = "github.com/danielvladco/go-proto-gql/example;pb"; + +import "pb/graphql.proto"; + +service Service { + rpc Mutate1 (Data) returns (Data); // must be a mutation + rpc Mutate2 (Data) returns (Data); // must be a mutation + rpc Query1 (Data) returns (Data) { + option (danielvladco.protobuf.graphql.rpc_type) = QUERY; + } // must be a query + + rpc Publish (stream Data) returns (Data); // must be a mutation + rpc Subscribe (Data) returns (stream Data); // must be a subscription + rpc PubSub1 (stream Data) returns (stream Data); // must be a mutation and a subscription + + rpc InvalidSubscribe1 (stream Data) returns (Data) { + option (danielvladco.protobuf.graphql.rpc_type) = QUERY; + }; // must ignore + rpc InvalidSubscribe2 (Data) returns (stream Data) { + option (danielvladco.protobuf.graphql.rpc_type) = MUTATION; + }; // must ignore + rpc InvalidSubscribe3 (stream Data) returns (stream Data) { + option (danielvladco.protobuf.graphql.rpc_type) = QUERY; + }; // must ignore + rpc PubSub2 (stream Data) returns (stream Data) { + option (danielvladco.protobuf.graphql.rpc_type) = DEFAULT; + }; // must ignore +} + +service Query { + option (danielvladco.protobuf.graphql.svc_type) = QUERY; + rpc Query1 (Data) returns (Data); // must be a query + rpc Query2 (Data) returns (Data); // must be a query + rpc Mutate1 (Data) returns (Data) { + option (danielvladco.protobuf.graphql.rpc_type) = MUTATION; + } // must be a mutation + rpc Subscribe (Data) returns (stream Data); // must be a subscription +} + +message Data { + string string_x = 1 [(danielvladco.protobuf.graphql.field) = {required: true}]; // must be required + Foo2 foo = 2 [(danielvladco.protobuf.graphql.field) = {required: true}]; // must be required + repeated double double = 3 [(danielvladco.protobuf.graphql.field) = {required: true}]; // must be required because its greater than 0 + string string2 = 4; // simple + Foo2 foo2 = 5; // simple + repeated double double2 = 6; // simple +} + +message Foo2 { + string param1 = 1; +} diff --git a/example/options.pb.go b/example/codegen/pb/options_grpc.pb.go similarity index 71% rename from example/options.pb.go rename to example/codegen/pb/options_grpc.pb.go index ada514c..4b9cfd9 100644 --- a/example/options.pb.go +++ b/example/codegen/pb/options_grpc.pb.go @@ -1,196 +1,21 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: example/options.proto +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. package pb import ( context "context" - fmt "fmt" - _ "github.com/danielvladco/go-proto-gql/pb" - proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - math "math" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Data struct { - String_ string `protobuf:"bytes,1,opt,name=string,proto3" json:"string,omitempty"` - Foo *Foo2 `protobuf:"bytes,2,opt,name=foo,proto3" json:"foo,omitempty"` - Float []float32 `protobuf:"fixed32,3,rep,packed,name=float,proto3" json:"float,omitempty"` - String2 string `protobuf:"bytes,4,opt,name=string2,proto3" json:"string2,omitempty"` - Foo2 *Foo2 `protobuf:"bytes,5,opt,name=foo2,proto3" json:"foo2,omitempty"` - Float2 []float32 `protobuf:"fixed32,6,rep,packed,name=float2,proto3" json:"float2,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Data) Reset() { *m = Data{} } -func (m *Data) String() string { return proto.CompactTextString(m) } -func (*Data) ProtoMessage() {} -func (*Data) Descriptor() ([]byte, []int) { - return fileDescriptor_5b83075c052b6d50, []int{0} -} - -func (m *Data) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Data.Unmarshal(m, b) -} -func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Data.Marshal(b, m, deterministic) -} -func (m *Data) XXX_Merge(src proto.Message) { - xxx_messageInfo_Data.Merge(m, src) -} -func (m *Data) XXX_Size() int { - return xxx_messageInfo_Data.Size(m) -} -func (m *Data) XXX_DiscardUnknown() { - xxx_messageInfo_Data.DiscardUnknown(m) -} - -var xxx_messageInfo_Data proto.InternalMessageInfo - -func (m *Data) GetString_() string { - if m != nil { - return m.String_ - } - return "" -} - -func (m *Data) GetFoo() *Foo2 { - if m != nil { - return m.Foo - } - return nil -} - -func (m *Data) GetFloat() []float32 { - if m != nil { - return m.Float - } - return nil -} - -func (m *Data) GetString2() string { - if m != nil { - return m.String2 - } - return "" -} - -func (m *Data) GetFoo2() *Foo2 { - if m != nil { - return m.Foo2 - } - return nil -} - -func (m *Data) GetFloat2() []float32 { - if m != nil { - return m.Float2 - } - return nil -} - -type Foo2 struct { - Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Foo2) Reset() { *m = Foo2{} } -func (m *Foo2) String() string { return proto.CompactTextString(m) } -func (*Foo2) ProtoMessage() {} -func (*Foo2) Descriptor() ([]byte, []int) { - return fileDescriptor_5b83075c052b6d50, []int{1} -} - -func (m *Foo2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Foo2.Unmarshal(m, b) -} -func (m *Foo2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Foo2.Marshal(b, m, deterministic) -} -func (m *Foo2) XXX_Merge(src proto.Message) { - xxx_messageInfo_Foo2.Merge(m, src) -} -func (m *Foo2) XXX_Size() int { - return xxx_messageInfo_Foo2.Size(m) -} -func (m *Foo2) XXX_DiscardUnknown() { - xxx_messageInfo_Foo2.DiscardUnknown(m) -} - -var xxx_messageInfo_Foo2 proto.InternalMessageInfo - -func (m *Foo2) GetParam1() string { - if m != nil { - return m.Param1 - } - return "" -} - -func init() { - proto.RegisterType((*Data)(nil), "pb.Data") - proto.RegisterType((*Foo2)(nil), "pb.Foo2") -} - -func init() { proto.RegisterFile("example/options.proto", fileDescriptor_5b83075c052b6d50) } - -var fileDescriptor_5b83075c052b6d50 = []byte{ - // 402 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcd, 0x8e, 0xd3, 0x30, - 0x10, 0xc6, 0x69, 0x9a, 0xec, 0x0e, 0x5c, 0xb0, 0x04, 0x8a, 0xaa, 0xb2, 0x2d, 0xe1, 0x40, 0x2e, - 0x9b, 0x34, 0xde, 0x23, 0xb7, 0x15, 0x5a, 0x89, 0x03, 0x12, 0xa4, 0x37, 0x6e, 0x76, 0xea, 0x66, - 0x2d, 0xb9, 0xb1, 0x37, 0x71, 0x2a, 0x78, 0x0b, 0x78, 0x13, 0xc4, 0x89, 0xc7, 0xd9, 0x47, 0x41, - 0x4e, 0xb2, 0x41, 0x88, 0x34, 0xda, 0x9b, 0xe7, 0xfb, 0xbe, 0xf9, 0xe6, 0xc7, 0x1a, 0x78, 0xc1, - 0xbf, 0xd2, 0x83, 0x96, 0x3c, 0x51, 0xda, 0x08, 0x55, 0xd6, 0xb1, 0xae, 0x94, 0x51, 0xd8, 0xd1, - 0x6c, 0xf1, 0x4c, 0xb3, 0xa4, 0xb8, 0x93, 0x1d, 0x12, 0xfe, 0x46, 0xe0, 0xbe, 0xa7, 0x86, 0xe2, - 0x0b, 0xf0, 0x6a, 0x53, 0x89, 0xb2, 0x08, 0xd0, 0x1a, 0x45, 0xe7, 0xd7, 0xde, 0xaf, 0xfb, 0x95, - 0x73, 0x86, 0xb2, 0x1e, 0xc5, 0x21, 0xcc, 0xf6, 0x4a, 0x05, 0xce, 0x1a, 0x45, 0x4f, 0xc9, 0x59, - 0xac, 0x59, 0x7c, 0xa3, 0x14, 0x19, 0x64, 0x96, 0xc4, 0x4b, 0x98, 0xef, 0xa5, 0xa2, 0x26, 0x98, - 0xad, 0x67, 0x91, 0x33, 0x70, 0x1d, 0x88, 0x03, 0xf0, 0x3b, 0x2f, 0x12, 0xb8, 0xb6, 0x44, 0xf6, - 0x10, 0xe2, 0x25, 0xb8, 0x7b, 0xa5, 0x48, 0x30, 0xff, 0xd7, 0x3c, 0x6b, 0x51, 0xfc, 0x12, 0xbc, - 0xd6, 0x80, 0x04, 0x9e, 0xb5, 0xcd, 0xfa, 0x28, 0xbc, 0x00, 0xf7, 0xa6, 0xe7, 0x35, 0xad, 0xe8, - 0x21, 0xed, 0x3a, 0xcf, 0xfa, 0x88, 0x7c, 0x9f, 0x81, 0xbf, 0xe5, 0xd5, 0x51, 0xe4, 0x1c, 0xbf, - 0x02, 0xff, 0x63, 0x63, 0xa8, 0xe1, 0x29, 0x6e, 0xed, 0xed, 0xc8, 0x8b, 0xe1, 0xf5, 0x97, 0x26, - 0xa3, 0x74, 0x08, 0xde, 0xe7, 0x86, 0x57, 0xdf, 0x46, 0x93, 0x43, 0xf7, 0xe7, 0xfd, 0xca, 0xc1, - 0x2b, 0xf0, 0x3f, 0x35, 0x4c, 0x8a, 0xfa, 0x76, 0x4c, 0x14, 0x21, 0xfc, 0x1a, 0xce, 0xb7, 0x0d, - 0xab, 0xf3, 0x4a, 0x30, 0x3e, 0x26, 0xd9, 0x58, 0x89, 0xf5, 0xd8, 0x36, 0x2c, 0x1d, 0xf7, 0xd8, - 0x20, 0x9c, 0xc0, 0xf3, 0x0f, 0xe5, 0x91, 0x4a, 0xb1, 0x1b, 0xcc, 0x26, 0xba, 0x8a, 0x46, 0x13, - 0xc8, 0xc9, 0x04, 0x5b, 0x21, 0xfd, 0x3f, 0xe1, 0x6a, 0xaa, 0xc2, 0x06, 0xe1, 0xb7, 0x0f, 0x7d, - 0x9f, 0x76, 0x7e, 0x62, 0x85, 0xe4, 0x07, 0x82, 0x79, 0xbb, 0x49, 0xbc, 0x9c, 0x5a, 0xe9, 0xc0, - 0x8e, 0x7f, 0xc7, 0x9b, 0xc9, 0xcf, 0xec, 0x06, 0x79, 0xc4, 0xba, 0x17, 0xed, 0x00, 0xd7, 0xe9, - 0x97, 0xa4, 0x10, 0xe6, 0xb6, 0x61, 0x71, 0xae, 0x0e, 0xc9, 0x8e, 0x96, 0x82, 0xcb, 0xa3, 0xa4, - 0xbb, 0x5c, 0x25, 0x85, 0xba, 0x6c, 0xaf, 0xe4, 0xb2, 0xb8, 0x93, 0x49, 0x7f, 0x51, 0xef, 0x34, - 0x63, 0x5e, 0x8b, 0x5e, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xda, 0x91, 0xe2, 0x3e, 0x66, 0x03, - 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 +const _ = grpc.SupportPackageIsVersion7 // ServiceClient is the client API for Service service. // -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ServiceClient interface { Mutate1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) Mutate2(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) @@ -205,10 +30,10 @@ type ServiceClient interface { } type serviceClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewServiceClient(cc *grpc.ClientConn) ServiceClient { +func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { return &serviceClient{cc} } @@ -465,6 +290,8 @@ func (x *servicePubSub2Client) Recv() (*Data, error) { } // ServiceServer is the server API for Service service. +// All implementations must embed UnimplementedServiceServer +// for forward compatibility type ServiceServer interface { Mutate1(context.Context, *Data) (*Data, error) Mutate2(context.Context, *Data) (*Data, error) @@ -476,44 +303,53 @@ type ServiceServer interface { InvalidSubscribe2(*Data, Service_InvalidSubscribe2Server) error InvalidSubscribe3(Service_InvalidSubscribe3Server) error PubSub2(Service_PubSub2Server) error + mustEmbedUnimplementedServiceServer() } -// UnimplementedServiceServer can be embedded to have forward compatible implementations. +// UnimplementedServiceServer must be embedded to have forward compatible implementations. type UnimplementedServiceServer struct { } -func (*UnimplementedServiceServer) Mutate1(ctx context.Context, req *Data) (*Data, error) { +func (UnimplementedServiceServer) Mutate1(context.Context, *Data) (*Data, error) { return nil, status.Errorf(codes.Unimplemented, "method Mutate1 not implemented") } -func (*UnimplementedServiceServer) Mutate2(ctx context.Context, req *Data) (*Data, error) { +func (UnimplementedServiceServer) Mutate2(context.Context, *Data) (*Data, error) { return nil, status.Errorf(codes.Unimplemented, "method Mutate2 not implemented") } -func (*UnimplementedServiceServer) Query1(ctx context.Context, req *Data) (*Data, error) { +func (UnimplementedServiceServer) Query1(context.Context, *Data) (*Data, error) { return nil, status.Errorf(codes.Unimplemented, "method Query1 not implemented") } -func (*UnimplementedServiceServer) Publish(srv Service_PublishServer) error { +func (UnimplementedServiceServer) Publish(Service_PublishServer) error { return status.Errorf(codes.Unimplemented, "method Publish not implemented") } -func (*UnimplementedServiceServer) Subscribe(req *Data, srv Service_SubscribeServer) error { +func (UnimplementedServiceServer) Subscribe(*Data, Service_SubscribeServer) error { return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") } -func (*UnimplementedServiceServer) PubSub1(srv Service_PubSub1Server) error { +func (UnimplementedServiceServer) PubSub1(Service_PubSub1Server) error { return status.Errorf(codes.Unimplemented, "method PubSub1 not implemented") } -func (*UnimplementedServiceServer) InvalidSubscribe1(srv Service_InvalidSubscribe1Server) error { +func (UnimplementedServiceServer) InvalidSubscribe1(Service_InvalidSubscribe1Server) error { return status.Errorf(codes.Unimplemented, "method InvalidSubscribe1 not implemented") } -func (*UnimplementedServiceServer) InvalidSubscribe2(req *Data, srv Service_InvalidSubscribe2Server) error { +func (UnimplementedServiceServer) InvalidSubscribe2(*Data, Service_InvalidSubscribe2Server) error { return status.Errorf(codes.Unimplemented, "method InvalidSubscribe2 not implemented") } -func (*UnimplementedServiceServer) InvalidSubscribe3(srv Service_InvalidSubscribe3Server) error { +func (UnimplementedServiceServer) InvalidSubscribe3(Service_InvalidSubscribe3Server) error { return status.Errorf(codes.Unimplemented, "method InvalidSubscribe3 not implemented") } -func (*UnimplementedServiceServer) PubSub2(srv Service_PubSub2Server) error { +func (UnimplementedServiceServer) PubSub2(Service_PubSub2Server) error { return status.Errorf(codes.Unimplemented, "method PubSub2 not implemented") } +func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} -func RegisterServiceServer(s *grpc.Server, srv ServiceServer) { +// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceServer will +// result in compilation errors. +type UnsafeServiceServer interface { + mustEmbedUnimplementedServiceServer() +} + +func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { s.RegisterService(&_Service_serviceDesc, srv) } @@ -800,12 +636,12 @@ var _Service_serviceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "example/options.proto", + Metadata: "pb/options.proto", } // QueryClient is the client API for Query service. // -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type QueryClient interface { Query1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) Query2(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) @@ -814,10 +650,10 @@ type QueryClient interface { } type queryClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewQueryClient(cc *grpc.ClientConn) QueryClient { +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { return &queryClient{cc} } @@ -881,31 +717,42 @@ func (x *querySubscribeClient) Recv() (*Data, error) { } // QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility type QueryServer interface { Query1(context.Context, *Data) (*Data, error) Query2(context.Context, *Data) (*Data, error) Mutate1(context.Context, *Data) (*Data, error) Subscribe(*Data, Query_SubscribeServer) error + mustEmbedUnimplementedQueryServer() } -// UnimplementedQueryServer can be embedded to have forward compatible implementations. +// UnimplementedQueryServer must be embedded to have forward compatible implementations. type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Query1(ctx context.Context, req *Data) (*Data, error) { +func (UnimplementedQueryServer) Query1(context.Context, *Data) (*Data, error) { return nil, status.Errorf(codes.Unimplemented, "method Query1 not implemented") } -func (*UnimplementedQueryServer) Query2(ctx context.Context, req *Data) (*Data, error) { +func (UnimplementedQueryServer) Query2(context.Context, *Data) (*Data, error) { return nil, status.Errorf(codes.Unimplemented, "method Query2 not implemented") } -func (*UnimplementedQueryServer) Mutate1(ctx context.Context, req *Data) (*Data, error) { +func (UnimplementedQueryServer) Mutate1(context.Context, *Data) (*Data, error) { return nil, status.Errorf(codes.Unimplemented, "method Mutate1 not implemented") } -func (*UnimplementedQueryServer) Subscribe(req *Data, srv Query_SubscribeServer) error { +func (UnimplementedQueryServer) Subscribe(*Data, Query_SubscribeServer) error { return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") } +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} -func RegisterQueryServer(s *grpc.Server, srv QueryServer) { +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } @@ -1008,5 +855,5 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServerStreams: true, }, }, - Metadata: "example/options.proto", + Metadata: "pb/options.proto", } diff --git a/example/constructs.gqlgen.pb.go b/example/constructs.gqlgen.pb.go deleted file mode 100644 index 3d26062..0000000 --- a/example/constructs.gqlgen.pb.go +++ /dev/null @@ -1,484 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: example/constructs.proto - -package pb - -import ( - context "context" - encoding_json "encoding/json" - fmt "fmt" - github_com_danielvladco_go_proto_gql_pb "github.com/danielvladco/go-proto-gql/pb" - proto "github.com/golang/protobuf/proto" - _ "github.com/golang/protobuf/ptypes/any" - github_com_golang_protobuf_ptypes_any "github.com/golang/protobuf/ptypes/any" - _ "github.com/golang/protobuf/ptypes/empty" - github_com_golang_protobuf_ptypes_empty "github.com/golang/protobuf/ptypes/empty" - _ "github.com/golang/protobuf/ptypes/timestamp" - io "io" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type ConstructsGQLServer struct{ Service ConstructsServer } - -func (s *ConstructsGQLServer) ConstructsScalars(ctx context.Context, in *Scalars) (*Scalars, error) { - return s.Service.Scalars_(ctx, in) -} -func (s *ConstructsGQLServer) ConstructsRepeated(ctx context.Context, in *Repeated) (*Repeated, error) { - return s.Service.Repeated_(ctx, in) -} -func (s *ConstructsGQLServer) ConstructsMaps(ctx context.Context, in *Maps) (*Maps, error) { - return s.Service.Maps_(ctx, in) -} -func (s *ConstructsGQLServer) ConstructsAny(ctx context.Context, in *github_com_golang_protobuf_ptypes_any.Any) (*Any, error) { - return s.Service.Any_(ctx, in) -} -func (s *ConstructsGQLServer) ConstructsEmpty(ctx context.Context) (*bool, error) { - _, err := s.Service.Empty_(ctx, &github_com_golang_protobuf_ptypes_empty.Empty{}) - return nil, err -} -func (s *ConstructsGQLServer) ConstructsEmpty2(ctx context.Context) (*bool, error) { - _, err := s.Service.Empty2_(ctx, &EmptyRecursive{}) - return nil, err -} -func (s *ConstructsGQLServer) ConstructsEmpty3(ctx context.Context) (*bool, error) { - _, err := s.Service.Empty3_(ctx, &Empty3{}) - return nil, err -} -func (s *ConstructsGQLServer) ConstructsRef(ctx context.Context, in *Ref) (*Ref, error) { - return s.Service.Ref_(ctx, in) -} -func (s *ConstructsGQLServer) ConstructsOneof(ctx context.Context, in *Oneof) (*Oneof, error) { - return s.Service.Oneof_(ctx, in) -} -func (s *ConstructsGQLServer) ConstructsCallWithID(ctx context.Context) (*bool, error) { - _, err := s.Service.CallWithId(ctx, &Empty{}) - return nil, err -} - -func MarshalMaps_Int32Int32Entry(mp map[int32]int32) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Int32Int32Entry(v interface{}) (mp map[int32]int32, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[int32]int32", v) - } -} - -func MarshalMaps_Int64Int64Entry(mp map[int64]int64) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Int64Int64Entry(v interface{}) (mp map[int64]int64, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[int64]int64", v) - } -} - -func MarshalMaps_Uint32Uint32Entry(mp map[uint32]uint32) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Uint32Uint32Entry(v interface{}) (mp map[uint32]uint32, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[uint32]uint32", v) - } -} - -func MarshalMaps_Uint64Uint64Entry(mp map[uint64]uint64) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Uint64Uint64Entry(v interface{}) (mp map[uint64]uint64, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[uint64]uint64", v) - } -} - -func MarshalMaps_Sint32Sint32Entry(mp map[int32]int32) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Sint32Sint32Entry(v interface{}) (mp map[int32]int32, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[int32]int32", v) - } -} - -func MarshalMaps_Sint64Sint64Entry(mp map[int64]int64) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Sint64Sint64Entry(v interface{}) (mp map[int64]int64, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[int64]int64", v) - } -} - -func MarshalMaps_Fixed32Fixed32Entry(mp map[uint32]uint32) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Fixed32Fixed32Entry(v interface{}) (mp map[uint32]uint32, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[uint32]uint32", v) - } -} - -func MarshalMaps_Fixed64Fixed64Entry(mp map[uint64]uint64) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Fixed64Fixed64Entry(v interface{}) (mp map[uint64]uint64, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[uint64]uint64", v) - } -} - -func MarshalMaps_Sfixed32Sfixed32Entry(mp map[int32]int32) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Sfixed32Sfixed32Entry(v interface{}) (mp map[int32]int32, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[int32]int32", v) - } -} - -func MarshalMaps_Sfixed64Sfixed64Entry(mp map[int64]int64) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_Sfixed64Sfixed64Entry(v interface{}) (mp map[int64]int64, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[int64]int64", v) - } -} - -func MarshalMaps_BoolBoolEntry(mp map[bool]bool) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_BoolBoolEntry(v interface{}) (mp map[bool]bool, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[bool]bool", v) - } -} - -func MarshalMaps_StringStringEntry(mp map[string]string) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_StringStringEntry(v interface{}) (mp map[string]string, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[string]string", v) - } -} - -func MarshalMaps_StringBytesEntry(mp map[string][]byte) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_StringBytesEntry(v interface{}) (mp map[string][]byte, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[string][]byte", v) - } -} - -func MarshalMaps_StringFloatEntry(mp map[string]float32) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_StringFloatEntry(v interface{}) (mp map[string]float32, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[string]float32", v) - } -} - -func MarshalMaps_StringDoubleEntry(mp map[string]float64) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_StringDoubleEntry(v interface{}) (mp map[string]float64, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[string]float64", v) - } -} - -func MarshalMaps_StringFooEntry(mp map[string]*Foo) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_StringFooEntry(v interface{}) (mp map[string]*Foo, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[string]*Foo", v) - } -} - -func MarshalMaps_StringBarEntry(mp map[string]Bar) github_com_danielvladco_go_proto_gql_pb.Marshaler { - return github_com_danielvladco_go_proto_gql_pb.WriterFunc(func(w io.Writer) { - err := encoding_json.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func UnmarshalMaps_StringBarEntry(v interface{}) (mp map[string]Bar, err error) { - switch vv := v.(type) { - case []byte: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - case encoding_json.RawMessage: - err = encoding_json.Unmarshal(vv, &mp) - return mp, err - default: - return nil, fmt.Errorf("%T is not map[string]Bar", v) - } -} - -type IsOneof_Oneof1 interface { - isOneof_Oneof1() -} -type IsOneof_Oneof2 interface { - isOneof_Oneof2() -} -type IsOneof_Oneof3 interface { - isOneof_Oneof3() -} - -func (c *Bar) UnmarshalGQL(v interface{}) error { - code, ok := v.(string) - if ok { - *c = Bar(Bar_value[code]) - return nil - } - return fmt.Errorf("cannot unmarshal Bar enum") -} - -func (c Bar) MarshalGQL(w io.Writer) { - fmt.Fprintf(w, "%q", c.String()) -} - -func (c *Ref_Foo_En) UnmarshalGQL(v interface{}) error { - code, ok := v.(string) - if ok { - *c = Ref_Foo_En(Ref_Foo_En_value[code]) - return nil - } - return fmt.Errorf("cannot unmarshal Ref_Foo_En enum") -} - -func (c Ref_Foo_En) MarshalGQL(w io.Writer) { - fmt.Fprintf(w, "%q", c.String()) -} - -func (c *Ref_Foo_Bar_En) UnmarshalGQL(v interface{}) error { - code, ok := v.(string) - if ok { - *c = Ref_Foo_Bar_En(Ref_Foo_Bar_En_value[code]) - return nil - } - return fmt.Errorf("cannot unmarshal Ref_Foo_Bar_En enum") -} - -func (c Ref_Foo_Bar_En) MarshalGQL(w io.Writer) { - fmt.Fprintf(w, "%q", c.String()) -} diff --git a/example/constructs.gqlgen.pb.yml b/example/constructs.gqlgen.pb.yml deleted file mode 100644 index b8fa80a..0000000 --- a/example/constructs.gqlgen.pb.yml +++ /dev/null @@ -1,199 +0,0 @@ -schema: -- constructs.pb.graphqls -exec: - filename: exec.go -model: - filename: models.go -models: - Any: - model: - - github.com/danielvladco/go-proto-gql/pb.Any - Bar: - model: - - github.com/danielvladco/go-proto-gql/example.Bar - Baz: - model: - - github.com/danielvladco/go-proto-gql/example.Baz - BazInput: - model: - - github.com/danielvladco/go-proto-gql/example.Baz - Bytes: - model: - - github.com/danielvladco/go-proto-gql/pb.Bytes - Float32: - model: - - github.com/danielvladco/go-proto-gql/pb.Float32 - Foo: - model: - - github.com/danielvladco/go-proto-gql/example.Foo - Foo_Foo2: - model: - - github.com/danielvladco/go-proto-gql/example.Foo_Foo2 - Foo_Foo2Input: - model: - - github.com/danielvladco/go-proto-gql/example.Foo_Foo2 - FooInput: - model: - - github.com/danielvladco/go-proto-gql/example.Foo - Int32: - model: - - github.com/danielvladco/go-proto-gql/pb.Int32 - Int64: - model: - - github.com/danielvladco/go-proto-gql/pb.Int64 - IsOneof_Oneof1: - model: - - github.com/danielvladco/go-proto-gql/example.IsOneof_Oneof1 - IsOneof_Oneof2: - model: - - github.com/danielvladco/go-proto-gql/example.IsOneof_Oneof2 - IsOneof_Oneof3: - model: - - github.com/danielvladco/go-proto-gql/example.IsOneof_Oneof3 - Maps: - model: - - github.com/danielvladco/go-proto-gql/example.Maps - Maps_BoolBoolEntry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_BoolBoolEntry - Maps_Fixed32Fixed32Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Fixed32Fixed32Entry - Maps_Fixed64Fixed64Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Fixed64Fixed64Entry - Maps_Int32Int32Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Int32Int32Entry - Maps_Int64Int64Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Int64Int64Entry - Maps_Sfixed32Sfixed32Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Sfixed32Sfixed32Entry - Maps_Sfixed64Sfixed64Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Sfixed64Sfixed64Entry - Maps_Sint32Sint32Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Sint32Sint32Entry - Maps_Sint64Sint64Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Sint64Sint64Entry - Maps_StringBarEntry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_StringBarEntry - Maps_StringBytesEntry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_StringBytesEntry - Maps_StringDoubleEntry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_StringDoubleEntry - Maps_StringFloatEntry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_StringFloatEntry - Maps_StringFooEntry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_StringFooEntry - Maps_StringStringEntry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_StringStringEntry - Maps_Uint32Uint32Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Uint32Uint32Entry - Maps_Uint64Uint64Entry: - model: - - github.com/danielvladco/go-proto-gql/example.Maps_Uint64Uint64Entry - MapsInput: - model: - - github.com/danielvladco/go-proto-gql/example.Maps - Oneof: - model: - - github.com/danielvladco/go-proto-gql/example.Oneof - Oneof_Param2: - model: - - github.com/danielvladco/go-proto-gql/example.Oneof_Param2 - Oneof_Param3: - model: - - github.com/danielvladco/go-proto-gql/example.Oneof_Param3 - Oneof_Param4: - model: - - github.com/danielvladco/go-proto-gql/example.Oneof_Param4 - Oneof_Param5: - model: - - github.com/danielvladco/go-proto-gql/example.Oneof_Param5 - Oneof_Param6: - model: - - github.com/danielvladco/go-proto-gql/example.Oneof_Param6 - OneofInput: - model: - - github.com/danielvladco/go-proto-gql/example.Oneof - Ref: - model: - - github.com/danielvladco/go-proto-gql/example.Ref - Ref_Bar: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Bar - Ref_BarInput: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Bar - Ref_Foo: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Foo - Ref_Foo_Bar: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Foo_Bar - Ref_Foo_Bar_En: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Foo_Bar_En - Ref_Foo_BarInput: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Foo_Bar - Ref_Foo_Baz_Gz: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Foo_Baz_Gz - Ref_Foo_Baz_GzInput: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Foo_Baz_Gz - Ref_Foo_En: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Foo_En - Ref_FooInput: - model: - - github.com/danielvladco/go-proto-gql/example.Ref_Foo - RefInput: - model: - - github.com/danielvladco/go-proto-gql/example.Ref - Repeated: - model: - - github.com/danielvladco/go-proto-gql/example.Repeated - RepeatedInput: - model: - - github.com/danielvladco/go-proto-gql/example.Repeated - Scalars: - model: - - github.com/danielvladco/go-proto-gql/example.Scalars - ScalarsInput: - model: - - github.com/danielvladco/go-proto-gql/example.Scalars - Uint32: - model: - - github.com/danielvladco/go-proto-gql/pb.Uint32 - Uint64: - model: - - github.com/danielvladco/go-proto-gql/pb.Uint64 - google_protobuf_Timestamp: - model: - - github.com/golang/protobuf/ptypes/timestamp.Timestamp - google_protobuf_TimestampInput: - model: - - github.com/golang/protobuf/ptypes/timestamp.Timestamp - pb_Any: - model: - - github.com/danielvladco/go-proto-gql/example.Any - pb_Timestamp: - model: - - github.com/danielvladco/go-proto-gql/example.Timestamp - pb_TimestampInput: - model: - - github.com/danielvladco/go-proto-gql/example.Timestamp diff --git a/example/constructs.pb.go b/example/constructs.pb.go deleted file mode 100644 index 408c560..0000000 --- a/example/constructs.pb.go +++ /dev/null @@ -1,2136 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: example/constructs.proto - -package pb - -import ( - context "context" - fmt "fmt" - proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" - empty "github.com/golang/protobuf/ptypes/empty" - timestamp "github.com/golang/protobuf/ptypes/timestamp" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type Bar int32 - -const ( - Bar_BAR1 Bar = 0 - Bar_BAR2 Bar = 1 - Bar_BAR3 Bar = 2 -) - -var Bar_name = map[int32]string{ - 0: "BAR1", - 1: "BAR2", - 2: "BAR3", -} - -var Bar_value = map[string]int32{ - "BAR1": 0, - "BAR2": 1, - "BAR3": 2, -} - -func (x Bar) String() string { - return proto.EnumName(Bar_name, int32(x)) -} - -func (Bar) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{0} -} - -type Ref_Foo_En int32 - -const ( - Ref_Foo_A0 Ref_Foo_En = 0 - Ref_Foo_A1 Ref_Foo_En = 1 -) - -var Ref_Foo_En_name = map[int32]string{ - 0: "A0", - 1: "A1", -} - -var Ref_Foo_En_value = map[string]int32{ - "A0": 0, - "A1": 1, -} - -func (x Ref_Foo_En) String() string { - return proto.EnumName(Ref_Foo_En_name, int32(x)) -} - -func (Ref_Foo_En) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{11, 1, 0} -} - -type Ref_Foo_Bar_En int32 - -const ( - Ref_Foo_Bar_A0 Ref_Foo_Bar_En = 0 - Ref_Foo_Bar_A1 Ref_Foo_Bar_En = 1 -) - -var Ref_Foo_Bar_En_name = map[int32]string{ - 0: "A0", - 1: "A1", -} - -var Ref_Foo_Bar_En_value = map[string]int32{ - "A0": 0, - "A1": 1, -} - -func (x Ref_Foo_Bar_En) String() string { - return proto.EnumName(Ref_Foo_Bar_En_name, int32(x)) -} - -func (Ref_Foo_Bar_En) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{11, 1, 1, 0} -} - -type Empty3 struct { - I *Empty3_Int `protobuf:"bytes,1,opt,name=i,proto3" json:"i,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Empty3) Reset() { *m = Empty3{} } -func (m *Empty3) String() string { return proto.CompactTextString(m) } -func (*Empty3) ProtoMessage() {} -func (*Empty3) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{0} -} - -func (m *Empty3) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Empty3.Unmarshal(m, b) -} -func (m *Empty3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Empty3.Marshal(b, m, deterministic) -} -func (m *Empty3) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty3.Merge(m, src) -} -func (m *Empty3) XXX_Size() int { - return xxx_messageInfo_Empty3.Size(m) -} -func (m *Empty3) XXX_DiscardUnknown() { - xxx_messageInfo_Empty3.DiscardUnknown(m) -} - -var xxx_messageInfo_Empty3 proto.InternalMessageInfo - -func (m *Empty3) GetI() *Empty3_Int { - if m != nil { - return m.I - } - return nil -} - -type Empty3_Int struct { - E *Empty3 `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Empty3_Int) Reset() { *m = Empty3_Int{} } -func (m *Empty3_Int) String() string { return proto.CompactTextString(m) } -func (*Empty3_Int) ProtoMessage() {} -func (*Empty3_Int) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{0, 0} -} - -func (m *Empty3_Int) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Empty3_Int.Unmarshal(m, b) -} -func (m *Empty3_Int) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Empty3_Int.Marshal(b, m, deterministic) -} -func (m *Empty3_Int) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty3_Int.Merge(m, src) -} -func (m *Empty3_Int) XXX_Size() int { - return xxx_messageInfo_Empty3_Int.Size(m) -} -func (m *Empty3_Int) XXX_DiscardUnknown() { - xxx_messageInfo_Empty3_Int.DiscardUnknown(m) -} - -var xxx_messageInfo_Empty3_Int proto.InternalMessageInfo - -func (m *Empty3_Int) GetE() *Empty3 { - if m != nil { - return m.E - } - return nil -} - -type Foo struct { - Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` - Param2 string `protobuf:"bytes,2,opt,name=param2,proto3" json:"param2,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Foo) Reset() { *m = Foo{} } -func (m *Foo) String() string { return proto.CompactTextString(m) } -func (*Foo) ProtoMessage() {} -func (*Foo) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{1} -} - -func (m *Foo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Foo.Unmarshal(m, b) -} -func (m *Foo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Foo.Marshal(b, m, deterministic) -} -func (m *Foo) XXX_Merge(src proto.Message) { - xxx_messageInfo_Foo.Merge(m, src) -} -func (m *Foo) XXX_Size() int { - return xxx_messageInfo_Foo.Size(m) -} -func (m *Foo) XXX_DiscardUnknown() { - xxx_messageInfo_Foo.DiscardUnknown(m) -} - -var xxx_messageInfo_Foo proto.InternalMessageInfo - -func (m *Foo) GetParam1() string { - if m != nil { - return m.Param1 - } - return "" -} - -func (m *Foo) GetParam2() string { - if m != nil { - return m.Param2 - } - return "" -} - -type Foo_Foo2 struct { - Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Foo_Foo2) Reset() { *m = Foo_Foo2{} } -func (m *Foo_Foo2) String() string { return proto.CompactTextString(m) } -func (*Foo_Foo2) ProtoMessage() {} -func (*Foo_Foo2) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{1, 0} -} - -func (m *Foo_Foo2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Foo_Foo2.Unmarshal(m, b) -} -func (m *Foo_Foo2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Foo_Foo2.Marshal(b, m, deterministic) -} -func (m *Foo_Foo2) XXX_Merge(src proto.Message) { - xxx_messageInfo_Foo_Foo2.Merge(m, src) -} -func (m *Foo_Foo2) XXX_Size() int { - return xxx_messageInfo_Foo_Foo2.Size(m) -} -func (m *Foo_Foo2) XXX_DiscardUnknown() { - xxx_messageInfo_Foo_Foo2.DiscardUnknown(m) -} - -var xxx_messageInfo_Foo_Foo2 proto.InternalMessageInfo - -func (m *Foo_Foo2) GetParam1() string { - if m != nil { - return m.Param1 - } - return "" -} - -type Baz struct { - Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Baz) Reset() { *m = Baz{} } -func (m *Baz) String() string { return proto.CompactTextString(m) } -func (*Baz) ProtoMessage() {} -func (*Baz) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{2} -} - -func (m *Baz) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Baz.Unmarshal(m, b) -} -func (m *Baz) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Baz.Marshal(b, m, deterministic) -} -func (m *Baz) XXX_Merge(src proto.Message) { - xxx_messageInfo_Baz.Merge(m, src) -} -func (m *Baz) XXX_Size() int { - return xxx_messageInfo_Baz.Size(m) -} -func (m *Baz) XXX_DiscardUnknown() { - xxx_messageInfo_Baz.DiscardUnknown(m) -} - -var xxx_messageInfo_Baz proto.InternalMessageInfo - -func (m *Baz) GetParam1() string { - if m != nil { - return m.Param1 - } - return "" -} - -type Scalars struct { - Double float64 `protobuf:"fixed64,1,opt,name=double,proto3" json:"double,omitempty"` - Float float32 `protobuf:"fixed32,2,opt,name=float,proto3" json:"float,omitempty"` - Int32 int32 `protobuf:"varint,3,opt,name=int32,proto3" json:"int32,omitempty"` - Int64 int64 `protobuf:"varint,4,opt,name=int64,proto3" json:"int64,omitempty"` - Uint32 uint32 `protobuf:"varint,5,opt,name=uint32,proto3" json:"uint32,omitempty"` - Uint64 uint64 `protobuf:"varint,6,opt,name=uint64,proto3" json:"uint64,omitempty"` - Sint32 int32 `protobuf:"zigzag32,7,opt,name=sint32,proto3" json:"sint32,omitempty"` - Sint64 int64 `protobuf:"zigzag64,8,opt,name=sint64,proto3" json:"sint64,omitempty"` - Fixed32 uint32 `protobuf:"fixed32,9,opt,name=fixed32,proto3" json:"fixed32,omitempty"` - Fixed64 uint64 `protobuf:"fixed64,10,opt,name=fixed64,proto3" json:"fixed64,omitempty"` - Sfixed32 int32 `protobuf:"fixed32,11,opt,name=sfixed32,proto3" json:"sfixed32,omitempty"` - Sfixed64 int64 `protobuf:"fixed64,12,opt,name=sfixed64,proto3" json:"sfixed64,omitempty"` - Bool bool `protobuf:"varint,13,opt,name=bool,proto3" json:"bool,omitempty"` - String_ string `protobuf:"bytes,14,opt,name=string,proto3" json:"string,omitempty"` - Bytes []byte `protobuf:"bytes,15,opt,name=bytes,proto3" json:"bytes,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Scalars) Reset() { *m = Scalars{} } -func (m *Scalars) String() string { return proto.CompactTextString(m) } -func (*Scalars) ProtoMessage() {} -func (*Scalars) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{3} -} - -func (m *Scalars) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Scalars.Unmarshal(m, b) -} -func (m *Scalars) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Scalars.Marshal(b, m, deterministic) -} -func (m *Scalars) XXX_Merge(src proto.Message) { - xxx_messageInfo_Scalars.Merge(m, src) -} -func (m *Scalars) XXX_Size() int { - return xxx_messageInfo_Scalars.Size(m) -} -func (m *Scalars) XXX_DiscardUnknown() { - xxx_messageInfo_Scalars.DiscardUnknown(m) -} - -var xxx_messageInfo_Scalars proto.InternalMessageInfo - -func (m *Scalars) GetDouble() float64 { - if m != nil { - return m.Double - } - return 0 -} - -func (m *Scalars) GetFloat() float32 { - if m != nil { - return m.Float - } - return 0 -} - -func (m *Scalars) GetInt32() int32 { - if m != nil { - return m.Int32 - } - return 0 -} - -func (m *Scalars) GetInt64() int64 { - if m != nil { - return m.Int64 - } - return 0 -} - -func (m *Scalars) GetUint32() uint32 { - if m != nil { - return m.Uint32 - } - return 0 -} - -func (m *Scalars) GetUint64() uint64 { - if m != nil { - return m.Uint64 - } - return 0 -} - -func (m *Scalars) GetSint32() int32 { - if m != nil { - return m.Sint32 - } - return 0 -} - -func (m *Scalars) GetSint64() int64 { - if m != nil { - return m.Sint64 - } - return 0 -} - -func (m *Scalars) GetFixed32() uint32 { - if m != nil { - return m.Fixed32 - } - return 0 -} - -func (m *Scalars) GetFixed64() uint64 { - if m != nil { - return m.Fixed64 - } - return 0 -} - -func (m *Scalars) GetSfixed32() int32 { - if m != nil { - return m.Sfixed32 - } - return 0 -} - -func (m *Scalars) GetSfixed64() int64 { - if m != nil { - return m.Sfixed64 - } - return 0 -} - -func (m *Scalars) GetBool() bool { - if m != nil { - return m.Bool - } - return false -} - -func (m *Scalars) GetString_() string { - if m != nil { - return m.String_ - } - return "" -} - -func (m *Scalars) GetBytes() []byte { - if m != nil { - return m.Bytes - } - return nil -} - -type Repeated struct { - Double []float64 `protobuf:"fixed64,1,rep,packed,name=double,proto3" json:"double,omitempty"` - Float []float32 `protobuf:"fixed32,2,rep,packed,name=float,proto3" json:"float,omitempty"` - Int32 []int32 `protobuf:"varint,3,rep,packed,name=int32,proto3" json:"int32,omitempty"` - Int64 []int64 `protobuf:"varint,4,rep,packed,name=int64,proto3" json:"int64,omitempty"` - Uint32 []uint32 `protobuf:"varint,5,rep,packed,name=uint32,proto3" json:"uint32,omitempty"` - Uint64 []uint64 `protobuf:"varint,6,rep,packed,name=uint64,proto3" json:"uint64,omitempty"` - Sint32 []int32 `protobuf:"zigzag32,7,rep,packed,name=sint32,proto3" json:"sint32,omitempty"` - Sint64 []int64 `protobuf:"zigzag64,8,rep,packed,name=sint64,proto3" json:"sint64,omitempty"` - Fixed32 []uint32 `protobuf:"fixed32,9,rep,packed,name=fixed32,proto3" json:"fixed32,omitempty"` - Fixed64 []uint64 `protobuf:"fixed64,10,rep,packed,name=fixed64,proto3" json:"fixed64,omitempty"` - Sfixed32 []int32 `protobuf:"fixed32,11,rep,packed,name=sfixed32,proto3" json:"sfixed32,omitempty"` - Sfixed64 []int64 `protobuf:"fixed64,12,rep,packed,name=sfixed64,proto3" json:"sfixed64,omitempty"` - Bool []bool `protobuf:"varint,13,rep,packed,name=bool,proto3" json:"bool,omitempty"` - String_ []string `protobuf:"bytes,14,rep,name=string,proto3" json:"string,omitempty"` - Bytes [][]byte `protobuf:"bytes,15,rep,name=bytes,proto3" json:"bytes,omitempty"` - Foo []*Foo `protobuf:"bytes,16,rep,name=foo,proto3" json:"foo,omitempty"` - Bar []Bar `protobuf:"varint,17,rep,packed,name=bar,proto3,enum=pb.Bar" json:"bar,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Repeated) Reset() { *m = Repeated{} } -func (m *Repeated) String() string { return proto.CompactTextString(m) } -func (*Repeated) ProtoMessage() {} -func (*Repeated) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{4} -} - -func (m *Repeated) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Repeated.Unmarshal(m, b) -} -func (m *Repeated) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Repeated.Marshal(b, m, deterministic) -} -func (m *Repeated) XXX_Merge(src proto.Message) { - xxx_messageInfo_Repeated.Merge(m, src) -} -func (m *Repeated) XXX_Size() int { - return xxx_messageInfo_Repeated.Size(m) -} -func (m *Repeated) XXX_DiscardUnknown() { - xxx_messageInfo_Repeated.DiscardUnknown(m) -} - -var xxx_messageInfo_Repeated proto.InternalMessageInfo - -func (m *Repeated) GetDouble() []float64 { - if m != nil { - return m.Double - } - return nil -} - -func (m *Repeated) GetFloat() []float32 { - if m != nil { - return m.Float - } - return nil -} - -func (m *Repeated) GetInt32() []int32 { - if m != nil { - return m.Int32 - } - return nil -} - -func (m *Repeated) GetInt64() []int64 { - if m != nil { - return m.Int64 - } - return nil -} - -func (m *Repeated) GetUint32() []uint32 { - if m != nil { - return m.Uint32 - } - return nil -} - -func (m *Repeated) GetUint64() []uint64 { - if m != nil { - return m.Uint64 - } - return nil -} - -func (m *Repeated) GetSint32() []int32 { - if m != nil { - return m.Sint32 - } - return nil -} - -func (m *Repeated) GetSint64() []int64 { - if m != nil { - return m.Sint64 - } - return nil -} - -func (m *Repeated) GetFixed32() []uint32 { - if m != nil { - return m.Fixed32 - } - return nil -} - -func (m *Repeated) GetFixed64() []uint64 { - if m != nil { - return m.Fixed64 - } - return nil -} - -func (m *Repeated) GetSfixed32() []int32 { - if m != nil { - return m.Sfixed32 - } - return nil -} - -func (m *Repeated) GetSfixed64() []int64 { - if m != nil { - return m.Sfixed64 - } - return nil -} - -func (m *Repeated) GetBool() []bool { - if m != nil { - return m.Bool - } - return nil -} - -func (m *Repeated) GetString_() []string { - if m != nil { - return m.String_ - } - return nil -} - -func (m *Repeated) GetBytes() [][]byte { - if m != nil { - return m.Bytes - } - return nil -} - -func (m *Repeated) GetFoo() []*Foo { - if m != nil { - return m.Foo - } - return nil -} - -func (m *Repeated) GetBar() []Bar { - if m != nil { - return m.Bar - } - return nil -} - -type Maps struct { - Int32Int32 map[int32]int32 `protobuf:"bytes,1,rep,name=int32_int32,json=int32Int32,proto3" json:"int32_int32,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Int64Int64 map[int64]int64 `protobuf:"bytes,2,rep,name=int64_int64,json=int64Int64,proto3" json:"int64_int64,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Uint32Uint32 map[uint32]uint32 `protobuf:"bytes,3,rep,name=uint32_uint32,json=uint32Uint32,proto3" json:"uint32_uint32,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Uint64Uint64 map[uint64]uint64 `protobuf:"bytes,4,rep,name=uint64_uint64,json=uint64Uint64,proto3" json:"uint64_uint64,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Sint32Sint32 map[int32]int32 `protobuf:"bytes,5,rep,name=sint32_sint32,json=sint32Sint32,proto3" json:"sint32_sint32,omitempty" protobuf_key:"zigzag32,1,opt,name=key,proto3" protobuf_val:"zigzag32,2,opt,name=value,proto3"` - Sint64Sint64 map[int64]int64 `protobuf:"bytes,6,rep,name=sint64_sint64,json=sint64Sint64,proto3" json:"sint64_sint64,omitempty" protobuf_key:"zigzag64,1,opt,name=key,proto3" protobuf_val:"zigzag64,2,opt,name=value,proto3"` - Fixed32Fixed32 map[uint32]uint32 `protobuf:"bytes,7,rep,name=fixed32_fixed32,json=fixed32Fixed32,proto3" json:"fixed32_fixed32,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` - Fixed64Fixed64 map[uint64]uint64 `protobuf:"bytes,8,rep,name=fixed64_fixed64,json=fixed64Fixed64,proto3" json:"fixed64_fixed64,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - Sfixed32Sfixed32 map[int32]int32 `protobuf:"bytes,9,rep,name=sfixed32_sfixed32,json=sfixed32Sfixed32,proto3" json:"sfixed32_sfixed32,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` - Sfixed64Sfixed64 map[int64]int64 `protobuf:"bytes,10,rep,name=sfixed64_sfixed64,json=sfixed64Sfixed64,proto3" json:"sfixed64_sfixed64,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - BoolBool map[bool]bool `protobuf:"bytes,11,rep,name=bool_bool,json=boolBool,proto3" json:"bool_bool,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - StringString map[string]string `protobuf:"bytes,12,rep,name=string_string,json=stringString,proto3" json:"string_string,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBytes map[string][]byte `protobuf:"bytes,15,rep,name=string_bytes,json=stringBytes,proto3" json:"string_bytes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringFloat map[string]float32 `protobuf:"bytes,16,rep,name=string_float,json=stringFloat,proto3" json:"string_float,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` - StringDouble map[string]float64 `protobuf:"bytes,17,rep,name=string_double,json=stringDouble,proto3" json:"string_double,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - StringFoo map[string]*Foo `protobuf:"bytes,13,rep,name=string_foo,json=stringFoo,proto3" json:"string_foo,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBar map[string]Bar `protobuf:"bytes,14,rep,name=string_bar,json=stringBar,proto3" json:"string_bar,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=pb.Bar"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Maps) Reset() { *m = Maps{} } -func (m *Maps) String() string { return proto.CompactTextString(m) } -func (*Maps) ProtoMessage() {} -func (*Maps) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{5} -} - -func (m *Maps) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Maps.Unmarshal(m, b) -} -func (m *Maps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Maps.Marshal(b, m, deterministic) -} -func (m *Maps) XXX_Merge(src proto.Message) { - xxx_messageInfo_Maps.Merge(m, src) -} -func (m *Maps) XXX_Size() int { - return xxx_messageInfo_Maps.Size(m) -} -func (m *Maps) XXX_DiscardUnknown() { - xxx_messageInfo_Maps.DiscardUnknown(m) -} - -var xxx_messageInfo_Maps proto.InternalMessageInfo - -func (m *Maps) GetInt32Int32() map[int32]int32 { - if m != nil { - return m.Int32Int32 - } - return nil -} - -func (m *Maps) GetInt64Int64() map[int64]int64 { - if m != nil { - return m.Int64Int64 - } - return nil -} - -func (m *Maps) GetUint32Uint32() map[uint32]uint32 { - if m != nil { - return m.Uint32Uint32 - } - return nil -} - -func (m *Maps) GetUint64Uint64() map[uint64]uint64 { - if m != nil { - return m.Uint64Uint64 - } - return nil -} - -func (m *Maps) GetSint32Sint32() map[int32]int32 { - if m != nil { - return m.Sint32Sint32 - } - return nil -} - -func (m *Maps) GetSint64Sint64() map[int64]int64 { - if m != nil { - return m.Sint64Sint64 - } - return nil -} - -func (m *Maps) GetFixed32Fixed32() map[uint32]uint32 { - if m != nil { - return m.Fixed32Fixed32 - } - return nil -} - -func (m *Maps) GetFixed64Fixed64() map[uint64]uint64 { - if m != nil { - return m.Fixed64Fixed64 - } - return nil -} - -func (m *Maps) GetSfixed32Sfixed32() map[int32]int32 { - if m != nil { - return m.Sfixed32Sfixed32 - } - return nil -} - -func (m *Maps) GetSfixed64Sfixed64() map[int64]int64 { - if m != nil { - return m.Sfixed64Sfixed64 - } - return nil -} - -func (m *Maps) GetBoolBool() map[bool]bool { - if m != nil { - return m.BoolBool - } - return nil -} - -func (m *Maps) GetStringString() map[string]string { - if m != nil { - return m.StringString - } - return nil -} - -func (m *Maps) GetStringBytes() map[string][]byte { - if m != nil { - return m.StringBytes - } - return nil -} - -func (m *Maps) GetStringFloat() map[string]float32 { - if m != nil { - return m.StringFloat - } - return nil -} - -func (m *Maps) GetStringDouble() map[string]float64 { - if m != nil { - return m.StringDouble - } - return nil -} - -func (m *Maps) GetStringFoo() map[string]*Foo { - if m != nil { - return m.StringFoo - } - return nil -} - -func (m *Maps) GetStringBar() map[string]Bar { - if m != nil { - return m.StringBar - } - return nil -} - -type Any struct { - Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Any) Reset() { *m = Any{} } -func (m *Any) String() string { return proto.CompactTextString(m) } -func (*Any) ProtoMessage() {} -func (*Any) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{6} -} - -func (m *Any) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Any.Unmarshal(m, b) -} -func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Any.Marshal(b, m, deterministic) -} -func (m *Any) XXX_Merge(src proto.Message) { - xxx_messageInfo_Any.Merge(m, src) -} -func (m *Any) XXX_Size() int { - return xxx_messageInfo_Any.Size(m) -} -func (m *Any) XXX_DiscardUnknown() { - xxx_messageInfo_Any.DiscardUnknown(m) -} - -var xxx_messageInfo_Any proto.InternalMessageInfo - -func (m *Any) GetParam1() string { - if m != nil { - return m.Param1 - } - return "" -} - -type Empty struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Empty) Reset() { *m = Empty{} } -func (m *Empty) String() string { return proto.CompactTextString(m) } -func (*Empty) ProtoMessage() {} -func (*Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{7} -} - -func (m *Empty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Empty.Unmarshal(m, b) -} -func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Empty.Marshal(b, m, deterministic) -} -func (m *Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_Empty.Merge(m, src) -} -func (m *Empty) XXX_Size() int { - return xxx_messageInfo_Empty.Size(m) -} -func (m *Empty) XXX_DiscardUnknown() { - xxx_messageInfo_Empty.DiscardUnknown(m) -} - -var xxx_messageInfo_Empty proto.InternalMessageInfo - -type EmptyRecursive struct { - Nested1 *empty.Empty `protobuf:"bytes,1,opt,name=nested1,proto3" json:"nested1,omitempty"` - Empty *EmptyRecursive `protobuf:"bytes,2,opt,name=empty,proto3" json:"empty,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EmptyRecursive) Reset() { *m = EmptyRecursive{} } -func (m *EmptyRecursive) String() string { return proto.CompactTextString(m) } -func (*EmptyRecursive) ProtoMessage() {} -func (*EmptyRecursive) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{8} -} - -func (m *EmptyRecursive) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EmptyRecursive.Unmarshal(m, b) -} -func (m *EmptyRecursive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EmptyRecursive.Marshal(b, m, deterministic) -} -func (m *EmptyRecursive) XXX_Merge(src proto.Message) { - xxx_messageInfo_EmptyRecursive.Merge(m, src) -} -func (m *EmptyRecursive) XXX_Size() int { - return xxx_messageInfo_EmptyRecursive.Size(m) -} -func (m *EmptyRecursive) XXX_DiscardUnknown() { - xxx_messageInfo_EmptyRecursive.DiscardUnknown(m) -} - -var xxx_messageInfo_EmptyRecursive proto.InternalMessageInfo - -func (m *EmptyRecursive) GetNested1() *empty.Empty { - if m != nil { - return m.Nested1 - } - return nil -} - -func (m *EmptyRecursive) GetEmpty() *EmptyRecursive { - if m != nil { - return m.Empty - } - return nil -} - -type EmptyNested struct { - Nested1 *EmptyNested_EmptyNested1 `protobuf:"bytes,1,opt,name=nested1,proto3" json:"nested1,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EmptyNested) Reset() { *m = EmptyNested{} } -func (m *EmptyNested) String() string { return proto.CompactTextString(m) } -func (*EmptyNested) ProtoMessage() {} -func (*EmptyNested) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{9} -} - -func (m *EmptyNested) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EmptyNested.Unmarshal(m, b) -} -func (m *EmptyNested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EmptyNested.Marshal(b, m, deterministic) -} -func (m *EmptyNested) XXX_Merge(src proto.Message) { - xxx_messageInfo_EmptyNested.Merge(m, src) -} -func (m *EmptyNested) XXX_Size() int { - return xxx_messageInfo_EmptyNested.Size(m) -} -func (m *EmptyNested) XXX_DiscardUnknown() { - xxx_messageInfo_EmptyNested.DiscardUnknown(m) -} - -var xxx_messageInfo_EmptyNested proto.InternalMessageInfo - -func (m *EmptyNested) GetNested1() *EmptyNested_EmptyNested1 { - if m != nil { - return m.Nested1 - } - return nil -} - -type EmptyNested_EmptyNested1 struct { - Nested2 *EmptyNested_EmptyNested1_EmptyNested2 `protobuf:"bytes,1,opt,name=nested2,proto3" json:"nested2,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EmptyNested_EmptyNested1) Reset() { *m = EmptyNested_EmptyNested1{} } -func (m *EmptyNested_EmptyNested1) String() string { return proto.CompactTextString(m) } -func (*EmptyNested_EmptyNested1) ProtoMessage() {} -func (*EmptyNested_EmptyNested1) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{9, 0} -} - -func (m *EmptyNested_EmptyNested1) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EmptyNested_EmptyNested1.Unmarshal(m, b) -} -func (m *EmptyNested_EmptyNested1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EmptyNested_EmptyNested1.Marshal(b, m, deterministic) -} -func (m *EmptyNested_EmptyNested1) XXX_Merge(src proto.Message) { - xxx_messageInfo_EmptyNested_EmptyNested1.Merge(m, src) -} -func (m *EmptyNested_EmptyNested1) XXX_Size() int { - return xxx_messageInfo_EmptyNested_EmptyNested1.Size(m) -} -func (m *EmptyNested_EmptyNested1) XXX_DiscardUnknown() { - xxx_messageInfo_EmptyNested_EmptyNested1.DiscardUnknown(m) -} - -var xxx_messageInfo_EmptyNested_EmptyNested1 proto.InternalMessageInfo - -func (m *EmptyNested_EmptyNested1) GetNested2() *EmptyNested_EmptyNested1_EmptyNested2 { - if m != nil { - return m.Nested2 - } - return nil -} - -type EmptyNested_EmptyNested1_EmptyNested2 struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *EmptyNested_EmptyNested1_EmptyNested2) Reset() { *m = EmptyNested_EmptyNested1_EmptyNested2{} } -func (m *EmptyNested_EmptyNested1_EmptyNested2) String() string { return proto.CompactTextString(m) } -func (*EmptyNested_EmptyNested1_EmptyNested2) ProtoMessage() {} -func (*EmptyNested_EmptyNested1_EmptyNested2) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{9, 0, 0} -} - -func (m *EmptyNested_EmptyNested1_EmptyNested2) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_EmptyNested_EmptyNested1_EmptyNested2.Unmarshal(m, b) -} -func (m *EmptyNested_EmptyNested1_EmptyNested2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_EmptyNested_EmptyNested1_EmptyNested2.Marshal(b, m, deterministic) -} -func (m *EmptyNested_EmptyNested1_EmptyNested2) XXX_Merge(src proto.Message) { - xxx_messageInfo_EmptyNested_EmptyNested1_EmptyNested2.Merge(m, src) -} -func (m *EmptyNested_EmptyNested1_EmptyNested2) XXX_Size() int { - return xxx_messageInfo_EmptyNested_EmptyNested1_EmptyNested2.Size(m) -} -func (m *EmptyNested_EmptyNested1_EmptyNested2) XXX_DiscardUnknown() { - xxx_messageInfo_EmptyNested_EmptyNested1_EmptyNested2.DiscardUnknown(m) -} - -var xxx_messageInfo_EmptyNested_EmptyNested1_EmptyNested2 proto.InternalMessageInfo - -type Timestamp struct { - Time string `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Timestamp) Reset() { *m = Timestamp{} } -func (m *Timestamp) String() string { return proto.CompactTextString(m) } -func (*Timestamp) ProtoMessage() {} -func (*Timestamp) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{10} -} - -func (m *Timestamp) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Timestamp.Unmarshal(m, b) -} -func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic) -} -func (m *Timestamp) XXX_Merge(src proto.Message) { - xxx_messageInfo_Timestamp.Merge(m, src) -} -func (m *Timestamp) XXX_Size() int { - return xxx_messageInfo_Timestamp.Size(m) -} -func (m *Timestamp) XXX_DiscardUnknown() { - xxx_messageInfo_Timestamp.DiscardUnknown(m) -} - -var xxx_messageInfo_Timestamp proto.InternalMessageInfo - -func (m *Timestamp) GetTime() string { - if m != nil { - return m.Time - } - return "" -} - -type Ref struct { - Empty *empty.Empty `protobuf:"bytes,10,opt,name=empty,proto3" json:"empty,omitempty"` - LocalTime2 *Timestamp `protobuf:"bytes,12,opt,name=local_time2,json=localTime2,proto3" json:"local_time2,omitempty"` - External *timestamp.Timestamp `protobuf:"bytes,1,opt,name=external,proto3" json:"external,omitempty"` - LocalTime *Timestamp `protobuf:"bytes,11,opt,name=local_time,json=localTime,proto3" json:"local_time,omitempty"` - File *Baz `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"` - FileMsg *Foo `protobuf:"bytes,8,opt,name=file_msg,json=fileMsg,proto3" json:"file_msg,omitempty"` - FileEnum Bar `protobuf:"varint,9,opt,name=file_enum,json=fileEnum,proto3,enum=pb.Bar" json:"file_enum,omitempty"` - Local *Ref_Foo `protobuf:"bytes,3,opt,name=local,proto3" json:"local,omitempty"` - Foreign *Foo_Foo2 `protobuf:"bytes,4,opt,name=foreign,proto3" json:"foreign,omitempty"` - En1 Ref_Foo_En `protobuf:"varint,5,opt,name=en1,proto3,enum=pb.Ref_Foo_En" json:"en1,omitempty"` - En2 Ref_Foo_Bar_En `protobuf:"varint,6,opt,name=en2,proto3,enum=pb.Ref_Foo_Bar_En" json:"en2,omitempty"` - Gz *Ref_Foo_Baz_Gz `protobuf:"bytes,7,opt,name=gz,proto3" json:"gz,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Ref) Reset() { *m = Ref{} } -func (m *Ref) String() string { return proto.CompactTextString(m) } -func (*Ref) ProtoMessage() {} -func (*Ref) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{11} -} - -func (m *Ref) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Ref.Unmarshal(m, b) -} -func (m *Ref) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Ref.Marshal(b, m, deterministic) -} -func (m *Ref) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ref.Merge(m, src) -} -func (m *Ref) XXX_Size() int { - return xxx_messageInfo_Ref.Size(m) -} -func (m *Ref) XXX_DiscardUnknown() { - xxx_messageInfo_Ref.DiscardUnknown(m) -} - -var xxx_messageInfo_Ref proto.InternalMessageInfo - -func (m *Ref) GetEmpty() *empty.Empty { - if m != nil { - return m.Empty - } - return nil -} - -func (m *Ref) GetLocalTime2() *Timestamp { - if m != nil { - return m.LocalTime2 - } - return nil -} - -func (m *Ref) GetExternal() *timestamp.Timestamp { - if m != nil { - return m.External - } - return nil -} - -func (m *Ref) GetLocalTime() *Timestamp { - if m != nil { - return m.LocalTime - } - return nil -} - -func (m *Ref) GetFile() *Baz { - if m != nil { - return m.File - } - return nil -} - -func (m *Ref) GetFileMsg() *Foo { - if m != nil { - return m.FileMsg - } - return nil -} - -func (m *Ref) GetFileEnum() Bar { - if m != nil { - return m.FileEnum - } - return Bar_BAR1 -} - -func (m *Ref) GetLocal() *Ref_Foo { - if m != nil { - return m.Local - } - return nil -} - -func (m *Ref) GetForeign() *Foo_Foo2 { - if m != nil { - return m.Foreign - } - return nil -} - -func (m *Ref) GetEn1() Ref_Foo_En { - if m != nil { - return m.En1 - } - return Ref_Foo_A0 -} - -func (m *Ref) GetEn2() Ref_Foo_Bar_En { - if m != nil { - return m.En2 - } - return Ref_Foo_Bar_A0 -} - -func (m *Ref) GetGz() *Ref_Foo_Baz_Gz { - if m != nil { - return m.Gz - } - return nil -} - -type Ref_Bar struct { - Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Ref_Bar) Reset() { *m = Ref_Bar{} } -func (m *Ref_Bar) String() string { return proto.CompactTextString(m) } -func (*Ref_Bar) ProtoMessage() {} -func (*Ref_Bar) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{11, 0} -} - -func (m *Ref_Bar) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Ref_Bar.Unmarshal(m, b) -} -func (m *Ref_Bar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Ref_Bar.Marshal(b, m, deterministic) -} -func (m *Ref_Bar) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ref_Bar.Merge(m, src) -} -func (m *Ref_Bar) XXX_Size() int { - return xxx_messageInfo_Ref_Bar.Size(m) -} -func (m *Ref_Bar) XXX_DiscardUnknown() { - xxx_messageInfo_Ref_Bar.DiscardUnknown(m) -} - -var xxx_messageInfo_Ref_Bar proto.InternalMessageInfo - -func (m *Ref_Bar) GetParam1() string { - if m != nil { - return m.Param1 - } - return "" -} - -type Ref_Foo struct { - Bar1 *Ref_Foo_Bar `protobuf:"bytes,1,opt,name=bar1,proto3" json:"bar1,omitempty"` - LocalTime2 *Timestamp `protobuf:"bytes,12,opt,name=local_time2,json=localTime2,proto3" json:"local_time2,omitempty"` - ExternalTime1 *timestamp.Timestamp `protobuf:"bytes,13,opt,name=external_time1,json=externalTime1,proto3" json:"external_time1,omitempty"` - Bar2 *Ref_Bar `protobuf:"bytes,2,opt,name=bar2,proto3" json:"bar2,omitempty"` - En1 Ref_Foo_En `protobuf:"varint,3,opt,name=en1,proto3,enum=pb.Ref_Foo_En" json:"en1,omitempty"` - En2 Ref_Foo_Bar_En `protobuf:"varint,4,opt,name=en2,proto3,enum=pb.Ref_Foo_Bar_En" json:"en2,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Ref_Foo) Reset() { *m = Ref_Foo{} } -func (m *Ref_Foo) String() string { return proto.CompactTextString(m) } -func (*Ref_Foo) ProtoMessage() {} -func (*Ref_Foo) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{11, 1} -} - -func (m *Ref_Foo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Ref_Foo.Unmarshal(m, b) -} -func (m *Ref_Foo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Ref_Foo.Marshal(b, m, deterministic) -} -func (m *Ref_Foo) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ref_Foo.Merge(m, src) -} -func (m *Ref_Foo) XXX_Size() int { - return xxx_messageInfo_Ref_Foo.Size(m) -} -func (m *Ref_Foo) XXX_DiscardUnknown() { - xxx_messageInfo_Ref_Foo.DiscardUnknown(m) -} - -var xxx_messageInfo_Ref_Foo proto.InternalMessageInfo - -func (m *Ref_Foo) GetBar1() *Ref_Foo_Bar { - if m != nil { - return m.Bar1 - } - return nil -} - -func (m *Ref_Foo) GetLocalTime2() *Timestamp { - if m != nil { - return m.LocalTime2 - } - return nil -} - -func (m *Ref_Foo) GetExternalTime1() *timestamp.Timestamp { - if m != nil { - return m.ExternalTime1 - } - return nil -} - -func (m *Ref_Foo) GetBar2() *Ref_Bar { - if m != nil { - return m.Bar2 - } - return nil -} - -func (m *Ref_Foo) GetEn1() Ref_Foo_En { - if m != nil { - return m.En1 - } - return Ref_Foo_A0 -} - -func (m *Ref_Foo) GetEn2() Ref_Foo_Bar_En { - if m != nil { - return m.En2 - } - return Ref_Foo_Bar_A0 -} - -type Ref_Foo_Baz struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Ref_Foo_Baz) Reset() { *m = Ref_Foo_Baz{} } -func (m *Ref_Foo_Baz) String() string { return proto.CompactTextString(m) } -func (*Ref_Foo_Baz) ProtoMessage() {} -func (*Ref_Foo_Baz) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{11, 1, 0} -} - -func (m *Ref_Foo_Baz) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Ref_Foo_Baz.Unmarshal(m, b) -} -func (m *Ref_Foo_Baz) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Ref_Foo_Baz.Marshal(b, m, deterministic) -} -func (m *Ref_Foo_Baz) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ref_Foo_Baz.Merge(m, src) -} -func (m *Ref_Foo_Baz) XXX_Size() int { - return xxx_messageInfo_Ref_Foo_Baz.Size(m) -} -func (m *Ref_Foo_Baz) XXX_DiscardUnknown() { - xxx_messageInfo_Ref_Foo_Baz.DiscardUnknown(m) -} - -var xxx_messageInfo_Ref_Foo_Baz proto.InternalMessageInfo - -type Ref_Foo_Baz_Gz struct { - Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Ref_Foo_Baz_Gz) Reset() { *m = Ref_Foo_Baz_Gz{} } -func (m *Ref_Foo_Baz_Gz) String() string { return proto.CompactTextString(m) } -func (*Ref_Foo_Baz_Gz) ProtoMessage() {} -func (*Ref_Foo_Baz_Gz) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{11, 1, 0, 0} -} - -func (m *Ref_Foo_Baz_Gz) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Ref_Foo_Baz_Gz.Unmarshal(m, b) -} -func (m *Ref_Foo_Baz_Gz) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Ref_Foo_Baz_Gz.Marshal(b, m, deterministic) -} -func (m *Ref_Foo_Baz_Gz) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ref_Foo_Baz_Gz.Merge(m, src) -} -func (m *Ref_Foo_Baz_Gz) XXX_Size() int { - return xxx_messageInfo_Ref_Foo_Baz_Gz.Size(m) -} -func (m *Ref_Foo_Baz_Gz) XXX_DiscardUnknown() { - xxx_messageInfo_Ref_Foo_Baz_Gz.DiscardUnknown(m) -} - -var xxx_messageInfo_Ref_Foo_Baz_Gz proto.InternalMessageInfo - -func (m *Ref_Foo_Baz_Gz) GetParam1() string { - if m != nil { - return m.Param1 - } - return "" -} - -type Ref_Foo_Bar struct { - Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Ref_Foo_Bar) Reset() { *m = Ref_Foo_Bar{} } -func (m *Ref_Foo_Bar) String() string { return proto.CompactTextString(m) } -func (*Ref_Foo_Bar) ProtoMessage() {} -func (*Ref_Foo_Bar) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{11, 1, 1} -} - -func (m *Ref_Foo_Bar) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Ref_Foo_Bar.Unmarshal(m, b) -} -func (m *Ref_Foo_Bar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Ref_Foo_Bar.Marshal(b, m, deterministic) -} -func (m *Ref_Foo_Bar) XXX_Merge(src proto.Message) { - xxx_messageInfo_Ref_Foo_Bar.Merge(m, src) -} -func (m *Ref_Foo_Bar) XXX_Size() int { - return xxx_messageInfo_Ref_Foo_Bar.Size(m) -} -func (m *Ref_Foo_Bar) XXX_DiscardUnknown() { - xxx_messageInfo_Ref_Foo_Bar.DiscardUnknown(m) -} - -var xxx_messageInfo_Ref_Foo_Bar proto.InternalMessageInfo - -func (m *Ref_Foo_Bar) GetParam1() string { - if m != nil { - return m.Param1 - } - return "" -} - -type Oneof struct { - Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` - // Types that are valid to be assigned to Oneof1: - // *Oneof_Param2 - // *Oneof_Param3 - Oneof1 isOneof_Oneof1 `protobuf_oneof:"Oneof1"` - // Types that are valid to be assigned to Oneof2: - // *Oneof_Param4 - // *Oneof_Param5 - Oneof2 isOneof_Oneof2 `protobuf_oneof:"Oneof2"` - // Types that are valid to be assigned to Oneof3: - // *Oneof_Param6 - Oneof3 isOneof_Oneof3 `protobuf_oneof:"Oneof3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Oneof) Reset() { *m = Oneof{} } -func (m *Oneof) String() string { return proto.CompactTextString(m) } -func (*Oneof) ProtoMessage() {} -func (*Oneof) Descriptor() ([]byte, []int) { - return fileDescriptor_3b26b5786a6c7dc9, []int{12} -} - -func (m *Oneof) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Oneof.Unmarshal(m, b) -} -func (m *Oneof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Oneof.Marshal(b, m, deterministic) -} -func (m *Oneof) XXX_Merge(src proto.Message) { - xxx_messageInfo_Oneof.Merge(m, src) -} -func (m *Oneof) XXX_Size() int { - return xxx_messageInfo_Oneof.Size(m) -} -func (m *Oneof) XXX_DiscardUnknown() { - xxx_messageInfo_Oneof.DiscardUnknown(m) -} - -var xxx_messageInfo_Oneof proto.InternalMessageInfo - -func (m *Oneof) GetParam1() string { - if m != nil { - return m.Param1 - } - return "" -} - -type isOneof_Oneof1 interface { - isOneof_Oneof1() -} - -type Oneof_Param2 struct { - Param2 string `protobuf:"bytes,2,opt,name=param2,proto3,oneof"` -} - -type Oneof_Param3 struct { - Param3 string `protobuf:"bytes,3,opt,name=param3,proto3,oneof"` -} - -func (*Oneof_Param2) isOneof_Oneof1() {} - -func (*Oneof_Param3) isOneof_Oneof1() {} - -func (m *Oneof) GetOneof1() isOneof_Oneof1 { - if m != nil { - return m.Oneof1 - } - return nil -} - -func (m *Oneof) GetParam2() string { - if x, ok := m.GetOneof1().(*Oneof_Param2); ok { - return x.Param2 - } - return "" -} - -func (m *Oneof) GetParam3() string { - if x, ok := m.GetOneof1().(*Oneof_Param3); ok { - return x.Param3 - } - return "" -} - -type isOneof_Oneof2 interface { - isOneof_Oneof2() -} - -type Oneof_Param4 struct { - Param4 string `protobuf:"bytes,4,opt,name=param4,proto3,oneof"` -} - -type Oneof_Param5 struct { - Param5 string `protobuf:"bytes,5,opt,name=param5,proto3,oneof"` -} - -func (*Oneof_Param4) isOneof_Oneof2() {} - -func (*Oneof_Param5) isOneof_Oneof2() {} - -func (m *Oneof) GetOneof2() isOneof_Oneof2 { - if m != nil { - return m.Oneof2 - } - return nil -} - -func (m *Oneof) GetParam4() string { - if x, ok := m.GetOneof2().(*Oneof_Param4); ok { - return x.Param4 - } - return "" -} - -func (m *Oneof) GetParam5() string { - if x, ok := m.GetOneof2().(*Oneof_Param5); ok { - return x.Param5 - } - return "" -} - -type isOneof_Oneof3 interface { - isOneof_Oneof3() -} - -type Oneof_Param6 struct { - Param6 string `protobuf:"bytes,6,opt,name=param6,proto3,oneof"` -} - -func (*Oneof_Param6) isOneof_Oneof3() {} - -func (m *Oneof) GetOneof3() isOneof_Oneof3 { - if m != nil { - return m.Oneof3 - } - return nil -} - -func (m *Oneof) GetParam6() string { - if x, ok := m.GetOneof3().(*Oneof_Param6); ok { - return x.Param6 - } - return "" -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Oneof) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Oneof_Param2)(nil), - (*Oneof_Param3)(nil), - (*Oneof_Param4)(nil), - (*Oneof_Param5)(nil), - (*Oneof_Param6)(nil), - } -} - -func init() { - proto.RegisterEnum("pb.Bar", Bar_name, Bar_value) - proto.RegisterEnum("pb.Ref_Foo_En", Ref_Foo_En_name, Ref_Foo_En_value) - proto.RegisterEnum("pb.Ref_Foo_Bar_En", Ref_Foo_Bar_En_name, Ref_Foo_Bar_En_value) - proto.RegisterType((*Empty3)(nil), "pb.Empty3") - proto.RegisterType((*Empty3_Int)(nil), "pb.Empty3.Int") - proto.RegisterType((*Foo)(nil), "pb.Foo") - proto.RegisterType((*Foo_Foo2)(nil), "pb.Foo.Foo2") - proto.RegisterType((*Baz)(nil), "pb.Baz") - proto.RegisterType((*Scalars)(nil), "pb.Scalars") - proto.RegisterType((*Repeated)(nil), "pb.Repeated") - proto.RegisterType((*Maps)(nil), "pb.Maps") - proto.RegisterMapType((map[bool]bool)(nil), "pb.Maps.BoolBoolEntry") - proto.RegisterMapType((map[uint32]uint32)(nil), "pb.Maps.Fixed32Fixed32Entry") - proto.RegisterMapType((map[uint64]uint64)(nil), "pb.Maps.Fixed64Fixed64Entry") - proto.RegisterMapType((map[int32]int32)(nil), "pb.Maps.Int32Int32Entry") - proto.RegisterMapType((map[int64]int64)(nil), "pb.Maps.Int64Int64Entry") - proto.RegisterMapType((map[int32]int32)(nil), "pb.Maps.Sfixed32Sfixed32Entry") - proto.RegisterMapType((map[int64]int64)(nil), "pb.Maps.Sfixed64Sfixed64Entry") - proto.RegisterMapType((map[int32]int32)(nil), "pb.Maps.Sint32Sint32Entry") - proto.RegisterMapType((map[int64]int64)(nil), "pb.Maps.Sint64Sint64Entry") - proto.RegisterMapType((map[string]Bar)(nil), "pb.Maps.StringBarEntry") - proto.RegisterMapType((map[string][]byte)(nil), "pb.Maps.StringBytesEntry") - proto.RegisterMapType((map[string]float64)(nil), "pb.Maps.StringDoubleEntry") - proto.RegisterMapType((map[string]float32)(nil), "pb.Maps.StringFloatEntry") - proto.RegisterMapType((map[string]*Foo)(nil), "pb.Maps.StringFooEntry") - proto.RegisterMapType((map[string]string)(nil), "pb.Maps.StringStringEntry") - proto.RegisterMapType((map[uint32]uint32)(nil), "pb.Maps.Uint32Uint32Entry") - proto.RegisterMapType((map[uint64]uint64)(nil), "pb.Maps.Uint64Uint64Entry") - proto.RegisterType((*Any)(nil), "pb.Any") - proto.RegisterType((*Empty)(nil), "pb.Empty") - proto.RegisterType((*EmptyRecursive)(nil), "pb.EmptyRecursive") - proto.RegisterType((*EmptyNested)(nil), "pb.EmptyNested") - proto.RegisterType((*EmptyNested_EmptyNested1)(nil), "pb.EmptyNested.EmptyNested1") - proto.RegisterType((*EmptyNested_EmptyNested1_EmptyNested2)(nil), "pb.EmptyNested.EmptyNested1.EmptyNested2") - proto.RegisterType((*Timestamp)(nil), "pb.Timestamp") - proto.RegisterType((*Ref)(nil), "pb.Ref") - proto.RegisterType((*Ref_Bar)(nil), "pb.Ref.Bar") - proto.RegisterType((*Ref_Foo)(nil), "pb.Ref.Foo") - proto.RegisterType((*Ref_Foo_Baz)(nil), "pb.Ref.Foo.Baz") - proto.RegisterType((*Ref_Foo_Baz_Gz)(nil), "pb.Ref.Foo.Baz.Gz") - proto.RegisterType((*Ref_Foo_Bar)(nil), "pb.Ref.Foo.Bar") - proto.RegisterType((*Oneof)(nil), "pb.Oneof") -} - -func init() { proto.RegisterFile("example/constructs.proto", fileDescriptor_3b26b5786a6c7dc9) } - -var fileDescriptor_3b26b5786a6c7dc9 = []byte{ - // 1737 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x58, 0x5b, 0x93, 0xdb, 0x48, - 0x15, 0x8e, 0x24, 0x5f, 0x8f, 0x66, 0x7c, 0x69, 0x42, 0x50, 0x94, 0x6c, 0xa2, 0x75, 0x02, 0x08, - 0xd8, 0xf5, 0xac, 0x65, 0xaf, 0x0a, 0x58, 0x60, 0x6b, 0x1c, 0x66, 0x92, 0x14, 0xb5, 0x50, 0xd5, - 0xc3, 0x16, 0x55, 0xbc, 0xa8, 0x64, 0x8f, 0xec, 0x75, 0x21, 0x4b, 0x46, 0x92, 0x53, 0x99, 0xf9, - 0x45, 0xd4, 0xfe, 0x09, 0x7e, 0x13, 0x2f, 0xbc, 0x51, 0x50, 0x7d, 0x93, 0xda, 0x9a, 0xf6, 0x4c, - 0xf1, 0x30, 0x56, 0x9f, 0xcb, 0xf7, 0x75, 0xeb, 0xf4, 0xe9, 0x33, 0x3a, 0x0d, 0x56, 0xf4, 0x31, - 0xdc, 0xee, 0xe2, 0xe8, 0x6c, 0x99, 0x26, 0x79, 0x91, 0xed, 0x97, 0x45, 0x3e, 0xde, 0x65, 0x69, - 0x91, 0x22, 0x7d, 0xb7, 0xb0, 0x9f, 0xae, 0xd3, 0x74, 0x1d, 0x47, 0x67, 0x54, 0xb3, 0xd8, 0xaf, - 0xce, 0xc2, 0xe4, 0x86, 0x99, 0xed, 0x67, 0x75, 0x53, 0xb4, 0xdd, 0x15, 0xc2, 0xf8, 0xb2, 0x6e, - 0x2c, 0x36, 0xdb, 0x28, 0x2f, 0xc2, 0xed, 0x8e, 0x39, 0x8c, 0xde, 0x42, 0xeb, 0x82, 0xf8, 0x4f, - 0xd1, 0x73, 0xd0, 0x36, 0x96, 0xe6, 0x68, 0xae, 0xe9, 0xf5, 0xc6, 0xbb, 0xc5, 0x98, 0xa9, 0xc7, - 0xef, 0x93, 0x02, 0x6b, 0x1b, 0xfb, 0x25, 0x18, 0xef, 0x93, 0x02, 0x59, 0xa0, 0x45, 0xdc, 0x09, - 0x2a, 0x27, 0xac, 0x45, 0xa3, 0x6f, 0xc1, 0xb8, 0x4c, 0x53, 0xf4, 0x04, 0x5a, 0xbb, 0x30, 0x0b, - 0xb7, 0x13, 0xea, 0xd5, 0xc5, 0x5c, 0x2a, 0xf5, 0x9e, 0xa5, 0x4b, 0x7a, 0xcf, 0x7e, 0x01, 0x8d, - 0xcb, 0x34, 0xf5, 0x8e, 0xe1, 0x46, 0x9f, 0x80, 0x31, 0x0f, 0x6f, 0x8f, 0x9a, 0xff, 0xa5, 0x43, - 0xfb, 0x6a, 0x19, 0xc6, 0x61, 0x96, 0x13, 0x9f, 0xeb, 0x74, 0xbf, 0x88, 0xd9, 0x02, 0x35, 0xcc, - 0x25, 0xf4, 0x18, 0x9a, 0xab, 0x38, 0x0d, 0x0b, 0x3a, 0xb3, 0x8e, 0x99, 0x40, 0xb4, 0x9b, 0xa4, - 0x98, 0x7a, 0x96, 0xe1, 0x68, 0x6e, 0x13, 0x33, 0x81, 0x6b, 0xfd, 0x99, 0xd5, 0x70, 0x34, 0xd7, - 0xc0, 0x4c, 0x20, 0xcc, 0x7b, 0xe6, 0xdc, 0x74, 0x34, 0xf7, 0x14, 0x73, 0x49, 0xe8, 0xfd, 0x99, - 0xd5, 0x72, 0x34, 0xb7, 0x81, 0xb9, 0x44, 0xf4, 0x39, 0xf3, 0x6f, 0x3b, 0x9a, 0x3b, 0xc4, 0x5c, - 0x12, 0x7a, 0x7f, 0x66, 0x75, 0x1c, 0xcd, 0x45, 0x98, 0x4b, 0xc8, 0x82, 0xf6, 0x6a, 0xf3, 0x31, - 0xba, 0x9e, 0x7a, 0x56, 0xd7, 0xd1, 0xdc, 0x36, 0x16, 0x62, 0x69, 0xf1, 0x67, 0x16, 0x38, 0x9a, - 0xdb, 0xc2, 0x42, 0x44, 0x36, 0x74, 0x72, 0x01, 0x32, 0x1d, 0xcd, 0xed, 0xe3, 0x52, 0xae, 0x6c, - 0xfe, 0xcc, 0x3a, 0x71, 0x34, 0x77, 0x80, 0x4b, 0x19, 0x21, 0x68, 0x2c, 0xd2, 0x34, 0xb6, 0x4e, - 0x1d, 0xcd, 0xed, 0x60, 0x3a, 0xa6, 0xeb, 0x2a, 0xb2, 0x4d, 0xb2, 0xb6, 0x7a, 0x2c, 0xba, 0x4c, - 0x22, 0xd1, 0x58, 0xdc, 0x14, 0x51, 0x6e, 0xf5, 0x1d, 0xcd, 0x3d, 0xc1, 0x4c, 0x18, 0xfd, 0xc3, - 0x80, 0x0e, 0x8e, 0x76, 0x51, 0x58, 0x44, 0xd7, 0x07, 0x41, 0x37, 0xd4, 0x41, 0x37, 0x94, 0x41, - 0x37, 0x94, 0x41, 0x37, 0xd4, 0x41, 0x37, 0x8e, 0x04, 0xdd, 0x38, 0x12, 0x74, 0xe3, 0x48, 0xd0, - 0x8d, 0x63, 0x41, 0x37, 0x8e, 0x06, 0xdd, 0x38, 0x1e, 0x74, 0xe3, 0x9e, 0xa0, 0x1b, 0x47, 0x82, - 0x6e, 0x28, 0x83, 0x6e, 0xa8, 0x83, 0x6e, 0x94, 0x41, 0x47, 0x4f, 0xc1, 0x58, 0xa5, 0xa9, 0x35, - 0x70, 0x0c, 0xd7, 0xf4, 0xda, 0xe4, 0xe8, 0x5d, 0xa6, 0x29, 0x26, 0x3a, 0x62, 0x5a, 0x84, 0x99, - 0x35, 0x74, 0x0c, 0xb7, 0xc7, 0x4c, 0xf3, 0x30, 0xc3, 0x44, 0x37, 0xfa, 0x7e, 0x08, 0x8d, 0x6f, - 0xc2, 0x5d, 0x8e, 0x7e, 0x05, 0x26, 0x8d, 0x46, 0xc0, 0x22, 0xa4, 0x51, 0x1a, 0x8b, 0xf8, 0x12, - 0x33, 0x39, 0xe4, 0x53, 0x8f, 0xfe, 0x5c, 0x24, 0x45, 0x76, 0x83, 0x61, 0x53, 0x2a, 0x38, 0xd4, - 0x9f, 0x05, 0x2c, 0x88, 0xfa, 0x5d, 0xa8, 0x3f, 0xa3, 0x3f, 0x15, 0x94, 0x2b, 0xd0, 0xd7, 0x70, - 0xca, 0x36, 0x2d, 0xd8, 0x57, 0xdb, 0x6e, 0x7a, 0x76, 0x09, 0xfe, 0x96, 0xaa, 0xd9, 0x2f, 0x83, - 0x9f, 0xec, 0x25, 0x95, 0x20, 0xf0, 0x67, 0xc1, 0xbe, 0xca, 0x90, 0x3a, 0x81, 0x3f, 0x63, 0xbf, - 0x12, 0x81, 0x50, 0x11, 0x02, 0x96, 0x06, 0x41, 0x5e, 0xe5, 0x92, 0x4c, 0x70, 0x45, 0xd5, 0x57, - 0xf2, 0x0a, 0x72, 0x49, 0x25, 0x08, 0xfc, 0x59, 0x90, 0x57, 0x49, 0x57, 0x27, 0xf0, 0x67, 0x57, - 0xf2, 0x0a, 0x72, 0x49, 0x85, 0x2e, 0xa0, 0xcf, 0x33, 0x24, 0x10, 0x99, 0xd3, 0xa6, 0x14, 0xcf, - 0x4b, 0x8a, 0x4b, 0xa6, 0xe7, 0x0f, 0x46, 0xd2, 0x5b, 0x1d, 0x28, 0x4b, 0x1a, 0x7f, 0x16, 0x88, - 0x24, 0xeb, 0xa8, 0x68, 0xfc, 0x19, 0x7f, 0xc8, 0x34, 0xa5, 0x12, 0xfd, 0x01, 0x86, 0x22, 0x61, - 0x83, 0x5c, 0x4e, 0x7f, 0xd3, 0x7b, 0x51, 0xbd, 0x12, 0x37, 0x88, 0x27, 0xa3, 0x1a, 0xe4, 0x35, - 0x75, 0x45, 0x46, 0xa2, 0x23, 0x9f, 0x98, 0xbb, 0x64, 0xfe, 0x4c, 0x3c, 0x0f, 0xc8, 0x2a, 0x35, - 0x9a, 0x42, 0x97, 0x1c, 0x8b, 0x80, 0x9e, 0x13, 0x93, 0x92, 0x3c, 0x29, 0x49, 0xe6, 0x69, 0x1a, - 0x93, 0x3f, 0x06, 0xee, 0x2c, 0xb8, 0x48, 0x77, 0x87, 0x9e, 0x9a, 0x80, 0x1f, 0xa5, 0x93, 0xfa, - 0xee, 0x50, 0x35, 0xfb, 0x15, 0xbb, 0x23, 0xa9, 0xd0, 0x6f, 0x80, 0xcb, 0x41, 0x75, 0xe6, 0x4c, - 0xef, 0x69, 0x0d, 0x3f, 0x27, 0x36, 0x06, 0x37, 0xf3, 0x4a, 0x23, 0xa1, 0x59, 0xad, 0x1b, 0x28, - 0xd1, 0x97, 0xc4, 0x76, 0x80, 0xa6, 0x1a, 0x69, 0xf1, 0xbc, 0x82, 0x0e, 0x95, 0x8b, 0xff, 0x3d, - 0x35, 0x1e, 0x2c, 0x9e, 0xa9, 0x90, 0x0f, 0x20, 0xa6, 0x4f, 0x53, 0x5a, 0x5b, 0x4c, 0xef, 0x47, - 0xf5, 0xc9, 0xd3, 0x94, 0x41, 0xbb, 0xb9, 0x90, 0x25, 0x1c, 0xa9, 0x1b, 0x3d, 0x25, 0x6e, 0x1e, - 0x66, 0x07, 0xb8, 0x79, 0x98, 0xd9, 0xbf, 0x85, 0x7e, 0xad, 0x50, 0xa0, 0x01, 0x18, 0x7f, 0x8b, - 0x6e, 0xe8, 0x3f, 0xdc, 0x26, 0x26, 0x43, 0x52, 0xbe, 0x3e, 0x84, 0xf1, 0x3e, 0xa2, 0xff, 0x6d, - 0x9b, 0x98, 0x09, 0xbf, 0xd6, 0x7f, 0xa9, 0x71, 0xb8, 0x5c, 0x2c, 0x64, 0xb8, 0xa1, 0x80, 0x1b, - 0x32, 0xfc, 0x6b, 0x18, 0xde, 0x29, 0x17, 0x32, 0xc1, 0xa9, 0x82, 0xe0, 0x54, 0x41, 0x70, 0x50, - 0x2e, 0x64, 0x82, 0x86, 0x82, 0xa0, 0x51, 0x23, 0xb8, 0x53, 0x2e, 0x64, 0x82, 0xa1, 0x82, 0x60, - 0xa8, 0x20, 0x38, 0x28, 0x17, 0x32, 0x01, 0x52, 0x10, 0x20, 0x99, 0xe0, 0x1c, 0x7e, 0xa0, 0x28, - 0x16, 0x32, 0x45, 0x5b, 0x41, 0xd1, 0x56, 0x51, 0x1c, 0x16, 0x0a, 0x99, 0xa2, 0xa5, 0xa0, 0x68, - 0xc9, 0x14, 0x6f, 0xe0, 0x87, 0xca, 0x12, 0x21, 0x93, 0xf4, 0x15, 0x24, 0x7d, 0x25, 0x49, 0xad, - 0x34, 0xc8, 0x24, 0x03, 0x05, 0xc9, 0x40, 0x26, 0xf9, 0x0a, 0x4e, 0x0f, 0x4a, 0x83, 0x0c, 0xee, - 0x28, 0xc0, 0x9d, 0xfa, 0x6e, 0xd4, 0xcb, 0x83, 0x4c, 0xd0, 0x55, 0x10, 0x74, 0x65, 0x82, 0xdf, - 0xc1, 0xa0, 0x5e, 0x1f, 0x1e, 0xc2, 0x9f, 0x28, 0xf1, 0x55, 0x85, 0x78, 0x08, 0xaf, 0x2b, 0x5f, - 0x40, 0x2a, 0x11, 0x0f, 0x11, 0x68, 0x32, 0xc1, 0x05, 0xf4, 0x0e, 0xab, 0x84, 0x02, 0xfd, 0x89, - 0x8c, 0x96, 0x3e, 0x3d, 0x54, 0x34, 0xa2, 0x68, 0x3c, 0x44, 0x23, 0x7d, 0xa6, 0x54, 0x34, 0xe4, - 0x53, 0xff, 0x3c, 0xb9, 0x39, 0xfa, 0xa9, 0xdf, 0x86, 0x26, 0xed, 0x36, 0x46, 0x31, 0xf4, 0xe8, - 0x00, 0x47, 0xcb, 0x7d, 0x96, 0x6f, 0x3e, 0x44, 0xe8, 0x0b, 0x68, 0x27, 0x51, 0x5e, 0x44, 0xd7, - 0x13, 0xde, 0x9b, 0x3c, 0x19, 0xb3, 0xbe, 0x67, 0x2c, 0xfa, 0x1e, 0xd6, 0xa8, 0x60, 0xe1, 0x86, - 0x5c, 0x68, 0xd2, 0x36, 0x89, 0xbf, 0x15, 0x2a, 0x7b, 0x99, 0x92, 0x14, 0x33, 0x87, 0xd1, 0xf7, - 0x1a, 0x98, 0xd4, 0xf2, 0x47, 0x0a, 0x45, 0x7e, 0x7d, 0xae, 0xe7, 0x25, 0x96, 0x79, 0xc8, 0xe3, - 0x49, 0x39, 0xa3, 0xbd, 0x84, 0x13, 0xd9, 0x80, 0xde, 0x08, 0x1e, 0x8f, 0xf3, 0xfc, 0xec, 0x3e, - 0x1e, 0x59, 0xf0, 0x04, 0xa9, 0x67, 0xf7, 0x0e, 0x48, 0xbd, 0xd1, 0x4b, 0xe8, 0xfe, 0x59, 0x34, - 0x78, 0xe4, 0xa3, 0x93, 0x74, 0x7b, 0x3c, 0x8c, 0x74, 0x3c, 0xfa, 0x6f, 0x0b, 0x0c, 0x1c, 0xad, - 0xd0, 0x67, 0xe2, 0xfd, 0xe1, 0xde, 0x78, 0x31, 0x27, 0x34, 0x06, 0x33, 0x4e, 0x97, 0x61, 0x1c, - 0x10, 0x0e, 0x8f, 0xb6, 0x14, 0xa6, 0x77, 0x4a, 0xd6, 0x5b, 0xce, 0x86, 0x81, 0x7a, 0x10, 0xd9, - 0x43, 0x3e, 0x74, 0xa2, 0x8f, 0x45, 0x94, 0x25, 0x61, 0xcc, 0x5f, 0xce, 0xbe, 0x33, 0x41, 0x85, - 0x2c, 0x7d, 0xd1, 0x67, 0x00, 0xd5, 0x3c, 0xb4, 0xab, 0xb9, 0x33, 0x4d, 0xb7, 0x9c, 0x06, 0x3d, - 0x83, 0xc6, 0x6a, 0x13, 0x1f, 0x24, 0xe6, 0x3c, 0xbc, 0xc5, 0x54, 0x89, 0x46, 0xd0, 0x21, 0xcf, - 0x60, 0x9b, 0xaf, 0x69, 0xb3, 0x25, 0x65, 0x6e, 0x9b, 0x18, 0xbe, 0xc9, 0xd7, 0xe8, 0x35, 0x74, - 0xa9, 0x4f, 0x94, 0xec, 0xb7, 0xb4, 0xf1, 0x92, 0xf2, 0x92, 0xa2, 0x2f, 0x92, 0xfd, 0x16, 0x7d, - 0x0a, 0x4d, 0x3a, 0x27, 0x6d, 0x14, 0x4d, 0xcf, 0x24, 0x1e, 0x38, 0x5a, 0xb1, 0x43, 0x40, 0x2d, - 0xe8, 0x27, 0xd0, 0x5e, 0xa5, 0x59, 0xb4, 0x59, 0x27, 0xb4, 0x6f, 0x34, 0xbd, 0x13, 0x3e, 0x17, - 0xf9, 0xf3, 0xb0, 0x30, 0x22, 0x07, 0x8c, 0x28, 0x99, 0xd0, 0x26, 0xb2, 0xc7, 0x9a, 0x6c, 0x4e, - 0x34, 0xbe, 0x48, 0x30, 0x31, 0xa1, 0xd7, 0xc4, 0xc3, 0xa3, 0xed, 0x64, 0x8f, 0x65, 0xa5, 0xf0, - 0x98, 0x87, 0x19, 0xf7, 0xf2, 0xd0, 0x08, 0xf4, 0xf5, 0x2d, 0xed, 0x2d, 0xcd, 0xba, 0xd3, 0xed, - 0xf8, 0xed, 0x2d, 0xd6, 0xd7, 0xb7, 0x36, 0x6d, 0x9c, 0xb3, 0x63, 0xa7, 0xc9, 0xfe, 0xb7, 0xce, - 0xfa, 0xf5, 0x57, 0xd0, 0x58, 0x84, 0x99, 0xc8, 0xe5, 0x7e, 0x6d, 0x46, 0x4c, 0x8d, 0xff, 0xf7, - 0xfe, 0x9f, 0x43, 0x4f, 0xec, 0x29, 0x85, 0x4c, 0x68, 0xb7, 0x79, 0x7f, 0x16, 0x9c, 0x0a, 0x04, - 0x51, 0x4d, 0xd0, 0x4b, 0xba, 0x2e, 0x8f, 0x6f, 0x6e, 0x19, 0x74, 0xb1, 0x26, 0x4f, 0xc4, 0xd2, - 0x78, 0x30, 0x96, 0x8d, 0x7b, 0x63, 0x69, 0xbf, 0xa2, 0x17, 0x0c, 0xf6, 0x73, 0xd0, 0xdf, 0x1e, - 0xbd, 0x66, 0xb0, 0xa7, 0xf7, 0x06, 0x73, 0xf4, 0x18, 0xf4, 0x8b, 0x04, 0xb5, 0x40, 0x3f, 0xff, - 0x62, 0xf0, 0x88, 0x3e, 0x27, 0x03, 0xed, 0x88, 0xf6, 0x9f, 0x1a, 0x34, 0xff, 0x94, 0x44, 0xe9, - 0xea, 0xe8, 0x55, 0x89, 0x75, 0x78, 0x55, 0xf2, 0xee, 0x91, 0xb8, 0x2c, 0x29, 0x2d, 0x53, 0xfa, - 0xda, 0x95, 0x65, 0x5a, 0x5a, 0xd8, 0xc5, 0x45, 0xf7, 0x9d, 0xc6, 0x2d, 0xb3, 0xd2, 0xf2, 0x25, - 0x4d, 0xbb, 0xca, 0xf2, 0x65, 0x69, 0xf1, 0x69, 0xba, 0x75, 0xdf, 0xe9, 0xdc, 0xe2, 0xcf, 0x3b, - 0xd0, 0xa2, 0x4b, 0x9c, 0x94, 0x23, 0xaf, 0x1c, 0x4d, 0x7f, 0xfe, 0x8a, 0x05, 0xa3, 0x03, 0x8d, - 0xf9, 0x39, 0x9e, 0x0c, 0x1e, 0xf1, 0x91, 0x37, 0xd0, 0xf8, 0x68, 0x3a, 0xd0, 0xbd, 0xff, 0xe8, - 0x00, 0x6f, 0xca, 0x9b, 0x2c, 0xf4, 0x1a, 0x3a, 0xfc, 0x9a, 0x26, 0x40, 0x74, 0x33, 0xb9, 0x64, - 0xcb, 0x02, 0xfa, 0x29, 0x74, 0xc5, 0xc5, 0x42, 0x80, 0x4e, 0xd8, 0x8e, 0x31, 0xd1, 0x3e, 0x90, - 0xd0, 0x33, 0x68, 0x92, 0x6f, 0xd5, 0x00, 0x75, 0xc4, 0x67, 0xab, 0x5d, 0x8e, 0xd0, 0x8f, 0xa1, - 0x71, 0x9e, 0xdc, 0x04, 0xe8, 0xf1, 0x9d, 0x6c, 0x3b, 0x4f, 0x6e, 0x6c, 0x7a, 0xc2, 0xc9, 0xff, - 0x99, 0x5f, 0xf0, 0x9b, 0xaf, 0x00, 0x1d, 0xa9, 0x7e, 0x76, 0xb7, 0xac, 0xc8, 0x68, 0x0c, 0x6d, - 0x3a, 0xf0, 0x02, 0xa4, 0xf8, 0x5f, 0x61, 0xf7, 0x6b, 0xb5, 0x1b, 0x7d, 0xca, 0xfd, 0xa7, 0x01, - 0x92, 0xee, 0xc9, 0x6c, 0x69, 0x8c, 0x2c, 0x68, 0xe0, 0x68, 0x15, 0xa0, 0x36, 0xcf, 0x4c, 0x5b, - 0x0c, 0xd0, 0x0b, 0x1e, 0xea, 0x00, 0xd1, 0x15, 0xd0, 0xb1, 0x5d, 0x0d, 0xd1, 0x08, 0xe0, 0x4d, - 0x18, 0xc7, 0x7f, 0xd9, 0x14, 0xdf, 0xbd, 0xbf, 0x46, 0xd5, 0x2a, 0xa5, 0x05, 0xcf, 0x27, 0x7f, - 0x3d, 0x5b, 0x6f, 0x8a, 0xef, 0xf6, 0x8b, 0xf1, 0x32, 0xdd, 0x9e, 0x5d, 0x87, 0xc9, 0x26, 0x8a, - 0x3f, 0xc4, 0xe1, 0xf5, 0x32, 0x3d, 0x5b, 0xa7, 0x9f, 0xd3, 0x17, 0xfd, 0x7c, 0xfd, 0xf7, 0xf8, - 0x8c, 0xdf, 0x3a, 0x7e, 0xb5, 0x5b, 0x2c, 0x5a, 0x54, 0x3b, 0xfd, 0x5f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xed, 0xe4, 0xf1, 0x05, 0x8a, 0x14, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// ConstructsClient is the client API for Constructs service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ConstructsClient interface { - Scalars_(ctx context.Context, in *Scalars, opts ...grpc.CallOption) (*Scalars, error) - Repeated_(ctx context.Context, in *Repeated, opts ...grpc.CallOption) (*Repeated, error) - Maps_(ctx context.Context, in *Maps, opts ...grpc.CallOption) (*Maps, error) - Any_(ctx context.Context, in *any.Any, opts ...grpc.CallOption) (*Any, error) - Empty_(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Empty, error) - Empty2_(ctx context.Context, in *EmptyRecursive, opts ...grpc.CallOption) (*EmptyNested, error) - Empty3_(ctx context.Context, in *Empty3, opts ...grpc.CallOption) (*Empty3, error) - Ref_(ctx context.Context, in *Ref, opts ...grpc.CallOption) (*Ref, error) - Oneof_(ctx context.Context, in *Oneof, opts ...grpc.CallOption) (*Oneof, error) - CallWithId(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) -} - -type constructsClient struct { - cc *grpc.ClientConn -} - -func NewConstructsClient(cc *grpc.ClientConn) ConstructsClient { - return &constructsClient{cc} -} - -func (c *constructsClient) Scalars_(ctx context.Context, in *Scalars, opts ...grpc.CallOption) (*Scalars, error) { - out := new(Scalars) - err := c.cc.Invoke(ctx, "/pb.Constructs/Scalars_", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *constructsClient) Repeated_(ctx context.Context, in *Repeated, opts ...grpc.CallOption) (*Repeated, error) { - out := new(Repeated) - err := c.cc.Invoke(ctx, "/pb.Constructs/Repeated_", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *constructsClient) Maps_(ctx context.Context, in *Maps, opts ...grpc.CallOption) (*Maps, error) { - out := new(Maps) - err := c.cc.Invoke(ctx, "/pb.Constructs/Maps_", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *constructsClient) Any_(ctx context.Context, in *any.Any, opts ...grpc.CallOption) (*Any, error) { - out := new(Any) - err := c.cc.Invoke(ctx, "/pb.Constructs/Any_", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *constructsClient) Empty_(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/pb.Constructs/Empty_", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *constructsClient) Empty2_(ctx context.Context, in *EmptyRecursive, opts ...grpc.CallOption) (*EmptyNested, error) { - out := new(EmptyNested) - err := c.cc.Invoke(ctx, "/pb.Constructs/Empty2_", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *constructsClient) Empty3_(ctx context.Context, in *Empty3, opts ...grpc.CallOption) (*Empty3, error) { - out := new(Empty3) - err := c.cc.Invoke(ctx, "/pb.Constructs/Empty3_", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *constructsClient) Ref_(ctx context.Context, in *Ref, opts ...grpc.CallOption) (*Ref, error) { - out := new(Ref) - err := c.cc.Invoke(ctx, "/pb.Constructs/Ref_", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *constructsClient) Oneof_(ctx context.Context, in *Oneof, opts ...grpc.CallOption) (*Oneof, error) { - out := new(Oneof) - err := c.cc.Invoke(ctx, "/pb.Constructs/Oneof_", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *constructsClient) CallWithId(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/pb.Constructs/CallWithId", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ConstructsServer is the server API for Constructs service. -type ConstructsServer interface { - Scalars_(context.Context, *Scalars) (*Scalars, error) - Repeated_(context.Context, *Repeated) (*Repeated, error) - Maps_(context.Context, *Maps) (*Maps, error) - Any_(context.Context, *any.Any) (*Any, error) - Empty_(context.Context, *empty.Empty) (*Empty, error) - Empty2_(context.Context, *EmptyRecursive) (*EmptyNested, error) - Empty3_(context.Context, *Empty3) (*Empty3, error) - Ref_(context.Context, *Ref) (*Ref, error) - Oneof_(context.Context, *Oneof) (*Oneof, error) - CallWithId(context.Context, *Empty) (*Empty, error) -} - -// UnimplementedConstructsServer can be embedded to have forward compatible implementations. -type UnimplementedConstructsServer struct { -} - -func (*UnimplementedConstructsServer) Scalars_(ctx context.Context, req *Scalars) (*Scalars, error) { - return nil, status.Errorf(codes.Unimplemented, "method Scalars_ not implemented") -} -func (*UnimplementedConstructsServer) Repeated_(ctx context.Context, req *Repeated) (*Repeated, error) { - return nil, status.Errorf(codes.Unimplemented, "method Repeated_ not implemented") -} -func (*UnimplementedConstructsServer) Maps_(ctx context.Context, req *Maps) (*Maps, error) { - return nil, status.Errorf(codes.Unimplemented, "method Maps_ not implemented") -} -func (*UnimplementedConstructsServer) Any_(ctx context.Context, req *any.Any) (*Any, error) { - return nil, status.Errorf(codes.Unimplemented, "method Any_ not implemented") -} -func (*UnimplementedConstructsServer) Empty_(ctx context.Context, req *empty.Empty) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Empty_ not implemented") -} -func (*UnimplementedConstructsServer) Empty2_(ctx context.Context, req *EmptyRecursive) (*EmptyNested, error) { - return nil, status.Errorf(codes.Unimplemented, "method Empty2_ not implemented") -} -func (*UnimplementedConstructsServer) Empty3_(ctx context.Context, req *Empty3) (*Empty3, error) { - return nil, status.Errorf(codes.Unimplemented, "method Empty3_ not implemented") -} -func (*UnimplementedConstructsServer) Ref_(ctx context.Context, req *Ref) (*Ref, error) { - return nil, status.Errorf(codes.Unimplemented, "method Ref_ not implemented") -} -func (*UnimplementedConstructsServer) Oneof_(ctx context.Context, req *Oneof) (*Oneof, error) { - return nil, status.Errorf(codes.Unimplemented, "method Oneof_ not implemented") -} -func (*UnimplementedConstructsServer) CallWithId(ctx context.Context, req *Empty) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method CallWithId not implemented") -} - -func RegisterConstructsServer(s *grpc.Server, srv ConstructsServer) { - s.RegisterService(&_Constructs_serviceDesc, srv) -} - -func _Constructs_Scalars__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Scalars) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).Scalars_(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/Scalars_", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).Scalars_(ctx, req.(*Scalars)) - } - return interceptor(ctx, in, info, handler) -} - -func _Constructs_Repeated__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Repeated) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).Repeated_(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/Repeated_", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).Repeated_(ctx, req.(*Repeated)) - } - return interceptor(ctx, in, info, handler) -} - -func _Constructs_Maps__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Maps) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).Maps_(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/Maps_", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).Maps_(ctx, req.(*Maps)) - } - return interceptor(ctx, in, info, handler) -} - -func _Constructs_Any__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(any.Any) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).Any_(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/Any_", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).Any_(ctx, req.(*any.Any)) - } - return interceptor(ctx, in, info, handler) -} - -func _Constructs_Empty__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(empty.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).Empty_(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/Empty_", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).Empty_(ctx, req.(*empty.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _Constructs_Empty2__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(EmptyRecursive) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).Empty2_(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/Empty2_", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).Empty2_(ctx, req.(*EmptyRecursive)) - } - return interceptor(ctx, in, info, handler) -} - -func _Constructs_Empty3__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty3) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).Empty3_(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/Empty3_", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).Empty3_(ctx, req.(*Empty3)) - } - return interceptor(ctx, in, info, handler) -} - -func _Constructs_Ref__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Ref) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).Ref_(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/Ref_", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).Ref_(ctx, req.(*Ref)) - } - return interceptor(ctx, in, info, handler) -} - -func _Constructs_Oneof__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Oneof) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).Oneof_(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/Oneof_", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).Oneof_(ctx, req.(*Oneof)) - } - return interceptor(ctx, in, info, handler) -} - -func _Constructs_CallWithId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ConstructsServer).CallWithId(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.Constructs/CallWithId", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ConstructsServer).CallWithId(ctx, req.(*Empty)) - } - return interceptor(ctx, in, info, handler) -} - -var _Constructs_serviceDesc = grpc.ServiceDesc{ - ServiceName: "pb.Constructs", - HandlerType: (*ConstructsServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Scalars_", - Handler: _Constructs_Scalars__Handler, - }, - { - MethodName: "Repeated_", - Handler: _Constructs_Repeated__Handler, - }, - { - MethodName: "Maps_", - Handler: _Constructs_Maps__Handler, - }, - { - MethodName: "Any_", - Handler: _Constructs_Any__Handler, - }, - { - MethodName: "Empty_", - Handler: _Constructs_Empty__Handler, - }, - { - MethodName: "Empty2_", - Handler: _Constructs_Empty2__Handler, - }, - { - MethodName: "Empty3_", - Handler: _Constructs_Empty3__Handler, - }, - { - MethodName: "Ref_", - Handler: _Constructs_Ref__Handler, - }, - { - MethodName: "Oneof_", - Handler: _Constructs_Oneof__Handler, - }, - { - MethodName: "CallWithId", - Handler: _Constructs_CallWithId_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "example/constructs.proto", -} diff --git a/example/constructs.pb.graphqls b/example/constructs.pb.graphqls deleted file mode 100644 index eca6924..0000000 --- a/example/constructs.pb.graphqls +++ /dev/null @@ -1,379 +0,0 @@ -# Code generated by protoc-gen-gogql. DO NOT EDIT -# source: example/constructs.proto - -directive @oneof(name: String) on INPUT_FIELD_DEFINITION - -directive @Constructs(name: String) on FIELD_DEFINITION - -scalar Any - -scalar Bytes - -scalar Float32 - -scalar Int32 - -scalar Int64 - -scalar Uint32 - -scalar Uint64 - -# map with key: 'Boolean' and value: 'Boolean' -scalar Maps_BoolBoolEntry - -# map with key: 'Uint32' and value: 'Uint32' -scalar Maps_Fixed32Fixed32Entry - -# map with key: 'Uint64' and value: 'Uint64' -scalar Maps_Fixed64Fixed64Entry - -# map with key: 'Int32' and value: 'Int32' -scalar Maps_Int32Int32Entry - -# map with key: 'Int64' and value: 'Int64' -scalar Maps_Int64Int64Entry - -# map with key: 'Int32' and value: 'Int32' -scalar Maps_Sfixed32Sfixed32Entry - -# map with key: 'Int64' and value: 'Int64' -scalar Maps_Sfixed64Sfixed64Entry - -# map with key: 'Int32' and value: 'Int32' -scalar Maps_Sint32Sint32Entry - -# map with key: 'Int64' and value: 'Int64' -scalar Maps_Sint64Sint64Entry - -# map with key: 'String' and value: 'Bar' -scalar Maps_StringBarEntry - -# map with key: 'String' and value: 'Bytes' -scalar Maps_StringBytesEntry - -# map with key: 'String' and value: 'Float' -scalar Maps_StringDoubleEntry - -# map with key: 'String' and value: 'Float32' -scalar Maps_StringFloatEntry - -# map with key: 'String' and value: 'Foo' -scalar Maps_StringFooEntry - -# map with key: 'String' and value: 'String' -scalar Maps_StringStringEntry - -# map with key: 'Uint32' and value: 'Uint32' -scalar Maps_Uint32Uint32Entry - -# map with key: 'Uint64' and value: 'Uint64' -scalar Maps_Uint64Uint64Entry - -input google_protobuf_TimestampInput { - seconds: Int64 - nanos: Int32 -} - -input BazInput { - param1: String -} - -input FooInput { - param1: String - param2: String -} - -input Foo_Foo2Input { - param1: String -} - -input MapsInput { - int32Int32: Maps_Int32Int32Entry - int64Int64: Maps_Int64Int64Entry - uint32Uint32: Maps_Uint32Uint32Entry - uint64Uint64: Maps_Uint64Uint64Entry - sint32Sint32: Maps_Sint32Sint32Entry - sint64Sint64: Maps_Sint64Sint64Entry - fixed32Fixed32: Maps_Fixed32Fixed32Entry - fixed64Fixed64: Maps_Fixed64Fixed64Entry - sfixed32Sfixed32: Maps_Sfixed32Sfixed32Entry - sfixed64Sfixed64: Maps_Sfixed64Sfixed64Entry - boolBool: Maps_BoolBoolEntry - stringString: Maps_StringStringEntry - stringBytes: Maps_StringBytesEntry - stringFloat: Maps_StringFloatEntry - stringDouble: Maps_StringDoubleEntry - stringFoo: Maps_StringFooEntry - stringBar: Maps_StringBarEntry -} - -input OneofInput { - param1: String - param2: String @oneof(name: "IsOneof_Oneof1") - param3: String @oneof(name: "IsOneof_Oneof1") - param4: String @oneof(name: "IsOneof_Oneof2") - param5: String @oneof(name: "IsOneof_Oneof2") - param6: String @oneof(name: "IsOneof_Oneof3") -} - -input RefInput { - localTime2: pb_TimestampInput - external: google_protobuf_TimestampInput - localTime: pb_TimestampInput - file: BazInput - fileMsg: FooInput - fileEnum: Bar - local: Ref_FooInput - foreign: Foo_Foo2Input - en1: Ref_Foo_En - en2: Ref_Foo_Bar_En - gz: Ref_Foo_Baz_GzInput -} - -input Ref_BarInput { - param1: String -} - -input Ref_FooInput { - bar1: Ref_Foo_BarInput - localTime2: pb_TimestampInput - externalTime1: google_protobuf_TimestampInput - bar2: Ref_BarInput - en1: Ref_Foo_En - en2: Ref_Foo_Bar_En -} - -input Ref_Foo_BarInput { - param1: String -} - -input Ref_Foo_Baz_GzInput { - param1: String -} - -input RepeatedInput { - double: [Float!] - float: [Float32!] - int32: [Int32!] - int64: [Int64!] - uint32: [Uint32!] - uint64: [Uint64!] - sint32: [Int32!] - sint64: [Int64!] - fixed32: [Uint32!] - fixed64: [Uint64!] - sfixed32: [Int32!] - sfixed64: [Int64!] - bool: [Boolean!] - string: [String!] - bytes: [Bytes!] - foo: [FooInput!] - bar: [Bar!] -} - -input ScalarsInput { - double: Float - float: Float32 - int32: Int32 - int64: Int64 - uint32: Uint32 - uint64: Uint64 - sint32: Int32 - sint64: Int64 - fixed32: Uint32 - fixed64: Uint64 - sfixed32: Int32 - sfixed64: Int64 - bool: Boolean - string: String - bytes: Bytes -} - -input pb_TimestampInput { - time: String -} - -type google_protobuf_Timestamp { - seconds: Int64 - nanos: Int32 -} - -type pb_Any { - param1: String -} - -type Baz { - param1: String -} - -type Foo { - param1: String - param2: String -} - -type Foo_Foo2 { - param1: String -} - -type Maps { - int32Int32: Maps_Int32Int32Entry - int64Int64: Maps_Int64Int64Entry - uint32Uint32: Maps_Uint32Uint32Entry - uint64Uint64: Maps_Uint64Uint64Entry - sint32Sint32: Maps_Sint32Sint32Entry - sint64Sint64: Maps_Sint64Sint64Entry - fixed32Fixed32: Maps_Fixed32Fixed32Entry - fixed64Fixed64: Maps_Fixed64Fixed64Entry - sfixed32Sfixed32: Maps_Sfixed32Sfixed32Entry - sfixed64Sfixed64: Maps_Sfixed64Sfixed64Entry - boolBool: Maps_BoolBoolEntry - stringString: Maps_StringStringEntry - stringBytes: Maps_StringBytesEntry - stringFloat: Maps_StringFloatEntry - stringDouble: Maps_StringDoubleEntry - stringFoo: Maps_StringFooEntry - stringBar: Maps_StringBarEntry -} - -type Oneof { - param1: String - oneof1: IsOneof_Oneof1 - oneof2: IsOneof_Oneof2 - oneof3: IsOneof_Oneof3 -} - -type Oneof_Param2 { - param2: String -} - -type Oneof_Param3 { - param3: String -} - -type Oneof_Param4 { - param4: String -} - -type Oneof_Param5 { - param5: String -} - -type Oneof_Param6 { - param6: String -} - -type Ref { - localTime2: pb_Timestamp - external: google_protobuf_Timestamp - localTime: pb_Timestamp - file: Baz - fileMsg: Foo - fileEnum: Bar - local: Ref_Foo - foreign: Foo_Foo2 - en1: Ref_Foo_En - en2: Ref_Foo_Bar_En - gz: Ref_Foo_Baz_Gz -} - -type Ref_Bar { - param1: String -} - -type Ref_Foo { - bar1: Ref_Foo_Bar - localTime2: pb_Timestamp - externalTime1: google_protobuf_Timestamp - bar2: Ref_Bar - en1: Ref_Foo_En - en2: Ref_Foo_Bar_En -} - -type Ref_Foo_Bar { - param1: String -} - -type Ref_Foo_Baz_Gz { - param1: String -} - -type Repeated { - double: [Float!] - float: [Float32!] - int32: [Int32!] - int64: [Int64!] - uint32: [Uint32!] - uint64: [Uint64!] - sint32: [Int32!] - sint64: [Int64!] - fixed32: [Uint32!] - fixed64: [Uint64!] - sfixed32: [Int32!] - sfixed64: [Int64!] - bool: [Boolean!] - string: [String!] - bytes: [Bytes!] - foo: [Foo!] - bar: [Bar!] -} - -type Scalars { - double: Float - float: Float32 - int32: Int32 - int64: Int64 - uint32: Uint32 - uint64: Uint64 - sint32: Int32 - sint64: Int64 - fixed32: Uint32 - fixed64: Uint64 - sfixed32: Int32 - sfixed64: Int64 - bool: Boolean - string: String - bytes: Bytes -} - -type pb_Timestamp { - time: String -} - -union IsOneof_Oneof1 = Oneof_Param2 | Oneof_Param3 - -union IsOneof_Oneof2 = Oneof_Param4 | Oneof_Param5 - -union IsOneof_Oneof3 = Oneof_Param6 - -enum Bar { - BAR1 - BAR2 - BAR3 -} - -enum Ref_Foo_Bar_En { - A0 - A1 -} - -enum Ref_Foo_En { - A0 - A1 -} - -type Mutation { - constructsScalars_(in: ScalarsInput): Scalars @Constructs - constructsRepeated_(in: RepeatedInput): Repeated @Constructs - constructsMaps_(in: MapsInput): Maps @Constructs - constructsAny_(in: Any): pb_Any @Constructs - constructsEmpty_: Boolean @Constructs - constructsEmpty2_: Boolean @Constructs - constructsEmpty3_: Boolean @Constructs - constructsRef_(in: RefInput): Ref @Constructs - constructsOneof_(in: OneofInput): Oneof @Constructs - constructsCallWithId: Boolean @Constructs -} - -type Query { dummy: Boolean } - diff --git a/example/gateway/Makefile b/example/gateway/Makefile new file mode 100644 index 0000000..dbcd2f8 --- /dev/null +++ b/example/gateway/Makefile @@ -0,0 +1,15 @@ +.PHONY: generate start stop + +start: generate + docker-compose up + +stop: + docker-compose down + +generate: optionsserver/pb/options_grpc.pb.go constructserver/pb/constructs_grpc.pb.go + +%_grpc.pb.go: %.proto %.pb.go + protoc --go-grpc_out=paths=source_relative:. -I . -I ../../ $*.proto + +%.pb.go: %.proto + protoc --go_out=paths=source_relative:. -I . -I ../../ $*.proto diff --git a/example/gateway/config.json b/example/gateway/config.json new file mode 100644 index 0000000..f4c3698 --- /dev/null +++ b/example/gateway/config.json @@ -0,0 +1,6 @@ +{ + "endpoints": [ + "constructserver:8081", + "optionsserver:8082" + ] +} \ No newline at end of file diff --git a/example/gateway/constructserver/main.go b/example/gateway/constructserver/main.go new file mode 100644 index 0000000..7d519a0 --- /dev/null +++ b/example/gateway/constructserver/main.go @@ -0,0 +1,81 @@ +package main + +import ( + "context" + "log" + "net" + + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + any "google.golang.org/protobuf/types/known/anypb" + empty "google.golang.org/protobuf/types/known/emptypb" + + "github.com/danielvladco/go-proto-gql/example/gateway/constructserver/pb" +) + +func main() { + l, err := net.Listen("tcp", ":8081") + if err != nil { + log.Fatal(err) + } + + s := grpc.NewServer() + pb.RegisterConstructsServer(s, &service{}) + reflection.Register(s) + log.Fatal(s.Serve(l)) +} + +type service struct { + pb.UnimplementedConstructsServer +} + +func (s *service) Anyway_(ctx context.Context, a *pb.Any) (*pb.AnyInput, error) { + return &pb.AnyInput{ + Any: a.Any, + }, nil +} + +func (s *service) Scalars_(ctx context.Context, scalars *pb.Scalars) (*pb.Scalars, error) { + return scalars, nil +} + +func (s *service) Repeated_(ctx context.Context, repeated *pb.Repeated) (*pb.Repeated, error) { + return repeated, nil +} + +func (s *service) Maps_(ctx context.Context, maps *pb.Maps) (*pb.Maps, error) { + return maps, nil +} + +func (s *service) Any_(ctx context.Context, a *any.Any) (*any.Any, error) { + println(a.String()) + //_ = json.NewEncoder(os.Stdout).Encode(a) + //var b pb.Bar + //_ = ptypes.UnmarshalAny(a, &b) + //println(b.String()) + return a, nil +} + +func (s *service) Empty_(ctx context.Context, empty *empty.Empty) (*pb.Empty, error) { + return &pb.Empty{}, nil +} + +func (s *service) Empty2_(ctx context.Context, recursive *pb.EmptyRecursive) (*pb.EmptyNested, error) { + panic("implement me") +} + +func (s *service) Empty3_(ctx context.Context, empty3 *pb.Empty3) (*pb.Empty3, error) { + return &pb.Empty3{}, nil +} + +func (s *service) Ref_(ctx context.Context, ref *pb.Ref) (*pb.Ref, error) { + return ref, nil +} + +func (s *service) Oneof_(ctx context.Context, oneof *pb.Oneof) (*pb.Oneof, error) { + return oneof, nil +} + +func (s *service) CallWithId(ctx context.Context, empty *pb.Empty) (*pb.Empty, error) { + return &pb.Empty{}, nil +} diff --git a/example/gateway/constructserver/pb/constructs.pb.go b/example/gateway/constructserver/pb/constructs.pb.go new file mode 100644 index 0000000..9bc679b --- /dev/null +++ b/example/gateway/constructserver/pb/constructs.pb.go @@ -0,0 +1,2627 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: constructserver/pb/constructs.proto + +package pb + +import ( + proto "github.com/golang/protobuf/proto" + any "github.com/golang/protobuf/ptypes/any" + empty "github.com/golang/protobuf/ptypes/empty" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Bar int32 + +const ( + Bar_BAR1 Bar = 0 + Bar_BAR2 Bar = 1 + Bar_BAR3 Bar = 2 +) + +// Enum value maps for Bar. +var ( + Bar_name = map[int32]string{ + 0: "BAR1", + 1: "BAR2", + 2: "BAR3", + } + Bar_value = map[string]int32{ + "BAR1": 0, + "BAR2": 1, + "BAR3": 2, + } +) + +func (x Bar) Enum() *Bar { + p := new(Bar) + *p = x + return p +} + +func (x Bar) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Bar) Descriptor() protoreflect.EnumDescriptor { + return file_constructserver_pb_constructs_proto_enumTypes[0].Descriptor() +} + +func (Bar) Type() protoreflect.EnumType { + return &file_constructserver_pb_constructs_proto_enumTypes[0] +} + +func (x Bar) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Bar.Descriptor instead. +func (Bar) EnumDescriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{0} +} + +type Ref_Foo_En int32 + +const ( + Ref_Foo_A0 Ref_Foo_En = 0 + Ref_Foo_A1 Ref_Foo_En = 1 +) + +// Enum value maps for Ref_Foo_En. +var ( + Ref_Foo_En_name = map[int32]string{ + 0: "A0", + 1: "A1", + } + Ref_Foo_En_value = map[string]int32{ + "A0": 0, + "A1": 1, + } +) + +func (x Ref_Foo_En) Enum() *Ref_Foo_En { + p := new(Ref_Foo_En) + *p = x + return p +} + +func (x Ref_Foo_En) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Ref_Foo_En) Descriptor() protoreflect.EnumDescriptor { + return file_constructserver_pb_constructs_proto_enumTypes[1].Descriptor() +} + +func (Ref_Foo_En) Type() protoreflect.EnumType { + return &file_constructserver_pb_constructs_proto_enumTypes[1] +} + +func (x Ref_Foo_En) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Ref_Foo_En.Descriptor instead. +func (Ref_Foo_En) EnumDescriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{12, 1, 0} +} + +type Ref_Foo_Bar_En int32 + +const ( + Ref_Foo_Bar_A0 Ref_Foo_Bar_En = 0 + Ref_Foo_Bar_A1 Ref_Foo_Bar_En = 1 +) + +// Enum value maps for Ref_Foo_Bar_En. +var ( + Ref_Foo_Bar_En_name = map[int32]string{ + 0: "A0", + 1: "A1", + } + Ref_Foo_Bar_En_value = map[string]int32{ + "A0": 0, + "A1": 1, + } +) + +func (x Ref_Foo_Bar_En) Enum() *Ref_Foo_Bar_En { + p := new(Ref_Foo_Bar_En) + *p = x + return p +} + +func (x Ref_Foo_Bar_En) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Ref_Foo_Bar_En) Descriptor() protoreflect.EnumDescriptor { + return file_constructserver_pb_constructs_proto_enumTypes[2].Descriptor() +} + +func (Ref_Foo_Bar_En) Type() protoreflect.EnumType { + return &file_constructserver_pb_constructs_proto_enumTypes[2] +} + +func (x Ref_Foo_Bar_En) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Ref_Foo_Bar_En.Descriptor instead. +func (Ref_Foo_Bar_En) EnumDescriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{12, 1, 1, 0} +} + +type AnyInput struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Any *any.Any `protobuf:"bytes,1,opt,name=any,proto3" json:"any,omitempty"` +} + +func (x *AnyInput) Reset() { + *x = AnyInput{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AnyInput) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AnyInput) ProtoMessage() {} + +func (x *AnyInput) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AnyInput.ProtoReflect.Descriptor instead. +func (*AnyInput) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{0} +} + +func (x *AnyInput) GetAny() *any.Any { + if x != nil { + return x.Any + } + return nil +} + +type Empty3 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + I *Empty3_Int `protobuf:"bytes,1,opt,name=i,proto3" json:"i,omitempty"` +} + +func (x *Empty3) Reset() { + *x = Empty3{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty3) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty3) ProtoMessage() {} + +func (x *Empty3) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty3.ProtoReflect.Descriptor instead. +func (*Empty3) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{1} +} + +func (x *Empty3) GetI() *Empty3_Int { + if x != nil { + return x.I + } + return nil +} + +type Foo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` + Param2 string `protobuf:"bytes,2,opt,name=param2,proto3" json:"param2,omitempty"` +} + +func (x *Foo) Reset() { + *x = Foo{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Foo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Foo) ProtoMessage() {} + +func (x *Foo) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Foo.ProtoReflect.Descriptor instead. +func (*Foo) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{2} +} + +func (x *Foo) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +func (x *Foo) GetParam2() string { + if x != nil { + return x.Param2 + } + return "" +} + +type Baz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Baz) Reset() { + *x = Baz{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Baz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Baz) ProtoMessage() {} + +func (x *Baz) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Baz.ProtoReflect.Descriptor instead. +func (*Baz) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{3} +} + +func (x *Baz) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +type Scalars struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Double float64 `protobuf:"fixed64,1,opt,name=double,proto3" json:"double,omitempty"` + Float float32 `protobuf:"fixed32,2,opt,name=float,proto3" json:"float,omitempty"` + Int32 int32 `protobuf:"varint,3,opt,name=int32,proto3" json:"int32,omitempty"` + Int64 int64 `protobuf:"varint,4,opt,name=int64,proto3" json:"int64,omitempty"` + Uint32 uint32 `protobuf:"varint,5,opt,name=uint32,proto3" json:"uint32,omitempty"` + Uint64 uint64 `protobuf:"varint,6,opt,name=uint64,proto3" json:"uint64,omitempty"` + Sint32 int32 `protobuf:"zigzag32,7,opt,name=sint32,proto3" json:"sint32,omitempty"` + Sint64 int64 `protobuf:"zigzag64,8,opt,name=sint64,proto3" json:"sint64,omitempty"` + Fixed32 uint32 `protobuf:"fixed32,9,opt,name=fixed32,proto3" json:"fixed32,omitempty"` + Fixed64 uint64 `protobuf:"fixed64,10,opt,name=fixed64,proto3" json:"fixed64,omitempty"` + Sfixed32 int32 `protobuf:"fixed32,11,opt,name=sfixed32,proto3" json:"sfixed32,omitempty"` + Sfixed64 int64 `protobuf:"fixed64,12,opt,name=sfixed64,proto3" json:"sfixed64,omitempty"` + Bool bool `protobuf:"varint,13,opt,name=bool,proto3" json:"bool,omitempty"` + String_ string `protobuf:"bytes,14,opt,name=string,proto3" json:"string,omitempty"` + Bytes []byte `protobuf:"bytes,15,opt,name=bytes,proto3" json:"bytes,omitempty"` + Enum Bar `protobuf:"varint,16,opt,name=enum,proto3,enum=pb.Bar" json:"enum,omitempty"` +} + +func (x *Scalars) Reset() { + *x = Scalars{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Scalars) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Scalars) ProtoMessage() {} + +func (x *Scalars) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Scalars.ProtoReflect.Descriptor instead. +func (*Scalars) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{4} +} + +func (x *Scalars) GetDouble() float64 { + if x != nil { + return x.Double + } + return 0 +} + +func (x *Scalars) GetFloat() float32 { + if x != nil { + return x.Float + } + return 0 +} + +func (x *Scalars) GetInt32() int32 { + if x != nil { + return x.Int32 + } + return 0 +} + +func (x *Scalars) GetInt64() int64 { + if x != nil { + return x.Int64 + } + return 0 +} + +func (x *Scalars) GetUint32() uint32 { + if x != nil { + return x.Uint32 + } + return 0 +} + +func (x *Scalars) GetUint64() uint64 { + if x != nil { + return x.Uint64 + } + return 0 +} + +func (x *Scalars) GetSint32() int32 { + if x != nil { + return x.Sint32 + } + return 0 +} + +func (x *Scalars) GetSint64() int64 { + if x != nil { + return x.Sint64 + } + return 0 +} + +func (x *Scalars) GetFixed32() uint32 { + if x != nil { + return x.Fixed32 + } + return 0 +} + +func (x *Scalars) GetFixed64() uint64 { + if x != nil { + return x.Fixed64 + } + return 0 +} + +func (x *Scalars) GetSfixed32() int32 { + if x != nil { + return x.Sfixed32 + } + return 0 +} + +func (x *Scalars) GetSfixed64() int64 { + if x != nil { + return x.Sfixed64 + } + return 0 +} + +func (x *Scalars) GetBool() bool { + if x != nil { + return x.Bool + } + return false +} + +func (x *Scalars) GetString_() string { + if x != nil { + return x.String_ + } + return "" +} + +func (x *Scalars) GetBytes() []byte { + if x != nil { + return x.Bytes + } + return nil +} + +func (x *Scalars) GetEnum() Bar { + if x != nil { + return x.Enum + } + return Bar_BAR1 +} + +type Repeated struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Double []float64 `protobuf:"fixed64,1,rep,packed,name=double,proto3" json:"double,omitempty"` + Float []float32 `protobuf:"fixed32,2,rep,packed,name=float,proto3" json:"float,omitempty"` + Int32 []int32 `protobuf:"varint,3,rep,packed,name=int32,proto3" json:"int32,omitempty"` + Int64 []int64 `protobuf:"varint,4,rep,packed,name=int64,proto3" json:"int64,omitempty"` + Uint32 []uint32 `protobuf:"varint,5,rep,packed,name=uint32,proto3" json:"uint32,omitempty"` + Uint64 []uint64 `protobuf:"varint,6,rep,packed,name=uint64,proto3" json:"uint64,omitempty"` + Sint32 []int32 `protobuf:"zigzag32,7,rep,packed,name=sint32,proto3" json:"sint32,omitempty"` + Sint64 []int64 `protobuf:"zigzag64,8,rep,packed,name=sint64,proto3" json:"sint64,omitempty"` + Fixed32 []uint32 `protobuf:"fixed32,9,rep,packed,name=fixed32,proto3" json:"fixed32,omitempty"` + Fixed64 []uint64 `protobuf:"fixed64,10,rep,packed,name=fixed64,proto3" json:"fixed64,omitempty"` + Sfixed32 []int32 `protobuf:"fixed32,11,rep,packed,name=sfixed32,proto3" json:"sfixed32,omitempty"` + Sfixed64 []int64 `protobuf:"fixed64,12,rep,packed,name=sfixed64,proto3" json:"sfixed64,omitempty"` + Bool []bool `protobuf:"varint,13,rep,packed,name=bool,proto3" json:"bool,omitempty"` + String_ []string `protobuf:"bytes,14,rep,name=string,proto3" json:"string,omitempty"` + Bytes [][]byte `protobuf:"bytes,15,rep,name=bytes,proto3" json:"bytes,omitempty"` + Foo []*Foo `protobuf:"bytes,16,rep,name=foo,proto3" json:"foo,omitempty"` + Bar []Bar `protobuf:"varint,17,rep,packed,name=bar,proto3,enum=pb.Bar" json:"bar,omitempty"` +} + +func (x *Repeated) Reset() { + *x = Repeated{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Repeated) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Repeated) ProtoMessage() {} + +func (x *Repeated) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Repeated.ProtoReflect.Descriptor instead. +func (*Repeated) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{5} +} + +func (x *Repeated) GetDouble() []float64 { + if x != nil { + return x.Double + } + return nil +} + +func (x *Repeated) GetFloat() []float32 { + if x != nil { + return x.Float + } + return nil +} + +func (x *Repeated) GetInt32() []int32 { + if x != nil { + return x.Int32 + } + return nil +} + +func (x *Repeated) GetInt64() []int64 { + if x != nil { + return x.Int64 + } + return nil +} + +func (x *Repeated) GetUint32() []uint32 { + if x != nil { + return x.Uint32 + } + return nil +} + +func (x *Repeated) GetUint64() []uint64 { + if x != nil { + return x.Uint64 + } + return nil +} + +func (x *Repeated) GetSint32() []int32 { + if x != nil { + return x.Sint32 + } + return nil +} + +func (x *Repeated) GetSint64() []int64 { + if x != nil { + return x.Sint64 + } + return nil +} + +func (x *Repeated) GetFixed32() []uint32 { + if x != nil { + return x.Fixed32 + } + return nil +} + +func (x *Repeated) GetFixed64() []uint64 { + if x != nil { + return x.Fixed64 + } + return nil +} + +func (x *Repeated) GetSfixed32() []int32 { + if x != nil { + return x.Sfixed32 + } + return nil +} + +func (x *Repeated) GetSfixed64() []int64 { + if x != nil { + return x.Sfixed64 + } + return nil +} + +func (x *Repeated) GetBool() []bool { + if x != nil { + return x.Bool + } + return nil +} + +func (x *Repeated) GetString_() []string { + if x != nil { + return x.String_ + } + return nil +} + +func (x *Repeated) GetBytes() [][]byte { + if x != nil { + return x.Bytes + } + return nil +} + +func (x *Repeated) GetFoo() []*Foo { + if x != nil { + return x.Foo + } + return nil +} + +func (x *Repeated) GetBar() []Bar { + if x != nil { + return x.Bar + } + return nil +} + +type Maps struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Int32Int32 map[int32]int32 `protobuf:"bytes,1,rep,name=int32_int32,json=int32Int32,proto3" json:"int32_int32,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Int64Int64 map[int64]int64 `protobuf:"bytes,2,rep,name=int64_int64,json=int64Int64,proto3" json:"int64_int64,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint32Uint32 map[uint32]uint32 `protobuf:"bytes,3,rep,name=uint32_uint32,json=uint32Uint32,proto3" json:"uint32_uint32,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Uint64Uint64 map[uint64]uint64 `protobuf:"bytes,4,rep,name=uint64_uint64,json=uint64Uint64,proto3" json:"uint64_uint64,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + Sint32Sint32 map[int32]int32 `protobuf:"bytes,5,rep,name=sint32_sint32,json=sint32Sint32,proto3" json:"sint32_sint32,omitempty" protobuf_key:"zigzag32,1,opt,name=key,proto3" protobuf_val:"zigzag32,2,opt,name=value,proto3"` + Sint64Sint64 map[int64]int64 `protobuf:"bytes,6,rep,name=sint64_sint64,json=sint64Sint64,proto3" json:"sint64_sint64,omitempty" protobuf_key:"zigzag64,1,opt,name=key,proto3" protobuf_val:"zigzag64,2,opt,name=value,proto3"` + Fixed32Fixed32 map[uint32]uint32 `protobuf:"bytes,7,rep,name=fixed32_fixed32,json=fixed32Fixed32,proto3" json:"fixed32_fixed32,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Fixed64Fixed64 map[uint64]uint64 `protobuf:"bytes,8,rep,name=fixed64_fixed64,json=fixed64Fixed64,proto3" json:"fixed64_fixed64,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + Sfixed32Sfixed32 map[int32]int32 `protobuf:"bytes,9,rep,name=sfixed32_sfixed32,json=sfixed32Sfixed32,proto3" json:"sfixed32_sfixed32,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + Sfixed64Sfixed64 map[int64]int64 `protobuf:"bytes,10,rep,name=sfixed64_sfixed64,json=sfixed64Sfixed64,proto3" json:"sfixed64_sfixed64,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + BoolBool map[bool]bool `protobuf:"bytes,11,rep,name=bool_bool,json=boolBool,proto3" json:"bool_bool,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + StringString map[string]string `protobuf:"bytes,12,rep,name=string_string,json=stringString,proto3" json:"string_string,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBytes map[string][]byte `protobuf:"bytes,15,rep,name=string_bytes,json=stringBytes,proto3" json:"string_bytes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringFloat map[string]float32 `protobuf:"bytes,16,rep,name=string_float,json=stringFloat,proto3" json:"string_float,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` + StringDouble map[string]float64 `protobuf:"bytes,17,rep,name=string_double,json=stringDouble,proto3" json:"string_double,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` + StringFoo map[string]*Foo `protobuf:"bytes,13,rep,name=string_foo,json=stringFoo,proto3" json:"string_foo,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + StringBar map[string]Bar `protobuf:"bytes,14,rep,name=string_bar,json=stringBar,proto3" json:"string_bar,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=pb.Bar"` +} + +func (x *Maps) Reset() { + *x = Maps{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Maps) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Maps) ProtoMessage() {} + +func (x *Maps) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Maps.ProtoReflect.Descriptor instead. +func (*Maps) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{6} +} + +func (x *Maps) GetInt32Int32() map[int32]int32 { + if x != nil { + return x.Int32Int32 + } + return nil +} + +func (x *Maps) GetInt64Int64() map[int64]int64 { + if x != nil { + return x.Int64Int64 + } + return nil +} + +func (x *Maps) GetUint32Uint32() map[uint32]uint32 { + if x != nil { + return x.Uint32Uint32 + } + return nil +} + +func (x *Maps) GetUint64Uint64() map[uint64]uint64 { + if x != nil { + return x.Uint64Uint64 + } + return nil +} + +func (x *Maps) GetSint32Sint32() map[int32]int32 { + if x != nil { + return x.Sint32Sint32 + } + return nil +} + +func (x *Maps) GetSint64Sint64() map[int64]int64 { + if x != nil { + return x.Sint64Sint64 + } + return nil +} + +func (x *Maps) GetFixed32Fixed32() map[uint32]uint32 { + if x != nil { + return x.Fixed32Fixed32 + } + return nil +} + +func (x *Maps) GetFixed64Fixed64() map[uint64]uint64 { + if x != nil { + return x.Fixed64Fixed64 + } + return nil +} + +func (x *Maps) GetSfixed32Sfixed32() map[int32]int32 { + if x != nil { + return x.Sfixed32Sfixed32 + } + return nil +} + +func (x *Maps) GetSfixed64Sfixed64() map[int64]int64 { + if x != nil { + return x.Sfixed64Sfixed64 + } + return nil +} + +func (x *Maps) GetBoolBool() map[bool]bool { + if x != nil { + return x.BoolBool + } + return nil +} + +func (x *Maps) GetStringString() map[string]string { + if x != nil { + return x.StringString + } + return nil +} + +func (x *Maps) GetStringBytes() map[string][]byte { + if x != nil { + return x.StringBytes + } + return nil +} + +func (x *Maps) GetStringFloat() map[string]float32 { + if x != nil { + return x.StringFloat + } + return nil +} + +func (x *Maps) GetStringDouble() map[string]float64 { + if x != nil { + return x.StringDouble + } + return nil +} + +func (x *Maps) GetStringFoo() map[string]*Foo { + if x != nil { + return x.StringFoo + } + return nil +} + +func (x *Maps) GetStringBar() map[string]Bar { + if x != nil { + return x.StringBar + } + return nil +} + +type Any struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Any *any.Any `protobuf:"bytes,1,opt,name=any,proto3" json:"any,omitempty"` +} + +func (x *Any) Reset() { + *x = Any{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Any) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Any) ProtoMessage() {} + +func (x *Any) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Any.ProtoReflect.Descriptor instead. +func (*Any) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{7} +} + +func (x *Any) GetAny() *any.Any { + if x != nil { + return x.Any + } + return nil +} + +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{8} +} + +type EmptyRecursive struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // google.protobuf.Empty nested1 = 1; + Empty *EmptyRecursive `protobuf:"bytes,2,opt,name=empty,proto3" json:"empty,omitempty"` +} + +func (x *EmptyRecursive) Reset() { + *x = EmptyRecursive{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyRecursive) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyRecursive) ProtoMessage() {} + +func (x *EmptyRecursive) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyRecursive.ProtoReflect.Descriptor instead. +func (*EmptyRecursive) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{9} +} + +func (x *EmptyRecursive) GetEmpty() *EmptyRecursive { + if x != nil { + return x.Empty + } + return nil +} + +type EmptyNested struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nested1 *EmptyNested_EmptyNested1 `protobuf:"bytes,1,opt,name=nested1,proto3" json:"nested1,omitempty"` +} + +func (x *EmptyNested) Reset() { + *x = EmptyNested{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyNested) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyNested) ProtoMessage() {} + +func (x *EmptyNested) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyNested.ProtoReflect.Descriptor instead. +func (*EmptyNested) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{10} +} + +func (x *EmptyNested) GetNested1() *EmptyNested_EmptyNested1 { + if x != nil { + return x.Nested1 + } + return nil +} + +type Timestamp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Time string `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` +} + +func (x *Timestamp) Reset() { + *x = Timestamp{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Timestamp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Timestamp) ProtoMessage() {} + +func (x *Timestamp) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Timestamp.ProtoReflect.Descriptor instead. +func (*Timestamp) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{11} +} + +func (x *Timestamp) GetTime() string { + if x != nil { + return x.Time + } + return "" +} + +type Ref struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LocalTime2 *Timestamp `protobuf:"bytes,12,opt,name=local_time2,json=localTime2,proto3" json:"local_time2,omitempty"` + External *timestamp.Timestamp `protobuf:"bytes,1,opt,name=external,proto3" json:"external,omitempty"` + LocalTime *Timestamp `protobuf:"bytes,11,opt,name=local_time,json=localTime,proto3" json:"local_time,omitempty"` + File *Baz `protobuf:"bytes,2,opt,name=file,proto3" json:"file,omitempty"` + FileMsg *Foo `protobuf:"bytes,8,opt,name=file_msg,json=fileMsg,proto3" json:"file_msg,omitempty"` + FileEnum Bar `protobuf:"varint,9,opt,name=file_enum,json=fileEnum,proto3,enum=pb.Bar" json:"file_enum,omitempty"` + Local *Ref_Foo `protobuf:"bytes,3,opt,name=local,proto3" json:"local,omitempty"` + Foreign *Foo_Foo2 `protobuf:"bytes,4,opt,name=foreign,proto3" json:"foreign,omitempty"` + En1 Ref_Foo_En `protobuf:"varint,5,opt,name=en1,proto3,enum=pb.Ref_Foo_En" json:"en1,omitempty"` + En2 Ref_Foo_Bar_En `protobuf:"varint,6,opt,name=en2,proto3,enum=pb.Ref_Foo_Bar_En" json:"en2,omitempty"` + Gz *Ref_Foo_Baz_Gz `protobuf:"bytes,7,opt,name=gz,proto3" json:"gz,omitempty"` +} + +func (x *Ref) Reset() { + *x = Ref{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref) ProtoMessage() {} + +func (x *Ref) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref.ProtoReflect.Descriptor instead. +func (*Ref) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{12} +} + +func (x *Ref) GetLocalTime2() *Timestamp { + if x != nil { + return x.LocalTime2 + } + return nil +} + +func (x *Ref) GetExternal() *timestamp.Timestamp { + if x != nil { + return x.External + } + return nil +} + +func (x *Ref) GetLocalTime() *Timestamp { + if x != nil { + return x.LocalTime + } + return nil +} + +func (x *Ref) GetFile() *Baz { + if x != nil { + return x.File + } + return nil +} + +func (x *Ref) GetFileMsg() *Foo { + if x != nil { + return x.FileMsg + } + return nil +} + +func (x *Ref) GetFileEnum() Bar { + if x != nil { + return x.FileEnum + } + return Bar_BAR1 +} + +func (x *Ref) GetLocal() *Ref_Foo { + if x != nil { + return x.Local + } + return nil +} + +func (x *Ref) GetForeign() *Foo_Foo2 { + if x != nil { + return x.Foreign + } + return nil +} + +func (x *Ref) GetEn1() Ref_Foo_En { + if x != nil { + return x.En1 + } + return Ref_Foo_A0 +} + +func (x *Ref) GetEn2() Ref_Foo_Bar_En { + if x != nil { + return x.En2 + } + return Ref_Foo_Bar_A0 +} + +func (x *Ref) GetGz() *Ref_Foo_Baz_Gz { + if x != nil { + return x.Gz + } + return nil +} + +type Oneof struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` + // Types that are assignable to Oneof1: + // *Oneof_Param2 + // *Oneof_Param3 + Oneof1 isOneof_Oneof1 `protobuf_oneof:"Oneof1"` + // Types that are assignable to Oneof2: + // *Oneof_Param4 + // *Oneof_Param5 + Oneof2 isOneof_Oneof2 `protobuf_oneof:"Oneof2"` + // Types that are assignable to Oneof3: + // *Oneof_Param6 + Oneof3 isOneof_Oneof3 `protobuf_oneof:"Oneof3"` +} + +func (x *Oneof) Reset() { + *x = Oneof{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Oneof) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Oneof) ProtoMessage() {} + +func (x *Oneof) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Oneof.ProtoReflect.Descriptor instead. +func (*Oneof) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{13} +} + +func (x *Oneof) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +func (m *Oneof) GetOneof1() isOneof_Oneof1 { + if m != nil { + return m.Oneof1 + } + return nil +} + +func (x *Oneof) GetParam2() string { + if x, ok := x.GetOneof1().(*Oneof_Param2); ok { + return x.Param2 + } + return "" +} + +func (x *Oneof) GetParam3() string { + if x, ok := x.GetOneof1().(*Oneof_Param3); ok { + return x.Param3 + } + return "" +} + +func (m *Oneof) GetOneof2() isOneof_Oneof2 { + if m != nil { + return m.Oneof2 + } + return nil +} + +func (x *Oneof) GetParam4() string { + if x, ok := x.GetOneof2().(*Oneof_Param4); ok { + return x.Param4 + } + return "" +} + +func (x *Oneof) GetParam5() string { + if x, ok := x.GetOneof2().(*Oneof_Param5); ok { + return x.Param5 + } + return "" +} + +func (m *Oneof) GetOneof3() isOneof_Oneof3 { + if m != nil { + return m.Oneof3 + } + return nil +} + +func (x *Oneof) GetParam6() string { + if x, ok := x.GetOneof3().(*Oneof_Param6); ok { + return x.Param6 + } + return "" +} + +type isOneof_Oneof1 interface { + isOneof_Oneof1() +} + +type Oneof_Param2 struct { + Param2 string `protobuf:"bytes,2,opt,name=param2,proto3,oneof"` +} + +type Oneof_Param3 struct { + Param3 string `protobuf:"bytes,3,opt,name=param3,proto3,oneof"` +} + +func (*Oneof_Param2) isOneof_Oneof1() {} + +func (*Oneof_Param3) isOneof_Oneof1() {} + +type isOneof_Oneof2 interface { + isOneof_Oneof2() +} + +type Oneof_Param4 struct { + Param4 string `protobuf:"bytes,4,opt,name=param4,proto3,oneof"` +} + +type Oneof_Param5 struct { + Param5 string `protobuf:"bytes,5,opt,name=param5,proto3,oneof"` +} + +func (*Oneof_Param4) isOneof_Oneof2() {} + +func (*Oneof_Param5) isOneof_Oneof2() {} + +type isOneof_Oneof3 interface { + isOneof_Oneof3() +} + +type Oneof_Param6 struct { + Param6 string `protobuf:"bytes,6,opt,name=param6,proto3,oneof"` +} + +func (*Oneof_Param6) isOneof_Oneof3() {} + +type Empty3_Int struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + E *Empty3 `protobuf:"bytes,1,opt,name=e,proto3" json:"e,omitempty"` +} + +func (x *Empty3_Int) Reset() { + *x = Empty3_Int{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty3_Int) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty3_Int) ProtoMessage() {} + +func (x *Empty3_Int) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty3_Int.ProtoReflect.Descriptor instead. +func (*Empty3_Int) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *Empty3_Int) GetE() *Empty3 { + if x != nil { + return x.E + } + return nil +} + +type Foo_Foo2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Foo_Foo2) Reset() { + *x = Foo_Foo2{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Foo_Foo2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Foo_Foo2) ProtoMessage() {} + +func (x *Foo_Foo2) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Foo_Foo2.ProtoReflect.Descriptor instead. +func (*Foo_Foo2) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{2, 0} +} + +func (x *Foo_Foo2) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +type EmptyNested_EmptyNested1 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nested2 *EmptyNested_EmptyNested1_EmptyNested2 `protobuf:"bytes,1,opt,name=nested2,proto3" json:"nested2,omitempty"` +} + +func (x *EmptyNested_EmptyNested1) Reset() { + *x = EmptyNested_EmptyNested1{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyNested_EmptyNested1) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyNested_EmptyNested1) ProtoMessage() {} + +func (x *EmptyNested_EmptyNested1) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[33] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyNested_EmptyNested1.ProtoReflect.Descriptor instead. +func (*EmptyNested_EmptyNested1) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{10, 0} +} + +func (x *EmptyNested_EmptyNested1) GetNested2() *EmptyNested_EmptyNested1_EmptyNested2 { + if x != nil { + return x.Nested2 + } + return nil +} + +type EmptyNested_EmptyNested1_EmptyNested2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EmptyNested_EmptyNested1_EmptyNested2) Reset() { + *x = EmptyNested_EmptyNested1_EmptyNested2{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EmptyNested_EmptyNested1_EmptyNested2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EmptyNested_EmptyNested1_EmptyNested2) ProtoMessage() {} + +func (x *EmptyNested_EmptyNested1_EmptyNested2) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EmptyNested_EmptyNested1_EmptyNested2.ProtoReflect.Descriptor instead. +func (*EmptyNested_EmptyNested1_EmptyNested2) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{10, 0, 0} +} + +// google.protobuf.Empty empty = 10; // must disappear as part of is empty validation +type Ref_Bar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Ref_Bar) Reset() { + *x = Ref_Bar{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Bar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Bar) ProtoMessage() {} + +func (x *Ref_Bar) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Bar.ProtoReflect.Descriptor instead. +func (*Ref_Bar) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *Ref_Bar) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +type Ref_Foo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Bar1 *Ref_Foo_Bar `protobuf:"bytes,1,opt,name=bar1,proto3" json:"bar1,omitempty"` + LocalTime2 *Timestamp `protobuf:"bytes,12,opt,name=local_time2,json=localTime2,proto3" json:"local_time2,omitempty"` + ExternalTime1 *timestamp.Timestamp `protobuf:"bytes,13,opt,name=external_time1,json=externalTime1,proto3" json:"external_time1,omitempty"` + Bar2 *Ref_Bar `protobuf:"bytes,2,opt,name=bar2,proto3" json:"bar2,omitempty"` + En1 Ref_Foo_En `protobuf:"varint,3,opt,name=en1,proto3,enum=pb.Ref_Foo_En" json:"en1,omitempty"` + En2 Ref_Foo_Bar_En `protobuf:"varint,4,opt,name=en2,proto3,enum=pb.Ref_Foo_Bar_En" json:"en2,omitempty"` +} + +func (x *Ref_Foo) Reset() { + *x = Ref_Foo{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Foo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Foo) ProtoMessage() {} + +func (x *Ref_Foo) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[36] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Foo.ProtoReflect.Descriptor instead. +func (*Ref_Foo) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{12, 1} +} + +func (x *Ref_Foo) GetBar1() *Ref_Foo_Bar { + if x != nil { + return x.Bar1 + } + return nil +} + +func (x *Ref_Foo) GetLocalTime2() *Timestamp { + if x != nil { + return x.LocalTime2 + } + return nil +} + +func (x *Ref_Foo) GetExternalTime1() *timestamp.Timestamp { + if x != nil { + return x.ExternalTime1 + } + return nil +} + +func (x *Ref_Foo) GetBar2() *Ref_Bar { + if x != nil { + return x.Bar2 + } + return nil +} + +func (x *Ref_Foo) GetEn1() Ref_Foo_En { + if x != nil { + return x.En1 + } + return Ref_Foo_A0 +} + +func (x *Ref_Foo) GetEn2() Ref_Foo_Bar_En { + if x != nil { + return x.En2 + } + return Ref_Foo_Bar_A0 +} + +type Ref_Foo_Baz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Ref_Foo_Baz) Reset() { + *x = Ref_Foo_Baz{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[37] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Foo_Baz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Foo_Baz) ProtoMessage() {} + +func (x *Ref_Foo_Baz) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[37] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Foo_Baz.ProtoReflect.Descriptor instead. +func (*Ref_Foo_Baz) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{12, 1, 0} +} + +type Ref_Foo_Bar struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Ref_Foo_Bar) Reset() { + *x = Ref_Foo_Bar{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[38] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Foo_Bar) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Foo_Bar) ProtoMessage() {} + +func (x *Ref_Foo_Bar) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[38] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Foo_Bar.ProtoReflect.Descriptor instead. +func (*Ref_Foo_Bar) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{12, 1, 1} +} + +func (x *Ref_Foo_Bar) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +type Ref_Foo_Baz_Gz struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Ref_Foo_Baz_Gz) Reset() { + *x = Ref_Foo_Baz_Gz{} + if protoimpl.UnsafeEnabled { + mi := &file_constructserver_pb_constructs_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Ref_Foo_Baz_Gz) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Ref_Foo_Baz_Gz) ProtoMessage() {} + +func (x *Ref_Foo_Baz_Gz) ProtoReflect() protoreflect.Message { + mi := &file_constructserver_pb_constructs_proto_msgTypes[39] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Ref_Foo_Baz_Gz.ProtoReflect.Descriptor instead. +func (*Ref_Foo_Baz_Gz) Descriptor() ([]byte, []int) { + return file_constructserver_pb_constructs_proto_rawDescGZIP(), []int{12, 1, 0, 0} +} + +func (x *Ref_Foo_Baz_Gz) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +var File_constructserver_pb_constructs_proto protoreflect.FileDescriptor + +var file_constructserver_pb_constructs_proto_rawDesc = []byte{ + 0x0a, 0x23, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x22, 0x32, 0x0a, 0x08, 0x41, 0x6e, 0x79, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x26, + 0x0a, 0x03, 0x61, 0x6e, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, + 0x79, 0x52, 0x03, 0x61, 0x6e, 0x79, 0x22, 0x47, 0x0a, 0x06, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x33, + 0x12, 0x1c, 0x0a, 0x01, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x33, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x01, 0x69, 0x1a, 0x1f, + 0x0a, 0x03, 0x49, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x01, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x33, 0x52, 0x01, 0x65, 0x22, + 0x55, 0x0a, 0x03, 0x46, 0x6f, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x12, 0x16, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x32, 0x1a, 0x1e, 0x0a, 0x04, 0x46, 0x6f, 0x6f, 0x32, 0x12, 0x16, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x22, 0x1d, 0x0a, 0x03, 0x42, 0x61, 0x7a, 0x12, 0x16, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x31, 0x22, 0x8e, 0x03, 0x0a, 0x07, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x01, 0x52, 0x06, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x6f, + 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x16, 0x0a, 0x06, 0x75, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x75, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x07, 0x20, 0x01, 0x28, 0x11, 0x52, 0x06, 0x73, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x12, 0x52, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x18, 0x0a, 0x07, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x07, 0x52, 0x07, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x06, 0x52, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, + 0x1a, 0x0a, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x0f, 0x52, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x1a, 0x0a, 0x08, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x10, 0x52, 0x08, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x04, 0x65, 0x6e, 0x75, + 0x6d, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x72, + 0x52, 0x04, 0x65, 0x6e, 0x75, 0x6d, 0x22, 0xa8, 0x03, 0x0a, 0x08, 0x52, 0x65, 0x70, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x01, 0x52, 0x06, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, + 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x02, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x61, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, + 0x52, 0x05, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x16, 0x0a, + 0x06, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x06, 0x75, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x07, 0x20, 0x03, 0x28, 0x11, 0x52, 0x06, 0x73, + 0x69, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x12, 0x52, 0x06, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x18, 0x0a, + 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x09, 0x20, 0x03, 0x28, 0x07, 0x52, 0x07, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x06, 0x52, 0x07, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, + 0x34, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x0b, 0x20, + 0x03, 0x28, 0x0f, 0x52, 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x1a, 0x0a, + 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x10, 0x52, + 0x08, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x6f, + 0x6c, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x08, 0x52, 0x04, 0x62, 0x6f, 0x6f, 0x6c, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x0f, + 0x20, 0x03, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x12, 0x19, 0x0a, 0x03, 0x66, + 0x6f, 0x6f, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x6f, + 0x6f, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x19, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x11, 0x20, + 0x03, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x72, 0x52, 0x03, 0x62, 0x61, + 0x72, 0x22, 0xaa, 0x11, 0x0a, 0x04, 0x4d, 0x61, 0x70, 0x73, 0x12, 0x39, 0x0a, 0x0b, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x5f, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x49, + 0x6e, 0x74, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x49, 0x6e, 0x74, 0x33, 0x32, 0x12, 0x39, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x49, 0x6e, 0x74, 0x36, 0x34, + 0x12, 0x3f, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x75, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, + 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x55, 0x69, 0x6e, 0x74, 0x33, + 0x32, 0x12, 0x3f, 0x0a, 0x0d, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x75, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, + 0x70, 0x73, 0x2e, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x55, 0x69, 0x6e, 0x74, + 0x36, 0x34, 0x12, 0x3f, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x73, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4d, + 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x69, 0x6e, + 0x74, 0x33, 0x32, 0x12, 0x3f, 0x0a, 0x0d, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x73, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x69, + 0x6e, 0x74, 0x36, 0x34, 0x12, 0x45, 0x0a, 0x0f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x33, 0x32, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, 0x45, 0x0a, 0x0f, 0x66, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x0e, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x46, 0x69, 0x78, 0x65, 0x64, + 0x36, 0x34, 0x12, 0x4b, 0x0a, 0x11, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x5f, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, + 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, + 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x12, + 0x4b, 0x0a, 0x11, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x5f, 0x73, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x70, 0x62, 0x2e, + 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x66, 0x69, + 0x78, 0x65, 0x64, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x66, 0x69, 0x78, + 0x65, 0x64, 0x36, 0x34, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x12, 0x33, 0x0a, 0x09, + 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x62, 0x6f, 0x6f, 0x6c, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x42, 0x6f, + 0x6f, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x6c, 0x42, 0x6f, 0x6f, + 0x6c, 0x12, 0x3f, 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, + 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x12, 0x3c, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x62, 0x79, 0x74, + 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, + 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x12, 0x3c, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x6f, 0x61, 0x74, + 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x12, 0x3f, + 0x0a, 0x0d, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x18, + 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x12, + 0x36, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6f, 0x6f, 0x18, 0x0d, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x6f, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x73, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x6f, 0x12, 0x36, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x62, 0x61, 0x72, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x62, + 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x72, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x61, 0x72, 0x1a, + 0x3d, 0x0a, 0x0f, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3d, + 0x0a, 0x0f, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, 0x0a, + 0x11, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x55, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, + 0x0a, 0x11, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x55, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x3f, 0x0a, 0x11, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x53, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x11, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x11, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x3f, 0x0a, 0x11, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x53, 0x69, 0x6e, 0x74, 0x36, 0x34, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x12, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x46, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x46, 0x69, 0x78, 0x65, + 0x64, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x07, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x41, 0x0a, 0x13, 0x46, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x46, + 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x06, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x06, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x66, 0x69, 0x78, 0x65, + 0x64, 0x33, 0x32, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, + 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x53, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x10, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x10, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x42, 0x6f, 0x6f, 0x6c, 0x42, 0x6f, 0x6f, 0x6c, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3f, + 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x3e, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x3e, 0x0a, 0x10, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x3f, 0x0a, 0x11, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x45, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6f, 0x6f, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x45, 0x0a, 0x0e, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x42, 0x61, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1d, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, + 0x42, 0x61, 0x72, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2d, + 0x0a, 0x03, 0x41, 0x6e, 0x79, 0x12, 0x26, 0x0a, 0x03, 0x61, 0x6e, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x03, 0x61, 0x6e, 0x79, 0x22, 0x07, 0x0a, + 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3a, 0x0a, 0x0e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, + 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, + 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x52, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x52, 0x05, 0x65, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0xaa, 0x01, 0x0a, 0x0b, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, + 0x65, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x31, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, + 0x31, 0x52, 0x07, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x31, 0x1a, 0x63, 0x0a, 0x0c, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x31, 0x12, 0x43, 0x0a, 0x07, 0x6e, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x62, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x32, 0x52, 0x07, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x32, 0x1a, + 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x32, 0x22, + 0x1f, 0x0a, 0x09, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, + 0x22, 0xd1, 0x06, 0x0a, 0x03, 0x52, 0x65, 0x66, 0x12, 0x2e, 0x0a, 0x0b, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x12, 0x36, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x12, 0x2c, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x52, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, + 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x70, + 0x62, 0x2e, 0x42, 0x61, 0x7a, 0x52, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x22, 0x0a, 0x08, 0x66, + 0x69, 0x6c, 0x65, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, + 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x65, 0x4d, 0x73, 0x67, 0x12, + 0x24, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x72, 0x52, 0x08, 0x66, 0x69, 0x6c, + 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x21, 0x0a, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, + 0x6f, 0x52, 0x05, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x12, 0x26, 0x0a, 0x07, 0x66, 0x6f, 0x72, 0x65, + 0x69, 0x67, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x46, + 0x6f, 0x6f, 0x2e, 0x46, 0x6f, 0x6f, 0x32, 0x52, 0x07, 0x66, 0x6f, 0x72, 0x65, 0x69, 0x67, 0x6e, + 0x12, 0x20, 0x0a, 0x03, 0x65, 0x6e, 0x31, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, 0x45, 0x6e, 0x52, 0x03, 0x65, + 0x6e, 0x31, 0x12, 0x24, 0x0a, 0x03, 0x65, 0x6e, 0x32, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, 0x42, 0x61, 0x72, + 0x2e, 0x45, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x32, 0x12, 0x22, 0x0a, 0x02, 0x67, 0x7a, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, + 0x6f, 0x2e, 0x42, 0x61, 0x7a, 0x2e, 0x47, 0x7a, 0x52, 0x02, 0x67, 0x7a, 0x1a, 0x1d, 0x0a, 0x03, + 0x42, 0x61, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x1a, 0xf6, 0x02, 0x0a, 0x03, + 0x46, 0x6f, 0x6f, 0x12, 0x23, 0x0a, 0x04, 0x62, 0x61, 0x72, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, 0x42, + 0x61, 0x72, 0x52, 0x04, 0x62, 0x61, 0x72, 0x31, 0x12, 0x2e, 0x0a, 0x0b, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x70, 0x62, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x6f, + 0x63, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x12, 0x41, 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x31, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x65, 0x78, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x31, 0x12, 0x1f, 0x0a, 0x04, 0x62, + 0x61, 0x72, 0x32, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x52, + 0x65, 0x66, 0x2e, 0x42, 0x61, 0x72, 0x52, 0x04, 0x62, 0x61, 0x72, 0x32, 0x12, 0x20, 0x0a, 0x03, + 0x65, 0x6e, 0x31, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, + 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, 0x45, 0x6e, 0x52, 0x03, 0x65, 0x6e, 0x31, 0x12, 0x24, + 0x0a, 0x03, 0x65, 0x6e, 0x32, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x66, 0x2e, 0x46, 0x6f, 0x6f, 0x2e, 0x42, 0x61, 0x72, 0x2e, 0x45, 0x6e, 0x52, + 0x03, 0x65, 0x6e, 0x32, 0x1a, 0x23, 0x0a, 0x03, 0x42, 0x61, 0x7a, 0x1a, 0x1c, 0x0a, 0x02, 0x47, + 0x7a, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x1a, 0x33, 0x0a, 0x03, 0x42, 0x61, 0x72, + 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x22, 0x14, 0x0a, 0x02, 0x45, 0x6e, 0x12, 0x06, + 0x0a, 0x02, 0x41, 0x30, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x41, 0x31, 0x10, 0x01, 0x22, 0x14, + 0x0a, 0x02, 0x45, 0x6e, 0x12, 0x06, 0x0a, 0x02, 0x41, 0x30, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, + 0x41, 0x31, 0x10, 0x01, 0x22, 0xbf, 0x01, 0x0a, 0x05, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x12, 0x16, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x31, 0x12, 0x18, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x32, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x32, + 0x12, 0x18, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x33, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x33, 0x12, 0x18, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x34, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x34, 0x12, 0x18, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x35, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x35, 0x12, 0x18, + 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x36, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x36, 0x42, 0x08, 0x0a, 0x06, 0x4f, 0x6e, 0x65, 0x6f, + 0x66, 0x31, 0x42, 0x08, 0x0a, 0x06, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x32, 0x42, 0x08, 0x0a, 0x06, + 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x33, 0x2a, 0x23, 0x0a, 0x03, 0x42, 0x61, 0x72, 0x12, 0x08, 0x0a, + 0x04, 0x42, 0x41, 0x52, 0x31, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x41, 0x52, 0x32, 0x10, + 0x01, 0x12, 0x08, 0x0a, 0x04, 0x42, 0x41, 0x52, 0x33, 0x10, 0x02, 0x32, 0xac, 0x03, 0x0a, 0x0a, + 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x73, 0x12, 0x24, 0x0a, 0x08, 0x53, 0x63, + 0x61, 0x6c, 0x61, 0x72, 0x73, 0x5f, 0x12, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x61, 0x6c, + 0x61, 0x72, 0x73, 0x1a, 0x0b, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x63, 0x61, 0x6c, 0x61, 0x72, 0x73, + 0x12, 0x27, 0x0a, 0x09, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x12, 0x0c, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x1a, 0x0c, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x05, 0x4d, 0x61, 0x70, + 0x73, 0x5f, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x1a, 0x08, 0x2e, 0x70, + 0x62, 0x2e, 0x4d, 0x61, 0x70, 0x73, 0x12, 0x32, 0x0a, 0x04, 0x41, 0x6e, 0x79, 0x5f, 0x12, 0x14, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x41, 0x6e, 0x79, 0x1a, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x12, 0x20, 0x0a, 0x07, 0x41, 0x6e, + 0x79, 0x77, 0x61, 0x79, 0x5f, 0x12, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x6e, 0x79, 0x1a, 0x0c, + 0x2e, 0x70, 0x62, 0x2e, 0x41, 0x6e, 0x79, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x2b, 0x0a, 0x06, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x09, + 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x2e, 0x0a, 0x07, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x32, 0x5f, 0x12, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, + 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x07, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x33, 0x5f, 0x12, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x33, + 0x1a, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x33, 0x12, 0x18, 0x0a, 0x04, + 0x52, 0x65, 0x66, 0x5f, 0x12, 0x07, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x1a, 0x07, 0x2e, + 0x70, 0x62, 0x2e, 0x52, 0x65, 0x66, 0x12, 0x1e, 0x0a, 0x06, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, + 0x12, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x1a, 0x09, 0x2e, 0x70, 0x62, + 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x12, 0x22, 0x0a, 0x0a, 0x43, 0x61, 0x6c, 0x6c, 0x57, 0x69, + 0x74, 0x68, 0x49, 0x64, 0x12, 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, + 0x09, 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x41, 0x5a, 0x3f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x61, 0x6e, 0x69, 0x65, 0x6c, 0x76, + 0x6c, 0x61, 0x64, 0x63, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x67, + 0x71, 0x6c, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, + 0x72, 0x75, 0x63, 0x74, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_constructserver_pb_constructs_proto_rawDescOnce sync.Once + file_constructserver_pb_constructs_proto_rawDescData = file_constructserver_pb_constructs_proto_rawDesc +) + +func file_constructserver_pb_constructs_proto_rawDescGZIP() []byte { + file_constructserver_pb_constructs_proto_rawDescOnce.Do(func() { + file_constructserver_pb_constructs_proto_rawDescData = protoimpl.X.CompressGZIP(file_constructserver_pb_constructs_proto_rawDescData) + }) + return file_constructserver_pb_constructs_proto_rawDescData +} + +var file_constructserver_pb_constructs_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_constructserver_pb_constructs_proto_msgTypes = make([]protoimpl.MessageInfo, 40) +var file_constructserver_pb_constructs_proto_goTypes = []interface{}{ + (Bar)(0), // 0: pb.Bar + (Ref_Foo_En)(0), // 1: pb.Ref.Foo.En + (Ref_Foo_Bar_En)(0), // 2: pb.Ref.Foo.Bar.En + (*AnyInput)(nil), // 3: pb.AnyInput + (*Empty3)(nil), // 4: pb.Empty3 + (*Foo)(nil), // 5: pb.Foo + (*Baz)(nil), // 6: pb.Baz + (*Scalars)(nil), // 7: pb.Scalars + (*Repeated)(nil), // 8: pb.Repeated + (*Maps)(nil), // 9: pb.Maps + (*Any)(nil), // 10: pb.Any + (*Empty)(nil), // 11: pb.Empty + (*EmptyRecursive)(nil), // 12: pb.EmptyRecursive + (*EmptyNested)(nil), // 13: pb.EmptyNested + (*Timestamp)(nil), // 14: pb.Timestamp + (*Ref)(nil), // 15: pb.Ref + (*Oneof)(nil), // 16: pb.Oneof + (*Empty3_Int)(nil), // 17: pb.Empty3.Int + (*Foo_Foo2)(nil), // 18: pb.Foo.Foo2 + nil, // 19: pb.Maps.Int32Int32Entry + nil, // 20: pb.Maps.Int64Int64Entry + nil, // 21: pb.Maps.Uint32Uint32Entry + nil, // 22: pb.Maps.Uint64Uint64Entry + nil, // 23: pb.Maps.Sint32Sint32Entry + nil, // 24: pb.Maps.Sint64Sint64Entry + nil, // 25: pb.Maps.Fixed32Fixed32Entry + nil, // 26: pb.Maps.Fixed64Fixed64Entry + nil, // 27: pb.Maps.Sfixed32Sfixed32Entry + nil, // 28: pb.Maps.Sfixed64Sfixed64Entry + nil, // 29: pb.Maps.BoolBoolEntry + nil, // 30: pb.Maps.StringStringEntry + nil, // 31: pb.Maps.StringBytesEntry + nil, // 32: pb.Maps.StringFloatEntry + nil, // 33: pb.Maps.StringDoubleEntry + nil, // 34: pb.Maps.StringFooEntry + nil, // 35: pb.Maps.StringBarEntry + (*EmptyNested_EmptyNested1)(nil), // 36: pb.EmptyNested.EmptyNested1 + (*EmptyNested_EmptyNested1_EmptyNested2)(nil), // 37: pb.EmptyNested.EmptyNested1.EmptyNested2 + (*Ref_Bar)(nil), // 38: pb.Ref.Bar + (*Ref_Foo)(nil), // 39: pb.Ref.Foo + (*Ref_Foo_Baz)(nil), // 40: pb.Ref.Foo.Baz + (*Ref_Foo_Bar)(nil), // 41: pb.Ref.Foo.Bar + (*Ref_Foo_Baz_Gz)(nil), // 42: pb.Ref.Foo.Baz.Gz + (*any.Any)(nil), // 43: google.protobuf.Any + (*timestamp.Timestamp)(nil), // 44: google.protobuf.Timestamp + (*empty.Empty)(nil), // 45: google.protobuf.Empty +} +var file_constructserver_pb_constructs_proto_depIdxs = []int32{ + 43, // 0: pb.AnyInput.any:type_name -> google.protobuf.Any + 17, // 1: pb.Empty3.i:type_name -> pb.Empty3.Int + 0, // 2: pb.Scalars.enum:type_name -> pb.Bar + 5, // 3: pb.Repeated.foo:type_name -> pb.Foo + 0, // 4: pb.Repeated.bar:type_name -> pb.Bar + 19, // 5: pb.Maps.int32_int32:type_name -> pb.Maps.Int32Int32Entry + 20, // 6: pb.Maps.int64_int64:type_name -> pb.Maps.Int64Int64Entry + 21, // 7: pb.Maps.uint32_uint32:type_name -> pb.Maps.Uint32Uint32Entry + 22, // 8: pb.Maps.uint64_uint64:type_name -> pb.Maps.Uint64Uint64Entry + 23, // 9: pb.Maps.sint32_sint32:type_name -> pb.Maps.Sint32Sint32Entry + 24, // 10: pb.Maps.sint64_sint64:type_name -> pb.Maps.Sint64Sint64Entry + 25, // 11: pb.Maps.fixed32_fixed32:type_name -> pb.Maps.Fixed32Fixed32Entry + 26, // 12: pb.Maps.fixed64_fixed64:type_name -> pb.Maps.Fixed64Fixed64Entry + 27, // 13: pb.Maps.sfixed32_sfixed32:type_name -> pb.Maps.Sfixed32Sfixed32Entry + 28, // 14: pb.Maps.sfixed64_sfixed64:type_name -> pb.Maps.Sfixed64Sfixed64Entry + 29, // 15: pb.Maps.bool_bool:type_name -> pb.Maps.BoolBoolEntry + 30, // 16: pb.Maps.string_string:type_name -> pb.Maps.StringStringEntry + 31, // 17: pb.Maps.string_bytes:type_name -> pb.Maps.StringBytesEntry + 32, // 18: pb.Maps.string_float:type_name -> pb.Maps.StringFloatEntry + 33, // 19: pb.Maps.string_double:type_name -> pb.Maps.StringDoubleEntry + 34, // 20: pb.Maps.string_foo:type_name -> pb.Maps.StringFooEntry + 35, // 21: pb.Maps.string_bar:type_name -> pb.Maps.StringBarEntry + 43, // 22: pb.Any.any:type_name -> google.protobuf.Any + 12, // 23: pb.EmptyRecursive.empty:type_name -> pb.EmptyRecursive + 36, // 24: pb.EmptyNested.nested1:type_name -> pb.EmptyNested.EmptyNested1 + 14, // 25: pb.Ref.local_time2:type_name -> pb.Timestamp + 44, // 26: pb.Ref.external:type_name -> google.protobuf.Timestamp + 14, // 27: pb.Ref.local_time:type_name -> pb.Timestamp + 6, // 28: pb.Ref.file:type_name -> pb.Baz + 5, // 29: pb.Ref.file_msg:type_name -> pb.Foo + 0, // 30: pb.Ref.file_enum:type_name -> pb.Bar + 39, // 31: pb.Ref.local:type_name -> pb.Ref.Foo + 18, // 32: pb.Ref.foreign:type_name -> pb.Foo.Foo2 + 1, // 33: pb.Ref.en1:type_name -> pb.Ref.Foo.En + 2, // 34: pb.Ref.en2:type_name -> pb.Ref.Foo.Bar.En + 42, // 35: pb.Ref.gz:type_name -> pb.Ref.Foo.Baz.Gz + 4, // 36: pb.Empty3.Int.e:type_name -> pb.Empty3 + 5, // 37: pb.Maps.StringFooEntry.value:type_name -> pb.Foo + 0, // 38: pb.Maps.StringBarEntry.value:type_name -> pb.Bar + 37, // 39: pb.EmptyNested.EmptyNested1.nested2:type_name -> pb.EmptyNested.EmptyNested1.EmptyNested2 + 41, // 40: pb.Ref.Foo.bar1:type_name -> pb.Ref.Foo.Bar + 14, // 41: pb.Ref.Foo.local_time2:type_name -> pb.Timestamp + 44, // 42: pb.Ref.Foo.external_time1:type_name -> google.protobuf.Timestamp + 38, // 43: pb.Ref.Foo.bar2:type_name -> pb.Ref.Bar + 1, // 44: pb.Ref.Foo.en1:type_name -> pb.Ref.Foo.En + 2, // 45: pb.Ref.Foo.en2:type_name -> pb.Ref.Foo.Bar.En + 7, // 46: pb.Constructs.Scalars_:input_type -> pb.Scalars + 8, // 47: pb.Constructs.Repeated_:input_type -> pb.Repeated + 9, // 48: pb.Constructs.Maps_:input_type -> pb.Maps + 43, // 49: pb.Constructs.Any_:input_type -> google.protobuf.Any + 10, // 50: pb.Constructs.Anyway_:input_type -> pb.Any + 45, // 51: pb.Constructs.Empty_:input_type -> google.protobuf.Empty + 12, // 52: pb.Constructs.Empty2_:input_type -> pb.EmptyRecursive + 4, // 53: pb.Constructs.Empty3_:input_type -> pb.Empty3 + 15, // 54: pb.Constructs.Ref_:input_type -> pb.Ref + 16, // 55: pb.Constructs.Oneof_:input_type -> pb.Oneof + 11, // 56: pb.Constructs.CallWithId:input_type -> pb.Empty + 7, // 57: pb.Constructs.Scalars_:output_type -> pb.Scalars + 8, // 58: pb.Constructs.Repeated_:output_type -> pb.Repeated + 9, // 59: pb.Constructs.Maps_:output_type -> pb.Maps + 43, // 60: pb.Constructs.Any_:output_type -> google.protobuf.Any + 3, // 61: pb.Constructs.Anyway_:output_type -> pb.AnyInput + 11, // 62: pb.Constructs.Empty_:output_type -> pb.Empty + 13, // 63: pb.Constructs.Empty2_:output_type -> pb.EmptyNested + 4, // 64: pb.Constructs.Empty3_:output_type -> pb.Empty3 + 15, // 65: pb.Constructs.Ref_:output_type -> pb.Ref + 16, // 66: pb.Constructs.Oneof_:output_type -> pb.Oneof + 11, // 67: pb.Constructs.CallWithId:output_type -> pb.Empty + 57, // [57:68] is the sub-list for method output_type + 46, // [46:57] is the sub-list for method input_type + 46, // [46:46] is the sub-list for extension type_name + 46, // [46:46] is the sub-list for extension extendee + 0, // [0:46] is the sub-list for field type_name +} + +func init() { file_constructserver_pb_constructs_proto_init() } +func file_constructserver_pb_constructs_proto_init() { + if File_constructserver_pb_constructs_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_constructserver_pb_constructs_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AnyInput); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty3); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Foo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Baz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Scalars); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Repeated); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Maps); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Any); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyRecursive); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyNested); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Timestamp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Oneof); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty3_Int); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Foo_Foo2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyNested_EmptyNested1); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EmptyNested_EmptyNested1_EmptyNested2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Bar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Foo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Foo_Baz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Foo_Bar); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_constructserver_pb_constructs_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Ref_Foo_Baz_Gz); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_constructserver_pb_constructs_proto_msgTypes[13].OneofWrappers = []interface{}{ + (*Oneof_Param2)(nil), + (*Oneof_Param3)(nil), + (*Oneof_Param4)(nil), + (*Oneof_Param5)(nil), + (*Oneof_Param6)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_constructserver_pb_constructs_proto_rawDesc, + NumEnums: 3, + NumMessages: 40, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_constructserver_pb_constructs_proto_goTypes, + DependencyIndexes: file_constructserver_pb_constructs_proto_depIdxs, + EnumInfos: file_constructserver_pb_constructs_proto_enumTypes, + MessageInfos: file_constructserver_pb_constructs_proto_msgTypes, + }.Build() + File_constructserver_pb_constructs_proto = out.File + file_constructserver_pb_constructs_proto_rawDesc = nil + file_constructserver_pb_constructs_proto_goTypes = nil + file_constructserver_pb_constructs_proto_depIdxs = nil +} diff --git a/example/gateway/constructserver/pb/constructs.proto b/example/gateway/constructserver/pb/constructs.proto new file mode 100644 index 0000000..bbe782a --- /dev/null +++ b/example/gateway/constructserver/pb/constructs.proto @@ -0,0 +1,189 @@ +syntax = "proto3"; +package pb; +option go_package = "github.com/danielvladco/go-proto-gql/reflect/constructserver;pb"; + +import "google/protobuf/any.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +service Constructs { + rpc Scalars_ (Scalars) returns (Scalars); // all possible scalars and same message as input and output + rpc Repeated_ (Repeated) returns (Repeated); // all scalars messages and enums as repeated + rpc Maps_ (Maps) returns (Maps); // all possible maps and different messages as input and output + rpc Any_ (google.protobuf.Any) returns (google.protobuf.Any); // same name different types + rpc Anyway_ (Any) returns (AnyInput); // some fake any types + rpc Empty_ (google.protobuf.Empty) returns (Empty); // empty input and empty output + rpc Empty2_ (EmptyRecursive) returns (EmptyNested); // messages with all empty fields + rpc Empty3_ (Empty3) returns (Empty3); // messages with all empty fields + rpc Ref_ (Ref) returns (Ref); + rpc Oneof_ (Oneof) returns (Oneof); + rpc CallWithId (Empty) returns (Empty); +} +message AnyInput { + google.protobuf.Any any = 1; +} +message Empty3 { + message Int { + Empty3 e = 1; + } + Int i = 1; +} + +message Foo { + message Foo2 { + string param1 = 1; + } + string param1 = 1; + string param2 = 2; +} + +enum Bar { + BAR1 = 0; + BAR2 = 1; + BAR3 = 2; +} + +message Baz { + string param1 = 1; +} + +message Scalars { + double double = 1; + float float = 2; + int32 int32 = 3; + int64 int64 = 4; + uint32 uint32 = 5; + uint64 uint64 = 6; + sint32 sint32 = 7; + sint64 sint64 = 8; + fixed32 fixed32 = 9; + fixed64 fixed64 = 10; + sfixed32 sfixed32 = 11; + sfixed64 sfixed64 = 12; + bool bool = 13; + string string = 14; + bytes bytes = 15; + Bar enum = 16; +} + +message Repeated { + repeated double double = 1; + repeated float float = 2; + repeated int32 int32 = 3; + repeated int64 int64 = 4; + repeated uint32 uint32 = 5; + repeated uint64 uint64 = 6; + repeated sint32 sint32 = 7; + repeated sint64 sint64 = 8; + repeated fixed32 fixed32 = 9; + repeated fixed64 fixed64 = 10; + repeated sfixed32 sfixed32 = 11; + repeated sfixed64 sfixed64 = 12; + repeated bool bool = 13; + repeated string string = 14; + repeated bytes bytes = 15; + repeated Foo foo = 16; + repeated Bar bar = 17; +} + +message Maps { + map int32_int32 = 1; + map int64_int64 = 2; + map uint32_uint32 = 3; + map uint64_uint64 = 4; + map sint32_sint32 = 5; + map sint64_sint64 = 6; + map fixed32_fixed32 = 7; + map fixed64_fixed64 = 8; + map sfixed32_sfixed32 = 9; + map sfixed64_sfixed64 = 10; + map bool_bool = 11; + map string_string = 12; + map string_bytes = 15; + map string_float = 16; + map string_double = 17; + map string_foo = 13; + map string_bar = 14; +} + +message Any { + google.protobuf.Any any = 1; +} + +message Empty { +} + +message EmptyRecursive { +// google.protobuf.Empty nested1 = 1; + EmptyRecursive empty = 2; +} + +message EmptyNested { + message EmptyNested1 { + message EmptyNested2 { + } + EmptyNested2 nested2 = 1; + } + EmptyNested1 nested1 = 1; +} + +message Timestamp { + string time = 1; +} + +message Ref { +// google.protobuf.Empty empty = 10; // must disappear as part of is empty validation + message Bar { + string param1 = 1; + } + message Foo { + enum En { + A0 = 0; + A1 = 1; + } + message Baz { + message Gz { + string param1 = 1; + } + } + message Bar { + enum En { + A0 = 0; + A1 = 1; + } + string param1 = 1; + } + Bar bar1 = 1; + Timestamp local_time2 = 12; + google.protobuf.Timestamp external_time1 = 13; + Ref.Bar bar2 = 2; + En en1 = 3; + Bar.En en2 = 4; + } + Timestamp local_time2 = 12; + google.protobuf.Timestamp external = 1; + Timestamp local_time = 11; + Baz file = 2; + pb.Foo file_msg = 8; + .pb.Bar file_enum = 9; + Foo local = 3; + .pb.Foo.Foo2 foreign = 4; + Foo.En en1 = 5; + Foo.Bar.En en2 = 6; + Foo.Baz.Gz gz = 7; +} + +message Oneof { + string param1 = 1; + oneof Oneof1 { + string param2 = 2; + string param3 = 3; + } + oneof Oneof2 { + string param4 = 4; + string param5 = 5; + } + oneof Oneof3 { + string param6 = 6; + } +} diff --git a/example/gateway/constructserver/pb/constructs_grpc.pb.go b/example/gateway/constructserver/pb/constructs_grpc.pb.go new file mode 100644 index 0000000..c0204e8 --- /dev/null +++ b/example/gateway/constructserver/pb/constructs_grpc.pb.go @@ -0,0 +1,459 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package pb + +import ( + context "context" + any "github.com/golang/protobuf/ptypes/any" + empty "github.com/golang/protobuf/ptypes/empty" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion7 + +// ConstructsClient is the client API for Constructs service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ConstructsClient interface { + Scalars_(ctx context.Context, in *Scalars, opts ...grpc.CallOption) (*Scalars, error) + Repeated_(ctx context.Context, in *Repeated, opts ...grpc.CallOption) (*Repeated, error) + Maps_(ctx context.Context, in *Maps, opts ...grpc.CallOption) (*Maps, error) + Any_(ctx context.Context, in *any.Any, opts ...grpc.CallOption) (*any.Any, error) + Anyway_(ctx context.Context, in *Any, opts ...grpc.CallOption) (*AnyInput, error) + Empty_(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Empty, error) + Empty2_(ctx context.Context, in *EmptyRecursive, opts ...grpc.CallOption) (*EmptyNested, error) + Empty3_(ctx context.Context, in *Empty3, opts ...grpc.CallOption) (*Empty3, error) + Ref_(ctx context.Context, in *Ref, opts ...grpc.CallOption) (*Ref, error) + Oneof_(ctx context.Context, in *Oneof, opts ...grpc.CallOption) (*Oneof, error) + CallWithId(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) +} + +type constructsClient struct { + cc grpc.ClientConnInterface +} + +func NewConstructsClient(cc grpc.ClientConnInterface) ConstructsClient { + return &constructsClient{cc} +} + +func (c *constructsClient) Scalars_(ctx context.Context, in *Scalars, opts ...grpc.CallOption) (*Scalars, error) { + out := new(Scalars) + err := c.cc.Invoke(ctx, "/pb.Constructs/Scalars_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Repeated_(ctx context.Context, in *Repeated, opts ...grpc.CallOption) (*Repeated, error) { + out := new(Repeated) + err := c.cc.Invoke(ctx, "/pb.Constructs/Repeated_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Maps_(ctx context.Context, in *Maps, opts ...grpc.CallOption) (*Maps, error) { + out := new(Maps) + err := c.cc.Invoke(ctx, "/pb.Constructs/Maps_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Any_(ctx context.Context, in *any.Any, opts ...grpc.CallOption) (*any.Any, error) { + out := new(any.Any) + err := c.cc.Invoke(ctx, "/pb.Constructs/Any_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Anyway_(ctx context.Context, in *Any, opts ...grpc.CallOption) (*AnyInput, error) { + out := new(AnyInput) + err := c.cc.Invoke(ctx, "/pb.Constructs/Anyway_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Empty_(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.Constructs/Empty_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Empty2_(ctx context.Context, in *EmptyRecursive, opts ...grpc.CallOption) (*EmptyNested, error) { + out := new(EmptyNested) + err := c.cc.Invoke(ctx, "/pb.Constructs/Empty2_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Empty3_(ctx context.Context, in *Empty3, opts ...grpc.CallOption) (*Empty3, error) { + out := new(Empty3) + err := c.cc.Invoke(ctx, "/pb.Constructs/Empty3_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Ref_(ctx context.Context, in *Ref, opts ...grpc.CallOption) (*Ref, error) { + out := new(Ref) + err := c.cc.Invoke(ctx, "/pb.Constructs/Ref_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) Oneof_(ctx context.Context, in *Oneof, opts ...grpc.CallOption) (*Oneof, error) { + out := new(Oneof) + err := c.cc.Invoke(ctx, "/pb.Constructs/Oneof_", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *constructsClient) CallWithId(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.Constructs/CallWithId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ConstructsServer is the server API for Constructs service. +// All implementations must embed UnimplementedConstructsServer +// for forward compatibility +type ConstructsServer interface { + Scalars_(context.Context, *Scalars) (*Scalars, error) + Repeated_(context.Context, *Repeated) (*Repeated, error) + Maps_(context.Context, *Maps) (*Maps, error) + Any_(context.Context, *any.Any) (*any.Any, error) + Anyway_(context.Context, *Any) (*AnyInput, error) + Empty_(context.Context, *empty.Empty) (*Empty, error) + Empty2_(context.Context, *EmptyRecursive) (*EmptyNested, error) + Empty3_(context.Context, *Empty3) (*Empty3, error) + Ref_(context.Context, *Ref) (*Ref, error) + Oneof_(context.Context, *Oneof) (*Oneof, error) + CallWithId(context.Context, *Empty) (*Empty, error) + mustEmbedUnimplementedConstructsServer() +} + +// UnimplementedConstructsServer must be embedded to have forward compatible implementations. +type UnimplementedConstructsServer struct { +} + +func (UnimplementedConstructsServer) Scalars_(context.Context, *Scalars) (*Scalars, error) { + return nil, status.Errorf(codes.Unimplemented, "method Scalars_ not implemented") +} +func (UnimplementedConstructsServer) Repeated_(context.Context, *Repeated) (*Repeated, error) { + return nil, status.Errorf(codes.Unimplemented, "method Repeated_ not implemented") +} +func (UnimplementedConstructsServer) Maps_(context.Context, *Maps) (*Maps, error) { + return nil, status.Errorf(codes.Unimplemented, "method Maps_ not implemented") +} +func (UnimplementedConstructsServer) Any_(context.Context, *any.Any) (*any.Any, error) { + return nil, status.Errorf(codes.Unimplemented, "method Any_ not implemented") +} +func (UnimplementedConstructsServer) Anyway_(context.Context, *Any) (*AnyInput, error) { + return nil, status.Errorf(codes.Unimplemented, "method Anyway_ not implemented") +} +func (UnimplementedConstructsServer) Empty_(context.Context, *empty.Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method Empty_ not implemented") +} +func (UnimplementedConstructsServer) Empty2_(context.Context, *EmptyRecursive) (*EmptyNested, error) { + return nil, status.Errorf(codes.Unimplemented, "method Empty2_ not implemented") +} +func (UnimplementedConstructsServer) Empty3_(context.Context, *Empty3) (*Empty3, error) { + return nil, status.Errorf(codes.Unimplemented, "method Empty3_ not implemented") +} +func (UnimplementedConstructsServer) Ref_(context.Context, *Ref) (*Ref, error) { + return nil, status.Errorf(codes.Unimplemented, "method Ref_ not implemented") +} +func (UnimplementedConstructsServer) Oneof_(context.Context, *Oneof) (*Oneof, error) { + return nil, status.Errorf(codes.Unimplemented, "method Oneof_ not implemented") +} +func (UnimplementedConstructsServer) CallWithId(context.Context, *Empty) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CallWithId not implemented") +} +func (UnimplementedConstructsServer) mustEmbedUnimplementedConstructsServer() {} + +// UnsafeConstructsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ConstructsServer will +// result in compilation errors. +type UnsafeConstructsServer interface { + mustEmbedUnimplementedConstructsServer() +} + +func RegisterConstructsServer(s grpc.ServiceRegistrar, srv ConstructsServer) { + s.RegisterService(&_Constructs_serviceDesc, srv) +} + +func _Constructs_Scalars__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Scalars) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Scalars_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Scalars_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Scalars_(ctx, req.(*Scalars)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Repeated__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Repeated) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Repeated_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Repeated_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Repeated_(ctx, req.(*Repeated)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Maps__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Maps) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Maps_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Maps_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Maps_(ctx, req.(*Maps)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Any__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(any.Any) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Any_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Any_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Any_(ctx, req.(*any.Any)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Anyway__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Any) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Anyway_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Anyway_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Anyway_(ctx, req.(*Any)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Empty__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Empty_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Empty_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Empty_(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Empty2__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(EmptyRecursive) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Empty2_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Empty2_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Empty2_(ctx, req.(*EmptyRecursive)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Empty3__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty3) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Empty3_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Empty3_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Empty3_(ctx, req.(*Empty3)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Ref__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Ref) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Ref_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Ref_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Ref_(ctx, req.(*Ref)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_Oneof__Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Oneof) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).Oneof_(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/Oneof_", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).Oneof_(ctx, req.(*Oneof)) + } + return interceptor(ctx, in, info, handler) +} + +func _Constructs_CallWithId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ConstructsServer).CallWithId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Constructs/CallWithId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ConstructsServer).CallWithId(ctx, req.(*Empty)) + } + return interceptor(ctx, in, info, handler) +} + +var _Constructs_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.Constructs", + HandlerType: (*ConstructsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Scalars_", + Handler: _Constructs_Scalars__Handler, + }, + { + MethodName: "Repeated_", + Handler: _Constructs_Repeated__Handler, + }, + { + MethodName: "Maps_", + Handler: _Constructs_Maps__Handler, + }, + { + MethodName: "Any_", + Handler: _Constructs_Any__Handler, + }, + { + MethodName: "Anyway_", + Handler: _Constructs_Anyway__Handler, + }, + { + MethodName: "Empty_", + Handler: _Constructs_Empty__Handler, + }, + { + MethodName: "Empty2_", + Handler: _Constructs_Empty2__Handler, + }, + { + MethodName: "Empty3_", + Handler: _Constructs_Empty3__Handler, + }, + { + MethodName: "Ref_", + Handler: _Constructs_Ref__Handler, + }, + { + MethodName: "Oneof_", + Handler: _Constructs_Oneof__Handler, + }, + { + MethodName: "CallWithId", + Handler: _Constructs_CallWithId_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "constructserver/pb/constructs.proto", +} diff --git a/example/gateway/docker-compose.yaml b/example/gateway/docker-compose.yaml new file mode 100644 index 0000000..02054ac --- /dev/null +++ b/example/gateway/docker-compose.yaml @@ -0,0 +1,22 @@ +version: "3.7" + +x-base_go_service: &base_go_service + image: golang + volumes: + - ${PWD}/../../:/go/src/ws + working_dir: /go/src/ws + +services: + constructserver: + <<: *base_go_service + command: go run ./example/gateway/constructserver/main.go + + optionsserver: + <<: *base_go_service + command: go run ./example/gateway/optionsserver/main.go + + gateway: + <<: *base_go_service + command: go run ./cmd/gateway/main.go --cfg ./example/gateway/config.json + ports: + - 8080:8080 diff --git a/example/gateway/optionsserver/main.go b/example/gateway/optionsserver/main.go new file mode 100644 index 0000000..819063a --- /dev/null +++ b/example/gateway/optionsserver/main.go @@ -0,0 +1,66 @@ +package main + +import ( + "context" + "log" + "net" + + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" + + "github.com/danielvladco/go-proto-gql/example/gateway/optionsserver/pb" +) + +func main() { + l, err := net.Listen("tcp", ":8082") + if err != nil { + log.Fatal(err) + } + + s := grpc.NewServer() + pb.RegisterServiceServer(s, &service{}) + reflection.Register(s) + log.Fatal(s.Serve(l)) +} + +type service struct{ pb.UnimplementedServiceServer } + +func (s service) Mutate1(ctx context.Context, data *pb.Data) (*pb.Data, error) { + return data, nil +} + +func (s service) Mutate2(ctx context.Context, data *pb.Data) (*pb.Data, error) { + return data, nil +} + +func (s service) Query1(ctx context.Context, data *pb.Data) (*pb.Data, error) { + return data, nil +} + +func (s service) Publish(server pb.Service_PublishServer) error { + panic("implement me") +} + +func (s service) Subscribe(data *pb.Data, server pb.Service_SubscribeServer) error { + panic("implement me") +} + +func (s service) PubSub1(server pb.Service_PubSub1Server) error { + panic("implement me") +} + +func (s service) InvalidSubscribe1(server pb.Service_InvalidSubscribe1Server) error { + panic("implement me") +} + +func (s service) InvalidSubscribe2(data *pb.Data, server pb.Service_InvalidSubscribe2Server) error { + panic("implement me") +} + +func (s service) InvalidSubscribe3(server pb.Service_InvalidSubscribe3Server) error { + panic("implement me") +} + +func (s service) PubSub2(server pb.Service_PubSub2Server) error { + panic("implement me") +} diff --git a/example/gateway/optionsserver/pb/options.pb.go b/example/gateway/optionsserver/pb/options.pb.go new file mode 100644 index 0000000..e4fadb7 --- /dev/null +++ b/example/gateway/optionsserver/pb/options.pb.go @@ -0,0 +1,328 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: optionsserver/pb/options.proto + +package pb + +import ( + _ "github.com/danielvladco/go-proto-gql/pb" + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Data struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + String_ string `protobuf:"bytes,1,opt,name=string,proto3" json:"string,omitempty"` // must be required + Foo *Foo2 `protobuf:"bytes,2,opt,name=foo,proto3" json:"foo,omitempty"` // must be required + Float []float32 `protobuf:"fixed32,3,rep,packed,name=float,proto3" json:"float,omitempty"` // must be required because its greater than 0 + String2 string `protobuf:"bytes,4,opt,name=string2,proto3" json:"string2,omitempty"` // simple + Foo2 *Foo2 `protobuf:"bytes,5,opt,name=foo2,proto3" json:"foo2,omitempty"` // simple + Float2 []float32 `protobuf:"fixed32,6,rep,packed,name=float2,proto3" json:"float2,omitempty"` // simple +} + +func (x *Data) Reset() { + *x = Data{} + if protoimpl.UnsafeEnabled { + mi := &file_optionsserver_pb_options_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Data) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Data) ProtoMessage() {} + +func (x *Data) ProtoReflect() protoreflect.Message { + mi := &file_optionsserver_pb_options_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Data.ProtoReflect.Descriptor instead. +func (*Data) Descriptor() ([]byte, []int) { + return file_optionsserver_pb_options_proto_rawDescGZIP(), []int{0} +} + +func (x *Data) GetString_() string { + if x != nil { + return x.String_ + } + return "" +} + +func (x *Data) GetFoo() *Foo2 { + if x != nil { + return x.Foo + } + return nil +} + +func (x *Data) GetFloat() []float32 { + if x != nil { + return x.Float + } + return nil +} + +func (x *Data) GetString2() string { + if x != nil { + return x.String2 + } + return "" +} + +func (x *Data) GetFoo2() *Foo2 { + if x != nil { + return x.Foo2 + } + return nil +} + +func (x *Data) GetFloat2() []float32 { + if x != nil { + return x.Float2 + } + return nil +} + +type Foo2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Param1 string `protobuf:"bytes,1,opt,name=param1,proto3" json:"param1,omitempty"` +} + +func (x *Foo2) Reset() { + *x = Foo2{} + if protoimpl.UnsafeEnabled { + mi := &file_optionsserver_pb_options_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Foo2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Foo2) ProtoMessage() {} + +func (x *Foo2) ProtoReflect() protoreflect.Message { + mi := &file_optionsserver_pb_options_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Foo2.ProtoReflect.Descriptor instead. +func (*Foo2) Descriptor() ([]byte, []int) { + return file_optionsserver_pb_options_proto_rawDescGZIP(), []int{1} +} + +func (x *Foo2) GetParam1() string { + if x != nil { + return x.Param1 + } + return "" +} + +var File_optionsserver_pb_options_proto protoreflect.FileDescriptor + +var file_optionsserver_pb_options_proto_rawDesc = []byte{ + 0x0a, 0x1e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, + 0x70, 0x62, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x02, 0x70, 0x62, 0x1a, 0x10, 0x70, 0x62, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb8, 0x01, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x1e, 0x0a, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x06, 0xb2, 0xe0, 0x1f, 0x02, 0x08, 0x01, 0x52, 0x06, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, + 0x22, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, + 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x32, 0x42, 0x06, 0xb2, 0xe0, 0x1f, 0x02, 0x08, 0x01, 0x52, 0x03, + 0x66, 0x6f, 0x6f, 0x12, 0x1c, 0x0a, 0x05, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x02, 0x42, 0x06, 0xb2, 0xe0, 0x1f, 0x02, 0x08, 0x01, 0x52, 0x05, 0x66, 0x6c, 0x6f, 0x61, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x32, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x32, 0x12, 0x1c, 0x0a, 0x04, 0x66, + 0x6f, 0x6f, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x46, + 0x6f, 0x6f, 0x32, 0x52, 0x04, 0x66, 0x6f, 0x6f, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6c, 0x6f, + 0x61, 0x74, 0x32, 0x18, 0x06, 0x20, 0x03, 0x28, 0x02, 0x52, 0x06, 0x66, 0x6c, 0x6f, 0x61, 0x74, + 0x32, 0x22, 0x1e, 0x0a, 0x04, 0x46, 0x6f, 0x6f, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x31, 0x32, 0x90, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1d, 0x0a, + 0x07, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x65, 0x31, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x07, + 0x4d, 0x75, 0x74, 0x61, 0x74, 0x65, 0x32, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, + 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x06, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x31, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, + 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x02, 0x12, + 0x1f, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x01, + 0x12, 0x21, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x08, 0x2e, + 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, + 0x61, 0x30, 0x01, 0x12, 0x21, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x53, 0x75, 0x62, 0x31, 0x12, 0x08, + 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x28, 0x01, 0x30, 0x01, 0x12, 0x2f, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, + 0x64, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x31, 0x12, 0x08, 0x2e, 0x70, 0x62, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x22, + 0x04, 0xb0, 0xe0, 0x1f, 0x02, 0x28, 0x01, 0x12, 0x2f, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x32, 0x12, 0x08, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x01, 0x30, 0x01, 0x12, 0x31, 0x0a, 0x11, 0x49, 0x6e, 0x76, 0x61, + 0x6c, 0x69, 0x64, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x33, 0x12, 0x08, 0x2e, + 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, + 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x02, 0x28, 0x01, 0x30, 0x01, 0x12, 0x27, 0x0a, 0x07, 0x50, + 0x75, 0x62, 0x53, 0x75, 0x62, 0x32, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x00, + 0x28, 0x01, 0x30, 0x01, 0x32, 0x91, 0x01, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1c, + 0x0a, 0x06, 0x51, 0x75, 0x65, 0x72, 0x79, 0x31, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1c, 0x0a, 0x06, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x32, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x23, 0x0a, 0x07, 0x4d, 0x75, + 0x74, 0x61, 0x74, 0x65, 0x31, 0x12, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, + 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x22, 0x04, 0xb0, 0xe0, 0x1f, 0x01, 0x12, + 0x21, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x08, 0x2e, 0x70, + 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x1a, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x30, 0x01, 0x1a, 0x04, 0xb0, 0xe0, 0x1f, 0x02, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x64, 0x61, 0x6e, 0x69, 0x65, 0x6c, 0x76, 0x6c, 0x61, + 0x64, 0x63, 0x6f, 0x2f, 0x67, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x67, 0x71, 0x6c, + 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_optionsserver_pb_options_proto_rawDescOnce sync.Once + file_optionsserver_pb_options_proto_rawDescData = file_optionsserver_pb_options_proto_rawDesc +) + +func file_optionsserver_pb_options_proto_rawDescGZIP() []byte { + file_optionsserver_pb_options_proto_rawDescOnce.Do(func() { + file_optionsserver_pb_options_proto_rawDescData = protoimpl.X.CompressGZIP(file_optionsserver_pb_options_proto_rawDescData) + }) + return file_optionsserver_pb_options_proto_rawDescData +} + +var file_optionsserver_pb_options_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_optionsserver_pb_options_proto_goTypes = []interface{}{ + (*Data)(nil), // 0: pb.Data + (*Foo2)(nil), // 1: pb.Foo2 +} +var file_optionsserver_pb_options_proto_depIdxs = []int32{ + 1, // 0: pb.Data.foo:type_name -> pb.Foo2 + 1, // 1: pb.Data.foo2:type_name -> pb.Foo2 + 0, // 2: pb.Service.Mutate1:input_type -> pb.Data + 0, // 3: pb.Service.Mutate2:input_type -> pb.Data + 0, // 4: pb.Service.Query1:input_type -> pb.Data + 0, // 5: pb.Service.Publish:input_type -> pb.Data + 0, // 6: pb.Service.Subscribe:input_type -> pb.Data + 0, // 7: pb.Service.PubSub1:input_type -> pb.Data + 0, // 8: pb.Service.InvalidSubscribe1:input_type -> pb.Data + 0, // 9: pb.Service.InvalidSubscribe2:input_type -> pb.Data + 0, // 10: pb.Service.InvalidSubscribe3:input_type -> pb.Data + 0, // 11: pb.Service.PubSub2:input_type -> pb.Data + 0, // 12: pb.Query.Query1:input_type -> pb.Data + 0, // 13: pb.Query.Query2:input_type -> pb.Data + 0, // 14: pb.Query.Mutate1:input_type -> pb.Data + 0, // 15: pb.Query.Subscribe:input_type -> pb.Data + 0, // 16: pb.Service.Mutate1:output_type -> pb.Data + 0, // 17: pb.Service.Mutate2:output_type -> pb.Data + 0, // 18: pb.Service.Query1:output_type -> pb.Data + 0, // 19: pb.Service.Publish:output_type -> pb.Data + 0, // 20: pb.Service.Subscribe:output_type -> pb.Data + 0, // 21: pb.Service.PubSub1:output_type -> pb.Data + 0, // 22: pb.Service.InvalidSubscribe1:output_type -> pb.Data + 0, // 23: pb.Service.InvalidSubscribe2:output_type -> pb.Data + 0, // 24: pb.Service.InvalidSubscribe3:output_type -> pb.Data + 0, // 25: pb.Service.PubSub2:output_type -> pb.Data + 0, // 26: pb.Query.Query1:output_type -> pb.Data + 0, // 27: pb.Query.Query2:output_type -> pb.Data + 0, // 28: pb.Query.Mutate1:output_type -> pb.Data + 0, // 29: pb.Query.Subscribe:output_type -> pb.Data + 16, // [16:30] is the sub-list for method output_type + 2, // [2:16] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_optionsserver_pb_options_proto_init() } +func file_optionsserver_pb_options_proto_init() { + if File_optionsserver_pb_options_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_optionsserver_pb_options_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Data); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_optionsserver_pb_options_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Foo2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_optionsserver_pb_options_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 2, + }, + GoTypes: file_optionsserver_pb_options_proto_goTypes, + DependencyIndexes: file_optionsserver_pb_options_proto_depIdxs, + MessageInfos: file_optionsserver_pb_options_proto_msgTypes, + }.Build() + File_optionsserver_pb_options_proto = out.File + file_optionsserver_pb_options_proto_rawDesc = nil + file_optionsserver_pb_options_proto_goTypes = nil + file_optionsserver_pb_options_proto_depIdxs = nil +} diff --git a/example/options.proto b/example/gateway/optionsserver/pb/options.proto similarity index 61% rename from example/options.proto rename to example/gateway/optionsserver/pb/options.proto index 3cdc2c6..e233e01 100644 --- a/example/options.proto +++ b/example/gateway/optionsserver/pb/options.proto @@ -2,13 +2,13 @@ syntax = "proto3"; package pb; option go_package = "github.com/danielvladco/go-proto-gql/example;pb"; -import "pb/gql.proto"; +import "pb/graphql.proto"; service Service { rpc Mutate1 (Data) returns (Data); // must be a mutation rpc Mutate2 (Data) returns (Data); // must be a mutation rpc Query1 (Data) returns (Data) { - option (gql.rpc_type) = QUERY; + option (danielvladco.protobuf.graphql.rpc_type) = QUERY; } // must be a query rpc Publish (stream Data) returns (Data); // must be a mutation @@ -16,33 +16,33 @@ service Service { rpc PubSub1 (stream Data) returns (stream Data); // must be a mutation and a subscription rpc InvalidSubscribe1 (stream Data) returns (Data) { - option (gql.rpc_type) = QUERY; + option (danielvladco.protobuf.graphql.rpc_type) = QUERY; }; // must ignore rpc InvalidSubscribe2 (Data) returns (stream Data) { - option (gql.rpc_type) = MUTATION; + option (danielvladco.protobuf.graphql.rpc_type) = MUTATION; }; // must ignore rpc InvalidSubscribe3 (stream Data) returns (stream Data) { - option (gql.rpc_type) = QUERY; + option (danielvladco.protobuf.graphql.rpc_type) = QUERY; }; // must ignore rpc PubSub2 (stream Data) returns (stream Data) { - option (gql.rpc_type) = DEFAULT; + option (danielvladco.protobuf.graphql.rpc_type) = DEFAULT; }; // must ignore } service Query { - option (gql.svc_type) = QUERY; + option (danielvladco.protobuf.graphql.svc_type) = QUERY; rpc Query1 (Data) returns (Data); // must be a query rpc Query2 (Data) returns (Data); // must be a query rpc Mutate1 (Data) returns (Data) { - option (gql.rpc_type) = MUTATION; + option (danielvladco.protobuf.graphql.rpc_type) = MUTATION; } // must be a mutation rpc Subscribe (Data) returns (stream Data); // must be a subscription } message Data { - string string = 1 [(gql.field) = {required: true}]; // must be required - Foo2 foo = 2 [(gql.field) = {required: true}]; // must be required - repeated float float = 3 [(gql.field) = {required: true}]; // must be required because its greater than 0 + string string = 1 [(danielvladco.protobuf.graphql.field) = {required: true}]; // must be required + Foo2 foo = 2 [(danielvladco.protobuf.graphql.field) = {required: true}]; // must be required + repeated float float = 3 [(danielvladco.protobuf.graphql.field) = {required: true}]; // must be required because its greater than 0 string string2 = 4; // simple Foo2 foo2 = 5; // simple repeated float float2 = 6; // simple diff --git a/example/gateway/optionsserver/pb/options_grpc.pb.go b/example/gateway/optionsserver/pb/options_grpc.pb.go new file mode 100644 index 0000000..f23fdc1 --- /dev/null +++ b/example/gateway/optionsserver/pb/options_grpc.pb.go @@ -0,0 +1,859 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion7 + +// ServiceClient is the client API for Service service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ServiceClient interface { + Mutate1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) + Mutate2(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) + Query1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) + Publish(ctx context.Context, opts ...grpc.CallOption) (Service_PublishClient, error) + Subscribe(ctx context.Context, in *Data, opts ...grpc.CallOption) (Service_SubscribeClient, error) + PubSub1(ctx context.Context, opts ...grpc.CallOption) (Service_PubSub1Client, error) + InvalidSubscribe1(ctx context.Context, opts ...grpc.CallOption) (Service_InvalidSubscribe1Client, error) + InvalidSubscribe2(ctx context.Context, in *Data, opts ...grpc.CallOption) (Service_InvalidSubscribe2Client, error) + InvalidSubscribe3(ctx context.Context, opts ...grpc.CallOption) (Service_InvalidSubscribe3Client, error) + PubSub2(ctx context.Context, opts ...grpc.CallOption) (Service_PubSub2Client, error) +} + +type serviceClient struct { + cc grpc.ClientConnInterface +} + +func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient { + return &serviceClient{cc} +} + +func (c *serviceClient) Mutate1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) { + out := new(Data) + err := c.cc.Invoke(ctx, "/pb.Service/Mutate1", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) Mutate2(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) { + out := new(Data) + err := c.cc.Invoke(ctx, "/pb.Service/Mutate2", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) Query1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) { + out := new(Data) + err := c.cc.Invoke(ctx, "/pb.Service/Query1", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) Publish(ctx context.Context, opts ...grpc.CallOption) (Service_PublishClient, error) { + stream, err := c.cc.NewStream(ctx, &_Service_serviceDesc.Streams[0], "/pb.Service/Publish", opts...) + if err != nil { + return nil, err + } + x := &servicePublishClient{stream} + return x, nil +} + +type Service_PublishClient interface { + Send(*Data) error + CloseAndRecv() (*Data, error) + grpc.ClientStream +} + +type servicePublishClient struct { + grpc.ClientStream +} + +func (x *servicePublishClient) Send(m *Data) error { + return x.ClientStream.SendMsg(m) +} + +func (x *servicePublishClient) CloseAndRecv() (*Data, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(Data) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *serviceClient) Subscribe(ctx context.Context, in *Data, opts ...grpc.CallOption) (Service_SubscribeClient, error) { + stream, err := c.cc.NewStream(ctx, &_Service_serviceDesc.Streams[1], "/pb.Service/Subscribe", opts...) + if err != nil { + return nil, err + } + x := &serviceSubscribeClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Service_SubscribeClient interface { + Recv() (*Data, error) + grpc.ClientStream +} + +type serviceSubscribeClient struct { + grpc.ClientStream +} + +func (x *serviceSubscribeClient) Recv() (*Data, error) { + m := new(Data) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *serviceClient) PubSub1(ctx context.Context, opts ...grpc.CallOption) (Service_PubSub1Client, error) { + stream, err := c.cc.NewStream(ctx, &_Service_serviceDesc.Streams[2], "/pb.Service/PubSub1", opts...) + if err != nil { + return nil, err + } + x := &servicePubSub1Client{stream} + return x, nil +} + +type Service_PubSub1Client interface { + Send(*Data) error + Recv() (*Data, error) + grpc.ClientStream +} + +type servicePubSub1Client struct { + grpc.ClientStream +} + +func (x *servicePubSub1Client) Send(m *Data) error { + return x.ClientStream.SendMsg(m) +} + +func (x *servicePubSub1Client) Recv() (*Data, error) { + m := new(Data) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *serviceClient) InvalidSubscribe1(ctx context.Context, opts ...grpc.CallOption) (Service_InvalidSubscribe1Client, error) { + stream, err := c.cc.NewStream(ctx, &_Service_serviceDesc.Streams[3], "/pb.Service/InvalidSubscribe1", opts...) + if err != nil { + return nil, err + } + x := &serviceInvalidSubscribe1Client{stream} + return x, nil +} + +type Service_InvalidSubscribe1Client interface { + Send(*Data) error + CloseAndRecv() (*Data, error) + grpc.ClientStream +} + +type serviceInvalidSubscribe1Client struct { + grpc.ClientStream +} + +func (x *serviceInvalidSubscribe1Client) Send(m *Data) error { + return x.ClientStream.SendMsg(m) +} + +func (x *serviceInvalidSubscribe1Client) CloseAndRecv() (*Data, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(Data) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *serviceClient) InvalidSubscribe2(ctx context.Context, in *Data, opts ...grpc.CallOption) (Service_InvalidSubscribe2Client, error) { + stream, err := c.cc.NewStream(ctx, &_Service_serviceDesc.Streams[4], "/pb.Service/InvalidSubscribe2", opts...) + if err != nil { + return nil, err + } + x := &serviceInvalidSubscribe2Client{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Service_InvalidSubscribe2Client interface { + Recv() (*Data, error) + grpc.ClientStream +} + +type serviceInvalidSubscribe2Client struct { + grpc.ClientStream +} + +func (x *serviceInvalidSubscribe2Client) Recv() (*Data, error) { + m := new(Data) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *serviceClient) InvalidSubscribe3(ctx context.Context, opts ...grpc.CallOption) (Service_InvalidSubscribe3Client, error) { + stream, err := c.cc.NewStream(ctx, &_Service_serviceDesc.Streams[5], "/pb.Service/InvalidSubscribe3", opts...) + if err != nil { + return nil, err + } + x := &serviceInvalidSubscribe3Client{stream} + return x, nil +} + +type Service_InvalidSubscribe3Client interface { + Send(*Data) error + Recv() (*Data, error) + grpc.ClientStream +} + +type serviceInvalidSubscribe3Client struct { + grpc.ClientStream +} + +func (x *serviceInvalidSubscribe3Client) Send(m *Data) error { + return x.ClientStream.SendMsg(m) +} + +func (x *serviceInvalidSubscribe3Client) Recv() (*Data, error) { + m := new(Data) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *serviceClient) PubSub2(ctx context.Context, opts ...grpc.CallOption) (Service_PubSub2Client, error) { + stream, err := c.cc.NewStream(ctx, &_Service_serviceDesc.Streams[6], "/pb.Service/PubSub2", opts...) + if err != nil { + return nil, err + } + x := &servicePubSub2Client{stream} + return x, nil +} + +type Service_PubSub2Client interface { + Send(*Data) error + Recv() (*Data, error) + grpc.ClientStream +} + +type servicePubSub2Client struct { + grpc.ClientStream +} + +func (x *servicePubSub2Client) Send(m *Data) error { + return x.ClientStream.SendMsg(m) +} + +func (x *servicePubSub2Client) Recv() (*Data, error) { + m := new(Data) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// ServiceServer is the server API for Service service. +// All implementations must embed UnimplementedServiceServer +// for forward compatibility +type ServiceServer interface { + Mutate1(context.Context, *Data) (*Data, error) + Mutate2(context.Context, *Data) (*Data, error) + Query1(context.Context, *Data) (*Data, error) + Publish(Service_PublishServer) error + Subscribe(*Data, Service_SubscribeServer) error + PubSub1(Service_PubSub1Server) error + InvalidSubscribe1(Service_InvalidSubscribe1Server) error + InvalidSubscribe2(*Data, Service_InvalidSubscribe2Server) error + InvalidSubscribe3(Service_InvalidSubscribe3Server) error + PubSub2(Service_PubSub2Server) error + mustEmbedUnimplementedServiceServer() +} + +// UnimplementedServiceServer must be embedded to have forward compatible implementations. +type UnimplementedServiceServer struct { +} + +func (UnimplementedServiceServer) Mutate1(context.Context, *Data) (*Data, error) { + return nil, status.Errorf(codes.Unimplemented, "method Mutate1 not implemented") +} +func (UnimplementedServiceServer) Mutate2(context.Context, *Data) (*Data, error) { + return nil, status.Errorf(codes.Unimplemented, "method Mutate2 not implemented") +} +func (UnimplementedServiceServer) Query1(context.Context, *Data) (*Data, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query1 not implemented") +} +func (UnimplementedServiceServer) Publish(Service_PublishServer) error { + return status.Errorf(codes.Unimplemented, "method Publish not implemented") +} +func (UnimplementedServiceServer) Subscribe(*Data, Service_SubscribeServer) error { + return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") +} +func (UnimplementedServiceServer) PubSub1(Service_PubSub1Server) error { + return status.Errorf(codes.Unimplemented, "method PubSub1 not implemented") +} +func (UnimplementedServiceServer) InvalidSubscribe1(Service_InvalidSubscribe1Server) error { + return status.Errorf(codes.Unimplemented, "method InvalidSubscribe1 not implemented") +} +func (UnimplementedServiceServer) InvalidSubscribe2(*Data, Service_InvalidSubscribe2Server) error { + return status.Errorf(codes.Unimplemented, "method InvalidSubscribe2 not implemented") +} +func (UnimplementedServiceServer) InvalidSubscribe3(Service_InvalidSubscribe3Server) error { + return status.Errorf(codes.Unimplemented, "method InvalidSubscribe3 not implemented") +} +func (UnimplementedServiceServer) PubSub2(Service_PubSub2Server) error { + return status.Errorf(codes.Unimplemented, "method PubSub2 not implemented") +} +func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {} + +// UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ServiceServer will +// result in compilation errors. +type UnsafeServiceServer interface { + mustEmbedUnimplementedServiceServer() +} + +func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) { + s.RegisterService(&_Service_serviceDesc, srv) +} + +func _Service_Mutate1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Data) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Mutate1(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Service/Mutate1", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Mutate1(ctx, req.(*Data)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_Mutate2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Data) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Mutate2(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Service/Mutate2", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Mutate2(ctx, req.(*Data)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_Query1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Data) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ServiceServer).Query1(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Service/Query1", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ServiceServer).Query1(ctx, req.(*Data)) + } + return interceptor(ctx, in, info, handler) +} + +func _Service_Publish_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ServiceServer).Publish(&servicePublishServer{stream}) +} + +type Service_PublishServer interface { + SendAndClose(*Data) error + Recv() (*Data, error) + grpc.ServerStream +} + +type servicePublishServer struct { + grpc.ServerStream +} + +func (x *servicePublishServer) SendAndClose(m *Data) error { + return x.ServerStream.SendMsg(m) +} + +func (x *servicePublishServer) Recv() (*Data, error) { + m := new(Data) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Service_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Data) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ServiceServer).Subscribe(m, &serviceSubscribeServer{stream}) +} + +type Service_SubscribeServer interface { + Send(*Data) error + grpc.ServerStream +} + +type serviceSubscribeServer struct { + grpc.ServerStream +} + +func (x *serviceSubscribeServer) Send(m *Data) error { + return x.ServerStream.SendMsg(m) +} + +func _Service_PubSub1_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ServiceServer).PubSub1(&servicePubSub1Server{stream}) +} + +type Service_PubSub1Server interface { + Send(*Data) error + Recv() (*Data, error) + grpc.ServerStream +} + +type servicePubSub1Server struct { + grpc.ServerStream +} + +func (x *servicePubSub1Server) Send(m *Data) error { + return x.ServerStream.SendMsg(m) +} + +func (x *servicePubSub1Server) Recv() (*Data, error) { + m := new(Data) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Service_InvalidSubscribe1_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ServiceServer).InvalidSubscribe1(&serviceInvalidSubscribe1Server{stream}) +} + +type Service_InvalidSubscribe1Server interface { + SendAndClose(*Data) error + Recv() (*Data, error) + grpc.ServerStream +} + +type serviceInvalidSubscribe1Server struct { + grpc.ServerStream +} + +func (x *serviceInvalidSubscribe1Server) SendAndClose(m *Data) error { + return x.ServerStream.SendMsg(m) +} + +func (x *serviceInvalidSubscribe1Server) Recv() (*Data, error) { + m := new(Data) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Service_InvalidSubscribe2_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Data) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(ServiceServer).InvalidSubscribe2(m, &serviceInvalidSubscribe2Server{stream}) +} + +type Service_InvalidSubscribe2Server interface { + Send(*Data) error + grpc.ServerStream +} + +type serviceInvalidSubscribe2Server struct { + grpc.ServerStream +} + +func (x *serviceInvalidSubscribe2Server) Send(m *Data) error { + return x.ServerStream.SendMsg(m) +} + +func _Service_InvalidSubscribe3_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ServiceServer).InvalidSubscribe3(&serviceInvalidSubscribe3Server{stream}) +} + +type Service_InvalidSubscribe3Server interface { + Send(*Data) error + Recv() (*Data, error) + grpc.ServerStream +} + +type serviceInvalidSubscribe3Server struct { + grpc.ServerStream +} + +func (x *serviceInvalidSubscribe3Server) Send(m *Data) error { + return x.ServerStream.SendMsg(m) +} + +func (x *serviceInvalidSubscribe3Server) Recv() (*Data, error) { + m := new(Data) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Service_PubSub2_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(ServiceServer).PubSub2(&servicePubSub2Server{stream}) +} + +type Service_PubSub2Server interface { + Send(*Data) error + Recv() (*Data, error) + grpc.ServerStream +} + +type servicePubSub2Server struct { + grpc.ServerStream +} + +func (x *servicePubSub2Server) Send(m *Data) error { + return x.ServerStream.SendMsg(m) +} + +func (x *servicePubSub2Server) Recv() (*Data, error) { + m := new(Data) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +var _Service_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.Service", + HandlerType: (*ServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Mutate1", + Handler: _Service_Mutate1_Handler, + }, + { + MethodName: "Mutate2", + Handler: _Service_Mutate2_Handler, + }, + { + MethodName: "Query1", + Handler: _Service_Query1_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Publish", + Handler: _Service_Publish_Handler, + ClientStreams: true, + }, + { + StreamName: "Subscribe", + Handler: _Service_Subscribe_Handler, + ServerStreams: true, + }, + { + StreamName: "PubSub1", + Handler: _Service_PubSub1_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "InvalidSubscribe1", + Handler: _Service_InvalidSubscribe1_Handler, + ClientStreams: true, + }, + { + StreamName: "InvalidSubscribe2", + Handler: _Service_InvalidSubscribe2_Handler, + ServerStreams: true, + }, + { + StreamName: "InvalidSubscribe3", + Handler: _Service_InvalidSubscribe3_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "PubSub2", + Handler: _Service_PubSub2_Handler, + ServerStreams: true, + ClientStreams: true, + }, + }, + Metadata: "optionsserver/pb/options.proto", +} + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type QueryClient interface { + Query1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) + Query2(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) + Mutate1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) + Subscribe(ctx context.Context, in *Data, opts ...grpc.CallOption) (Query_SubscribeClient, error) +} + +type queryClient struct { + cc grpc.ClientConnInterface +} + +func NewQueryClient(cc grpc.ClientConnInterface) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Query1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) { + out := new(Data) + err := c.cc.Invoke(ctx, "/pb.Query/Query1", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Query2(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) { + out := new(Data) + err := c.cc.Invoke(ctx, "/pb.Query/Query2", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Mutate1(ctx context.Context, in *Data, opts ...grpc.CallOption) (*Data, error) { + out := new(Data) + err := c.cc.Invoke(ctx, "/pb.Query/Mutate1", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Subscribe(ctx context.Context, in *Data, opts ...grpc.CallOption) (Query_SubscribeClient, error) { + stream, err := c.cc.NewStream(ctx, &_Query_serviceDesc.Streams[0], "/pb.Query/Subscribe", opts...) + if err != nil { + return nil, err + } + x := &querySubscribeClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Query_SubscribeClient interface { + Recv() (*Data, error) + grpc.ClientStream +} + +type querySubscribeClient struct { + grpc.ClientStream +} + +func (x *querySubscribeClient) Recv() (*Data, error) { + m := new(Data) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// QueryServer is the server API for Query service. +// All implementations must embed UnimplementedQueryServer +// for forward compatibility +type QueryServer interface { + Query1(context.Context, *Data) (*Data, error) + Query2(context.Context, *Data) (*Data, error) + Mutate1(context.Context, *Data) (*Data, error) + Subscribe(*Data, Query_SubscribeServer) error + mustEmbedUnimplementedQueryServer() +} + +// UnimplementedQueryServer must be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (UnimplementedQueryServer) Query1(context.Context, *Data) (*Data, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query1 not implemented") +} +func (UnimplementedQueryServer) Query2(context.Context, *Data) (*Data, error) { + return nil, status.Errorf(codes.Unimplemented, "method Query2 not implemented") +} +func (UnimplementedQueryServer) Mutate1(context.Context, *Data) (*Data, error) { + return nil, status.Errorf(codes.Unimplemented, "method Mutate1 not implemented") +} +func (UnimplementedQueryServer) Subscribe(*Data, Query_SubscribeServer) error { + return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") +} +func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} + +// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to QueryServer will +// result in compilation errors. +type UnsafeQueryServer interface { + mustEmbedUnimplementedQueryServer() +} + +func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Query1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Data) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Query1(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Query/Query1", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Query1(ctx, req.(*Data)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Query2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Data) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Query2(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Query/Query2", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Query2(ctx, req.(*Data)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Mutate1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Data) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Mutate1(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Query/Mutate1", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Mutate1(ctx, req.(*Data)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(Data) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(QueryServer).Subscribe(m, &querySubscribeServer{stream}) +} + +type Query_SubscribeServer interface { + Send(*Data) error + grpc.ServerStream +} + +type querySubscribeServer struct { + grpc.ServerStream +} + +func (x *querySubscribeServer) Send(m *Data) error { + return x.ServerStream.SendMsg(m) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Query1", + Handler: _Query_Query1_Handler, + }, + { + MethodName: "Query2", + Handler: _Query_Query2_Handler, + }, + { + MethodName: "Mutate1", + Handler: _Query_Mutate1_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "Subscribe", + Handler: _Query_Subscribe_Handler, + ServerStreams: true, + }, + }, + Metadata: "optionsserver/pb/options.proto", +} diff --git a/example/options.gqlgen.pb.go b/example/options.gqlgen.pb.go deleted file mode 100644 index b3d5a31..0000000 --- a/example/options.gqlgen.pb.go +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: example/options.proto - -package pb - -import ( - context "context" - fmt "fmt" - _ "github.com/danielvladco/go-proto-gql/pb" - proto "github.com/golang/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -type ServiceGQLServer struct{ Service ServiceServer } - -func (s *ServiceGQLServer) ServiceMutate1(ctx context.Context, in *Data) (*Data, error) { - return s.Service.Mutate1(ctx, in) -} -func (s *ServiceGQLServer) ServiceMutate2(ctx context.Context, in *Data) (*Data, error) { - return s.Service.Mutate2(ctx, in) -} -func (s *ServiceGQLServer) ServiceQuery1(ctx context.Context, in *Data) (*Data, error) { - return s.Service.Query1(ctx, in) -} - -type QueryGQLServer struct{ Service QueryServer } - -func (s *QueryGQLServer) QueryQuery1(ctx context.Context, in *Data) (*Data, error) { - return s.Service.Query1(ctx, in) -} -func (s *QueryGQLServer) QueryQuery2(ctx context.Context, in *Data) (*Data, error) { - return s.Service.Query2(ctx, in) -} -func (s *QueryGQLServer) QueryMutate1(ctx context.Context, in *Data) (*Data, error) { - return s.Service.Mutate1(ctx, in) -} diff --git a/example/options.gqlgen.pb.yml b/example/options.gqlgen.pb.yml deleted file mode 100644 index f1cac67..0000000 --- a/example/options.gqlgen.pb.yml +++ /dev/null @@ -1,22 +0,0 @@ -schema: -- options.pb.graphqls -exec: - filename: exec.go -model: - filename: models.go -models: - Data: - model: - - github.com/danielvladco/go-proto-gql/example.Data - DataInput: - model: - - github.com/danielvladco/go-proto-gql/example.Data - Float32: - model: - - github.com/danielvladco/go-proto-gql/pb.Float32 - Foo2: - model: - - github.com/danielvladco/go-proto-gql/example.Foo2 - Foo2Input: - model: - - github.com/danielvladco/go-proto-gql/example.Foo2 diff --git a/example/options.pb.graphqls b/example/options.pb.graphqls deleted file mode 100644 index 3379bb1..0000000 --- a/example/options.pb.graphqls +++ /dev/null @@ -1,64 +0,0 @@ -# Code generated by protoc-gen-gogql. DO NOT EDIT -# source: example/options.proto - -directive @Service(name: String) on FIELD_DEFINITION - -directive @Query(name: String) on FIELD_DEFINITION - -scalar Float32 - -input DataInput { - string: String! - foo: Foo2Input! - float: [Float32!]! - string2: String - foo2: Foo2Input - float2: [Float32!] -} - -input Foo2Input { - param1: String -} - -type Data { - string: String! - foo: Foo2! - float: [Float32!]! - string2: String - foo2: Foo2 - float2: [Float32!] -} - -type Foo2 { - param1: String -} - -type Mutation { - serviceMutate1(in: DataInput): Data @Service - serviceMutate2(in: DataInput): Data @Service - servicePublish(in: DataInput): Data @Service - # See the Subscription with the same name - servicePubSub1(in: DataInput): Boolean @Service - # See the Subscription with the same name - serviceInvalidSubscribe3(in: DataInput): Boolean @Service - # See the Subscription with the same name - servicePubSub2(in: DataInput): Boolean @Service - queryMutate1(in: DataInput): Data @Query -} - -type Query { - serviceQuery1(in: DataInput): Data @Service - serviceInvalidSubscribe1(in: DataInput): Data @Service - queryQuery1(in: DataInput): Data @Query - queryQuery2(in: DataInput): Data @Query -} - -type Subscription { - serviceSubscribe(in: DataInput): Data @Service - servicePubSub1(in: DataInput): Data @Service - serviceInvalidSubscribe2(in: DataInput): Data @Service - serviceInvalidSubscribe3(in: DataInput): Data @Service - servicePubSub2(in: DataInput): Data @Service - querySubscribe(in: DataInput): Data @Query -} - diff --git a/go.mod b/go.mod index c052a13..548cc89 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,19 @@ module github.com/danielvladco/go-proto-gql +go 1.14 + require ( - github.com/danielvladco/go-proto-gql/pb v0.6.0 - github.com/gogo/protobuf v1.2.1 - github.com/golang/protobuf v1.3.1 - google.golang.org/grpc v1.19.1 - gopkg.in/yaml.v2 v2.2.2 + github.com/99designs/gqlgen v0.13.0 + github.com/golang/protobuf v1.4.3 + github.com/jhump/protoreflect v1.6.1 + github.com/mitchellh/mapstructure v1.3.0 + github.com/nautilus/gateway v0.1.4 + github.com/nautilus/graphql v0.0.9 + github.com/vektah/gqlparser/v2 v2.1.0 + golang.org/x/net v0.0.0-20200513185701-a91f0712d120 // indirect + golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9 // indirect + golang.org/x/text v0.3.2 // indirect + google.golang.org/grpc v1.33.2 + google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.1 + google.golang.org/protobuf v1.25.0 ) diff --git a/go.sum b/go.sum index 635caad..ecf7b5b 100644 --- a/go.sum +++ b/go.sum @@ -1,36 +1,237 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/99designs/gqlgen v0.11.3 h1:oFSxl1DFS9X///uHV3y6CEfpcXWrDUxVblR4Xib2bs4= +github.com/99designs/gqlgen v0.11.3/go.mod h1:RgX5GRRdDWNkh4pBrdzNpNPFVsdoUFY2+adM6nb1N+4= +github.com/99designs/gqlgen v0.13.0 h1:haLTcUp3Vwp80xMVEg5KRNwzfUrgFdRmtBY8fuB8scA= +github.com/99designs/gqlgen v0.13.0/go.mod h1:NV130r6f4tpRWuAI+zsrSdooO/eWUv+Gyyoi3rEfXIk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= +github.com/agnivade/levenshtein v1.0.3 h1:M5ZnqLOoZR8ygVq0FfkXsNOKzMCk0xRiow0R5+5VkQ0= +github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= +github.com/carted/graphql v0.7.6 h1:1DAom3l7Irln/hHlPMBR6w/RirCXjopsCY9WCZc7WUc= +github.com/carted/graphql v0.7.6/go.mod h1:aIVByVaa4avHzEnahcnHbP48OrkT/+gTtxBT+dPV2R0= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/danielvladco/go-proto-gql/pb v0.6.0 h1:zEQZroAJx7kzzliJqHa+KfNMNneVK3caZx0juTxH6Oo= -github.com/danielvladco/go-proto-gql/pb v0.6.0/go.mod h1:wFJoFQotIm/We81vMxWcSPaxm3hngCr0Q+8VbHfbyAo= -github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c h1:TUuUh0Xgj97tLMNtWtNvI9mIV6isjEb9lBMNv+77IGM= +github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= +github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/graph-gophers/dataloader v5.0.0+incompatible h1:R+yjsbrNq1Mo3aPG+Z/EKYrXrXXUNJHOgbRt+U6jOug= +github.com/graph-gophers/dataloader v5.0.0+incompatible/go.mod h1:jk4jk0c5ZISbKaMe8WsVopGB5/15GvGHMdMdPtwlRp4= +github.com/graph-gophers/graphql-go v0.0.0-20190108123631-d5b7dc6be53b/go.mod h1:aRnZGurV3LlZ1Y+ygyx1mAV6OUfq+nu6OgpJ6jKgZ3g= +github.com/graphql-go/graphql v0.7.7/go.mod h1:k6yrAYQaSP59DC5UVxbgxESlmVyojThKdORUqGDGmrI= +github.com/graphql-go/graphql v0.7.9 h1:5Va/Rt4l5g3YjwDnid3vFfn43faaQBq7rMcIZ0VnV34= +github.com/graphql-go/graphql v0.7.9/go.mod h1:k6yrAYQaSP59DC5UVxbgxESlmVyojThKdORUqGDGmrI= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jhump/protoreflect v1.6.1 h1:4/2yi5LyDPP7nN+Hiird1SAJ6YoxUm13/oxHGRnbPd8= +github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/matryer/moq v0.0.0-20200125112110-7615cbe60268 h1:76J+StfuBgQoDIEqBliiA/ua9UhUDN1EyC6e0YkJFzc= +github.com/matryer/moq v0.0.0-20200125112110-7615cbe60268/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.2.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.3.0 h1:iDwIio/3gk2QtLLEsqU5lInaMzos0hDTz8a6lazSFVw= +github.com/mitchellh/mapstructure v1.3.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/nautilus/gateway v0.1.4 h1:vq2c8TtAECDMJYIlGk71NuiMwbNAjKaKmD7de3gJNLI= +github.com/nautilus/gateway v0.1.4/go.mod h1:RxuX3aApDc+xYY7FpS75o6wOSsJcOstS9tFgCwNKC+U= +github.com/nautilus/graphql v0.0.9 h1:si606oOgpARWH7STlA5NoTcCHOf7WfK5pH0AQjskKcE= +github.com/nautilus/graphql v0.0.9/go.mod h1:MQDucBpBRbhwZfeE59tS1DFg7VXS3NvwQpLkgHBmQkg= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k= +github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= +github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= +github.com/vektah/dataloaden v0.3.0 h1:ZfVN2QD6swgvp+tDqdH/OIT/wu3Dhu0cus0k5gIZS84= +github.com/vektah/dataloaden v0.3.0/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= +github.com/vektah/gqlparser v1.1.0 h1:3668p2gUlO+PiS81x957Rpr3/FPRWG6cxgCXAvTS1hw= +github.com/vektah/gqlparser v1.1.0/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= +github.com/vektah/gqlparser/v2 v2.0.1 h1:xgl5abVnsd4hkN9rk65OJID9bfcLSMuTaTcZj777q1o= +github.com/vektah/gqlparser/v2 v2.0.1/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= +github.com/vektah/gqlparser/v2 v2.1.0 h1:uiKJ+T5HMGGQM2kRKQ8Pxw8+Zq9qhhZhz/lieYvCMns= +github.com/vektah/gqlparser/v2 v2.1.0/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200320181102-891825fb96df/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200320220750-118fecf932d8/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120 h1:EZ3cVSzKOlJxAd8e8YAJ7no8nNypTxexh/YE/xW3ZEY= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522 h1:Ve1ORMCxvRmSXBwJK+t3Oy+V2vRW2OetUQBq4rJIkZE= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200321134203-328b4cd54aae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9 h1:YTzHMGlqJu67/uEo1lBv0n3wBXhXNeUbB1XfN2vmTm0= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200225022059-a0ec867d517c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b h1:zSzQJAznWxAh9fZxiPy2FZo+ZZEYoYFYYDYdOrU7AaM= +golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM= -google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.1 h1:M8spwkmx0pHrPq+uMdl22w5CvJ/Y+oAJTIs9oGoCpOE= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.1/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= +sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k= diff --git a/pb/go.mod b/pb/go.mod deleted file mode 100644 index f85182d..0000000 --- a/pb/go.mod +++ /dev/null @@ -1,8 +0,0 @@ -module github.com/danielvladco/go-proto-gql/pb - -go 1.12 - -require ( - github.com/gogo/protobuf v1.2.1 - github.com/golang/protobuf v1.3.1 -) diff --git a/pb/go.sum b/pb/go.sum deleted file mode 100644 index 87d22b8..0000000 --- a/pb/go.sum +++ /dev/null @@ -1,7 +0,0 @@ -github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= -github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/pb/gql.pb.go b/pb/gql.pb.go deleted file mode 100644 index fb98047..0000000 --- a/pb/gql.pb.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: gql.proto - -package gql - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package - -type Type int32 - -const ( - Type_DEFAULT Type = 0 - Type_MUTATION Type = 1 - Type_QUERY Type = 2 -) - -var Type_name = map[int32]string{ - 0: "DEFAULT", - 1: "MUTATION", - 2: "QUERY", -} - -var Type_value = map[string]int32{ - "DEFAULT": 0, - "MUTATION": 1, - "QUERY": 2, -} - -func (x Type) Enum() *Type { - p := new(Type) - *p = x - return p -} - -func (x Type) String() string { - return proto.EnumName(Type_name, int32(x)) -} - -func (x *Type) UnmarshalJSON(data []byte) error { - value, err := proto.UnmarshalJSONEnum(Type_value, data, "Type") - if err != nil { - return err - } - *x = Type(value) - return nil -} - -func (Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_f41526d4337e9701, []int{0} -} - -type Field struct { - Required *bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` - Params *string `protobuf:"bytes,2,opt,name=params" json:"params,omitempty"` - Dirs *string `protobuf:"bytes,3,opt,name=dirs" json:"dirs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Field) Reset() { *m = Field{} } -func (m *Field) String() string { return proto.CompactTextString(m) } -func (*Field) ProtoMessage() {} -func (*Field) Descriptor() ([]byte, []int) { - return fileDescriptor_f41526d4337e9701, []int{0} -} -func (m *Field) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Field.Unmarshal(m, b) -} -func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Field.Marshal(b, m, deterministic) -} -func (m *Field) XXX_Merge(src proto.Message) { - xxx_messageInfo_Field.Merge(m, src) -} -func (m *Field) XXX_Size() int { - return xxx_messageInfo_Field.Size(m) -} -func (m *Field) XXX_DiscardUnknown() { - xxx_messageInfo_Field.DiscardUnknown(m) -} - -var xxx_messageInfo_Field proto.InternalMessageInfo - -func (m *Field) GetRequired() bool { - if m != nil && m.Required != nil { - return *m.Required - } - return false -} - -func (m *Field) GetParams() string { - if m != nil && m.Params != nil { - return *m.Params - } - return "" -} - -func (m *Field) GetDirs() string { - if m != nil && m.Dirs != nil { - return *m.Dirs - } - return "" -} - -var E_RpcType = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MethodOptions)(nil), - ExtensionType: (*Type)(nil), - Field: 65030, - Name: "gql.rpc_type", - Tag: "varint,65030,opt,name=rpc_type,enum=gql.Type", - Filename: "gql.proto", -} - -var E_SvcType = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.ServiceOptions)(nil), - ExtensionType: (*Type)(nil), - Field: 65030, - Name: "gql.svc_type", - Tag: "varint,65030,opt,name=svc_type,enum=gql.Type", - Filename: "gql.proto", -} - -var E_Field = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*Field)(nil), - Field: 65030, - Name: "gql.field", - Tag: "bytes,65030,opt,name=field", - Filename: "gql.proto", -} - -func init() { - proto.RegisterEnum("gql.Type", Type_name, Type_value) - proto.RegisterType((*Field)(nil), "gql.Field") - proto.RegisterExtension(E_RpcType) - proto.RegisterExtension(E_SvcType) - proto.RegisterExtension(E_Field) -} - -func init() { proto.RegisterFile("gql.proto", fileDescriptor_f41526d4337e9701) } - -var fileDescriptor_f41526d4337e9701 = []byte{ - // 312 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0xcf, 0x4b, 0xc3, 0x30, - 0x14, 0xc7, 0xed, 0x7e, 0xb8, 0xf6, 0x4d, 0x64, 0xe4, 0x20, 0x65, 0xa0, 0x0e, 0x4f, 0x43, 0x5d, - 0x0b, 0x3b, 0xce, 0xd3, 0xc4, 0x4d, 0x04, 0xe7, 0xb0, 0x76, 0x07, 0xbd, 0x48, 0xd7, 0x64, 0x59, - 0x20, 0x5b, 0xd2, 0x24, 0x2d, 0xf8, 0x0f, 0xf8, 0x57, 0x7b, 0x90, 0xa6, 0x53, 0x90, 0x81, 0xb7, - 0xf7, 0x5e, 0xf2, 0x3e, 0xdf, 0xef, 0xfb, 0x82, 0x47, 0x33, 0x1e, 0x48, 0x25, 0x8c, 0x40, 0x75, - 0x9a, 0xf1, 0x6e, 0x8f, 0x0a, 0x41, 0x39, 0x09, 0xed, 0x68, 0x99, 0xaf, 0x42, 0x4c, 0x74, 0xaa, - 0x98, 0x34, 0x42, 0x55, 0xdf, 0x2e, 0xe6, 0xd0, 0x9c, 0x32, 0xc2, 0x31, 0xea, 0x82, 0xab, 0x48, - 0x96, 0x33, 0x45, 0xb0, 0xef, 0xf4, 0x9c, 0xbe, 0x1b, 0xfd, 0xf6, 0xe8, 0x04, 0x0e, 0x65, 0xa2, - 0x92, 0x8d, 0xf6, 0x6b, 0x3d, 0xa7, 0xef, 0x45, 0xbb, 0x0e, 0x21, 0x68, 0x60, 0xa6, 0xb4, 0x5f, - 0xb7, 0x53, 0x5b, 0x5f, 0x5e, 0x43, 0x23, 0xfe, 0x90, 0x04, 0xb5, 0xa1, 0x75, 0x37, 0x99, 0x8e, - 0x17, 0x8f, 0x71, 0xe7, 0x00, 0x1d, 0x81, 0x3b, 0x5b, 0xc4, 0xe3, 0xf8, 0x61, 0xfe, 0xd4, 0x71, - 0x90, 0x07, 0xcd, 0xe7, 0xc5, 0x24, 0x7a, 0xed, 0xd4, 0x46, 0x53, 0x70, 0x95, 0x4c, 0xdf, 0x4d, - 0xb9, 0x71, 0x16, 0x54, 0x6e, 0x83, 0x1f, 0xb7, 0xc1, 0x8c, 0x98, 0xb5, 0xc0, 0x73, 0x69, 0x98, - 0xd8, 0x6a, 0xff, 0xf3, 0xab, 0xd4, 0x39, 0x1e, 0x7a, 0x41, 0x79, 0x65, 0x29, 0x12, 0xb5, 0x94, - 0x4c, 0xcb, 0x62, 0x74, 0x0f, 0xae, 0x2e, 0x76, 0x9c, 0xf3, 0x3d, 0xce, 0x0b, 0x51, 0x05, 0x4b, - 0xc9, 0x7f, 0x20, 0x5d, 0x54, 0xa0, 0x31, 0x34, 0x57, 0x36, 0x8f, 0xd3, 0x3d, 0x8a, 0xcd, 0xe9, - 0x2f, 0xa3, 0x3d, 0x04, 0xcb, 0xb0, 0x4f, 0x51, 0xb5, 0x79, 0x3b, 0x78, 0xbb, 0xa2, 0xcc, 0xac, - 0xf3, 0x65, 0x90, 0x8a, 0x4d, 0x88, 0x93, 0x2d, 0x23, 0xbc, 0xe0, 0x09, 0x4e, 0x45, 0x48, 0xc5, - 0xc0, 0xe2, 0x06, 0x34, 0xe3, 0xa1, 0x5c, 0xde, 0xd0, 0x8c, 0x7f, 0x07, 0x00, 0x00, 0xff, 0xff, - 0xdc, 0x6f, 0xfa, 0xa1, 0xb4, 0x01, 0x00, 0x00, -} diff --git a/pb/graphql.pb.go b/pb/graphql.pb.go new file mode 100644 index 0000000..71f52ef --- /dev/null +++ b/pb/graphql.pb.go @@ -0,0 +1,310 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: pb/graphql.proto + +package graphql + +import ( + proto "github.com/golang/protobuf/proto" + descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +type Type int32 + +const ( + Type_DEFAULT Type = 0 + Type_MUTATION Type = 1 + Type_QUERY Type = 2 +) + +// Enum value maps for Type. +var ( + Type_name = map[int32]string{ + 0: "DEFAULT", + 1: "MUTATION", + 2: "QUERY", + } + Type_value = map[string]int32{ + "DEFAULT": 0, + "MUTATION": 1, + "QUERY": 2, + } +) + +func (x Type) Enum() *Type { + p := new(Type) + *p = x + return p +} + +func (x Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Type) Descriptor() protoreflect.EnumDescriptor { + return file_pb_graphql_proto_enumTypes[0].Descriptor() +} + +func (Type) Type() protoreflect.EnumType { + return &file_pb_graphql_proto_enumTypes[0] +} + +func (x Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *Type) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = Type(num) + return nil +} + +// Deprecated: Use Type.Descriptor instead. +func (Type) EnumDescriptor() ([]byte, []int) { + return file_pb_graphql_proto_rawDescGZIP(), []int{0} +} + +type Field struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Required *bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` + Params *string `protobuf:"bytes,2,opt,name=params" json:"params,omitempty"` + Dirs *string `protobuf:"bytes,3,opt,name=dirs" json:"dirs,omitempty"` +} + +func (x *Field) Reset() { + *x = Field{} + if protoimpl.UnsafeEnabled { + mi := &file_pb_graphql_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Field) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Field) ProtoMessage() {} + +func (x *Field) ProtoReflect() protoreflect.Message { + mi := &file_pb_graphql_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Field.ProtoReflect.Descriptor instead. +func (*Field) Descriptor() ([]byte, []int) { + return file_pb_graphql_proto_rawDescGZIP(), []int{0} +} + +func (x *Field) GetRequired() bool { + if x != nil && x.Required != nil { + return *x.Required + } + return false +} + +func (x *Field) GetParams() string { + if x != nil && x.Params != nil { + return *x.Params + } + return "" +} + +func (x *Field) GetDirs() string { + if x != nil && x.Dirs != nil { + return *x.Dirs + } + return "" +} + +var file_pb_graphql_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptor.MethodOptions)(nil), + ExtensionType: (*Type)(nil), + Field: 65030, + Name: "danielvladco.protobuf.graphql.rpc_type", + Tag: "varint,65030,opt,name=rpc_type,enum=danielvladco.protobuf.graphql.Type", + Filename: "pb/graphql.proto", + }, + { + ExtendedType: (*descriptor.ServiceOptions)(nil), + ExtensionType: (*Type)(nil), + Field: 65030, + Name: "danielvladco.protobuf.graphql.svc_type", + Tag: "varint,65030,opt,name=svc_type,enum=danielvladco.protobuf.graphql.Type", + Filename: "pb/graphql.proto", + }, + { + ExtendedType: (*descriptor.FieldOptions)(nil), + ExtensionType: (*Field)(nil), + Field: 65030, + Name: "danielvladco.protobuf.graphql.field", + Tag: "bytes,65030,opt,name=field", + Filename: "pb/graphql.proto", + }, +} + +// Extension fields to descriptor.MethodOptions. +var ( + // optional danielvladco.protobuf.graphql.Type rpc_type = 65030; + E_RpcType = &file_pb_graphql_proto_extTypes[0] +) + +// Extension fields to descriptor.ServiceOptions. +var ( + // optional danielvladco.protobuf.graphql.Type svc_type = 65030; + E_SvcType = &file_pb_graphql_proto_extTypes[1] +) + +// Extension fields to descriptor.FieldOptions. +var ( + // optional danielvladco.protobuf.graphql.Field field = 65030; + E_Field = &file_pb_graphql_proto_extTypes[2] +) + +var File_pb_graphql_proto protoreflect.FileDescriptor + +var file_pb_graphql_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x70, 0x62, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x1d, 0x64, 0x61, 0x6e, 0x69, 0x65, 0x6c, 0x76, 0x6c, 0x61, 0x64, 0x63, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, + 0x6c, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x22, 0x4f, 0x0a, 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x1a, 0x0a, 0x08, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, + 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x69, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x64, 0x69, 0x72, 0x73, 0x2a, 0x2c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, + 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x55, 0x54, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x51, 0x55, 0x45, 0x52, 0x59, + 0x10, 0x02, 0x3a, 0x60, 0x0a, 0x08, 0x72, 0x70, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1e, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x86, + 0xfc, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x64, 0x61, 0x6e, 0x69, 0x65, 0x6c, 0x76, + 0x6c, 0x61, 0x64, 0x63, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x67, + 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x72, 0x70, 0x63, + 0x54, 0x79, 0x70, 0x65, 0x3a, 0x61, 0x0a, 0x08, 0x73, 0x76, 0x63, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x18, 0x86, 0xfc, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x64, 0x61, 0x6e, 0x69, + 0x65, 0x6c, 0x76, 0x6c, 0x61, 0x64, 0x63, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, + 0x73, 0x76, 0x63, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x5b, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x86, 0xfc, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x64, 0x61, 0x6e, 0x69, 0x65, 0x6c, + 0x76, 0x6c, 0x61, 0x64, 0x63, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x64, 0x61, 0x6e, 0x69, 0x65, 0x6c, 0x76, 0x6c, 0x61, 0x64, 0x63, 0x6f, 0x2f, + 0x67, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x67, 0x71, 0x6c, 0x2f, 0x70, 0x62, 0x3b, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, +} + +var ( + file_pb_graphql_proto_rawDescOnce sync.Once + file_pb_graphql_proto_rawDescData = file_pb_graphql_proto_rawDesc +) + +func file_pb_graphql_proto_rawDescGZIP() []byte { + file_pb_graphql_proto_rawDescOnce.Do(func() { + file_pb_graphql_proto_rawDescData = protoimpl.X.CompressGZIP(file_pb_graphql_proto_rawDescData) + }) + return file_pb_graphql_proto_rawDescData +} + +var file_pb_graphql_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_pb_graphql_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_pb_graphql_proto_goTypes = []interface{}{ + (Type)(0), // 0: danielvladco.protobuf.graphql.Type + (*Field)(nil), // 1: danielvladco.protobuf.graphql.Field + (*descriptor.MethodOptions)(nil), // 2: google.protobuf.MethodOptions + (*descriptor.ServiceOptions)(nil), // 3: google.protobuf.ServiceOptions + (*descriptor.FieldOptions)(nil), // 4: google.protobuf.FieldOptions +} +var file_pb_graphql_proto_depIdxs = []int32{ + 2, // 0: danielvladco.protobuf.graphql.rpc_type:extendee -> google.protobuf.MethodOptions + 3, // 1: danielvladco.protobuf.graphql.svc_type:extendee -> google.protobuf.ServiceOptions + 4, // 2: danielvladco.protobuf.graphql.field:extendee -> google.protobuf.FieldOptions + 0, // 3: danielvladco.protobuf.graphql.rpc_type:type_name -> danielvladco.protobuf.graphql.Type + 0, // 4: danielvladco.protobuf.graphql.svc_type:type_name -> danielvladco.protobuf.graphql.Type + 1, // 5: danielvladco.protobuf.graphql.field:type_name -> danielvladco.protobuf.graphql.Field + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 3, // [3:6] is the sub-list for extension type_name + 0, // [0:3] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_pb_graphql_proto_init() } +func file_pb_graphql_proto_init() { + if File_pb_graphql_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_pb_graphql_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Field); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_pb_graphql_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 3, + NumServices: 0, + }, + GoTypes: file_pb_graphql_proto_goTypes, + DependencyIndexes: file_pb_graphql_proto_depIdxs, + EnumInfos: file_pb_graphql_proto_enumTypes, + MessageInfos: file_pb_graphql_proto_msgTypes, + ExtensionInfos: file_pb_graphql_proto_extTypes, + }.Build() + File_pb_graphql_proto = out.File + file_pb_graphql_proto_rawDesc = nil + file_pb_graphql_proto_goTypes = nil + file_pb_graphql_proto_depIdxs = nil +} diff --git a/pb/gql.proto b/pb/graphql.proto similarity index 83% rename from pb/gql.proto rename to pb/graphql.proto index d68d8aa..e57b674 100644 --- a/pb/gql.proto +++ b/pb/graphql.proto @@ -1,7 +1,7 @@ syntax = "proto2"; -package gql; +package danielvladco.protobuf.graphql; -option go_package = "github.com/danielvladco/go-proto-gql/pb;gql"; +option go_package = "github.com/danielvladco/go-proto-gql/pb;graphql"; import "google/protobuf/descriptor.proto"; diff --git a/pb/types.go b/pb/types.go deleted file mode 100644 index b70a0b2..0000000 --- a/pb/types.go +++ /dev/null @@ -1,172 +0,0 @@ -package gql - -import ( - "context" - "encoding/json" - "fmt" - "io" - "strconv" - - "github.com/golang/protobuf/ptypes" - "github.com/golang/protobuf/ptypes/any" -) - -type DummyResolver struct{} - -func (r *DummyResolver) Dummy(ctx context.Context) (*bool, error) { return nil, nil } - -func MarshalBytes(b []byte) Marshaler { - return WriterFunc(func(w io.Writer) { - _, _ = fmt.Fprintf(w, "%q", string(b)) - }) -} - -func UnmarshalBytes(v interface{}) ([]byte, error) { - switch v := v.(type) { - case string: - return []byte(v), nil - case *string: - return []byte(*v), nil - case []byte: - return v, nil - case json.RawMessage: - return []byte(v), nil - default: - return nil, fmt.Errorf("%T is not []byte", v) - } -} - -func MarshalAny(any any.Any) Marshaler { - return WriterFunc(func(w io.Writer) { - d := &ptypes.DynamicAny{} - if err := ptypes.UnmarshalAny(&any, d); err != nil { - panic("unable to unmarshal any: " + err.Error()) - return - } - - if err := json.NewEncoder(w).Encode(d.Message); err != nil { - panic("unable to encode json: " + err.Error()) - } - }) -} - -func UnmarshalAny(v interface{}) (any.Any, error) { - switch v := v.(type) { - case []byte: - return any.Any{}, nil //TODO add an unmarshal mechanism - case json.RawMessage: - return any.Any{}, nil - default: - return any.Any{}, fmt.Errorf("%T is not json.RawMessage", v) - } -} - -func MarshalInt32(any int32) Marshaler { - return WriterFunc(func(w io.Writer) { - _, _ = w.Write([]byte(strconv.Itoa(int(any)))) - }) -} - -func UnmarshalInt32(v interface{}) (int32, error) { - switch v := v.(type) { - case int: - return int32(v), nil - case int32: - return v, nil - case json.Number: - i, err := v.Int64() - return int32(i), err - default: - return 0, fmt.Errorf("%T is not int32", v) - } -} - -func MarshalInt64(any int64) Marshaler { - return WriterFunc(func(w io.Writer) { - _, _ = w.Write([]byte(strconv.Itoa(int(any)))) - }) -} - -func UnmarshalInt64(v interface{}) (int64, error) { - switch v := v.(type) { - case int: - return int64(v), nil - case int64: - return v, nil - case json.Number: - i, err := v.Int64() - return i, err - default: - return 0, fmt.Errorf("%T is not int32", v) - } -} - -func MarshalUint32(any uint32) Marshaler { - return WriterFunc(func(w io.Writer) { - _, _ = w.Write([]byte(strconv.Itoa(int(any)))) - }) -} - -func UnmarshalUint32(v interface{}) (uint32, error) { - switch v := v.(type) { - case int: - return uint32(v), nil - case uint32: - return v, nil - case json.Number: - i, err := v.Int64() - return uint32(i), err - default: - return 0, fmt.Errorf("%T is not int32", v) - } -} - -func MarshalUint64(any uint64) Marshaler { - return WriterFunc(func(w io.Writer) { - _, _ = w.Write([]byte(strconv.Itoa(int(any)))) - }) -} - -func UnmarshalUint64(v interface{}) (uint64, error) { - switch v := v.(type) { - case int: - return uint64(v), nil - case uint64: - return v, nil //TODO add an unmarshal mechanism - case json.Number: - i, err := v.Int64() - return uint64(i), err - default: - return 0, fmt.Errorf("%T is not uint64", v) - } -} - -func MarshalFloat32(any float32) Marshaler { - return WriterFunc(func(w io.Writer) { - _, _ = w.Write([]byte(strconv.Itoa(int(any)))) - }) -} - -func UnmarshalFloat32(v interface{}) (float32, error) { - switch v := v.(type) { - case int: - return float32(v), nil - case float32: - return v, nil - case json.Number: - f, err := v.Float64() - return float32(f), err - default: - return 0, fmt.Errorf("%T is not float32", v) - } -} - -type Marshaler interface { - MarshalGQL(w io.Writer) -} - -type WriterFunc func(writer io.Writer) - -func (f WriterFunc) MarshalGQL(w io.Writer) { - f(w) -} diff --git a/pkg/generator/callstack.go b/pkg/generator/callstack.go new file mode 100644 index 0000000..e5b25ff --- /dev/null +++ b/pkg/generator/callstack.go @@ -0,0 +1,51 @@ +package generator + +type Callstack interface { + Push(entry interface{}) + Pop(entry interface{}) + Has(entry interface{}) bool + Free() + Len() int +} + +func NewCallstack() Callstack { + return &callstack{stack: make(map[interface{}]int), index: 0} +} + +type callstack struct { + stack map[interface{}]int + sorted []string + index int +} + +func (c *callstack) Free() { + c.stack = make(map[interface{}]int) + c.index = 0 +} + +func (c *callstack) Pop(entry interface{}) { + delete(c.stack, entry) + c.index-- +} + +func (c *callstack) Push(entry interface{}) { + c.stack[entry] = c.index + c.index++ +} + +func (c *callstack) List() []interface{} { + res := make([]interface{}, len(c.stack)) + for s, si := range c.stack { + res[si] = s + } + return res +} + +func (c *callstack) Has(entry interface{}) bool { + _, ok := c.stack[entry] + return ok +} + +func (c *callstack) Len() int { + return len(c.stack) +} diff --git a/pkg/generator/descriptors.go b/pkg/generator/descriptors.go new file mode 100644 index 0000000..a950d81 --- /dev/null +++ b/pkg/generator/descriptors.go @@ -0,0 +1,72 @@ +package generator + +import ( + "strings" + + "github.com/jhump/protoreflect/desc" + "github.com/vektah/gqlparser/v2/ast" + any "google.golang.org/protobuf/types/known/anypb" +) + +type ObjectDescriptor struct { + *ast.Definition + desc.Descriptor + + fields []*FieldDescriptor + fieldNames map[string]*FieldDescriptor +} + +func (o *ObjectDescriptor) AsGraphql() *ast.Definition { + return o.Definition +} + +func (o *ObjectDescriptor) uniqueName(f *desc.FieldDescriptor) string { + return strings.Title(f.GetName()) +} + +func (o *ObjectDescriptor) IsInput() bool { + return o.Kind == ast.InputObject +} + +func (o *ObjectDescriptor) GetFields() []*FieldDescriptor { + return o.fields +} + +func (o *ObjectDescriptor) IsMessage() bool { + _, ok := o.Descriptor.(*desc.MessageDescriptor) + return ok +} + +// same isEmpty but for mortals +func IsEmpty(o *desc.MessageDescriptor) bool { return isEmpty(o, NewCallstack()) } + +// make sure objects are fulled with all objects +func isEmpty(o *desc.MessageDescriptor, callstack Callstack) bool { + callstack.Push(o) + defer callstack.Pop(o) + + if len(o.GetFields()) == 0 { + return true + } + for _, f := range o.GetFields() { + objType := f.GetMessageType() + if objType == nil { + return false + } + + // check if the call stack already contains a reference to this type and prevent it from calling itself again + if callstack.Has(objType) { + return true + } + if !isEmpty(objType, callstack) { + return false + } + } + + return true +} + +// TODO maybe not compare by strings +func IsAny(o *desc.MessageDescriptor) bool { + return string((&any.Any{}).ProtoReflect().Descriptor().FullName()) == o.GetFullyQualifiedName() +} diff --git a/pkg/generator/generator.go b/pkg/generator/generator.go new file mode 100644 index 0000000..175845d --- /dev/null +++ b/pkg/generator/generator.go @@ -0,0 +1,662 @@ +package generator + +import ( + "fmt" + "strconv" + "strings" + + "github.com/jhump/protoreflect/desc" + "github.com/vektah/gqlparser/v2/ast" + "google.golang.org/protobuf/proto" + descriptor "google.golang.org/protobuf/types/descriptorpb" + + gqlpb "github.com/danielvladco/go-proto-gql/pb" +) + +func NewSchemas(files []*desc.FileDescriptor, mergeSchemas, genServiceDesc bool) (schemas SchemaDescriptorList, _ error) { + if mergeSchemas { + schema := NewSchemaDescriptor(genServiceDesc) + for _, file := range files { + err := generateFile(file, schema) + if err != nil { + return nil, err + } + } + + return []*SchemaDescriptor{schema}, nil + } + + for _, file := range files { + schema := NewSchemaDescriptor(genServiceDesc) + err := generateFile(file, schema) + if err != nil { + return nil, err + } + + schemas = append(schemas, schema) + } + + return +} + +func generateFile(file *desc.FileDescriptor, schema *SchemaDescriptor) error { + schema.FileDescriptors = append(schema.FileDescriptors, file) + + for _, svc := range file.GetServices() { + for _, rpc := range svc.GetMethods() { + in, err := schema.CreateObjects(rpc.GetInputType(), true) + if err != nil { + return err + } + + out, err := schema.CreateObjects(rpc.GetOutputType(), false) + if err != nil { + return err + } + + if rpc.IsClientStreaming() && rpc.IsServerStreaming() { + schema.GetMutation().addMethod(schema.createMethod(svc, rpc, in, out)) + } + + if rpc.IsServerStreaming() { + schema.GetSubscription().addMethod(schema.createMethod(svc, rpc, in, out)) + } else { + switch getMethodType(rpc) { + case gqlpb.Type_DEFAULT: + switch ttt := getServiceType(svc); ttt { + case gqlpb.Type_DEFAULT, gqlpb.Type_MUTATION: + schema.GetMutation().addMethod(schema.createMethod(svc, rpc, in, out)) + case gqlpb.Type_QUERY: + schema.GetQuery().addMethod(schema.createMethod(svc, rpc, in, out)) + } + case gqlpb.Type_MUTATION: + schema.GetMutation().addMethod(schema.createMethod(svc, rpc, in, out)) + case gqlpb.Type_QUERY: + schema.GetQuery().addMethod(schema.createMethod(svc, rpc, in, out)) + } + } + } + } + + return nil +} + +type SchemaDescriptorList []*SchemaDescriptor + +func (s SchemaDescriptorList) AsGraphql() (astSchema []*ast.Schema) { + for _, ss := range s { + astSchema = append(astSchema, ss.AsGraphql()) + } + return +} + +func NewSchemaDescriptor(genServiceDesc bool) *SchemaDescriptor { + return &SchemaDescriptor{ + Schema: &ast.Schema{ + Directives: map[string]*ast.DirectiveDefinition{}, + Types: map[string]*ast.Definition{}, + }, + reservedNames: graphqlReservedNames, + createdObjects: map[createdObjectKey]*ObjectDescriptor{}, + generateServiceDescriptors: genServiceDesc, + } +} + +type SchemaDescriptor struct { + *ast.Schema + + FileDescriptors []*desc.FileDescriptor + + files []*desc.FileDescriptor + + query *RootDefinition + mutation *RootDefinition + subscription *RootDefinition + + objects []*ObjectDescriptor + + reservedNames map[string]desc.Descriptor + createdObjects map[createdObjectKey]*ObjectDescriptor + + generateServiceDescriptors bool +} + +type createdObjectKey struct { + desc desc.Descriptor + input bool +} + +func (s *SchemaDescriptor) AsGraphql() *ast.Schema { + queryDef := s.GetQuery().Definition + mutationDef := s.GetMutation().Definition + subscriptionsDef := s.GetSubscription().Definition + s.Schema.Query = queryDef + s.Schema.Types["Query"] = queryDef + if s.query.methods == nil { + s.Schema.Query.Fields = append(s.Schema.Query.Fields, &ast.FieldDefinition{ + Name: "dummy", + Type: ast.NamedType("Boolean", &ast.Position{}), + }) + } + if s.mutation.methods != nil { + s.Schema.Mutation = mutationDef + s.Schema.Types["Mutation"] = mutationDef + } + if s.subscription.methods != nil { + s.Schema.Subscription = subscriptionsDef + s.Schema.Types["Subscription"] = subscriptionsDef + } + + for _, o := range s.objects { + def := o.AsGraphql() + s.Schema.Types[def.Name] = def + } + return s.Schema +} + +func (s *SchemaDescriptor) Objects() []*ObjectDescriptor { + return s.objects +} + +func (s *SchemaDescriptor) GetMutation() *RootDefinition { + if s.mutation == nil { + s.mutation = NewRootDefinition(Mutation) + } + return s.mutation +} + +func (s *SchemaDescriptor) GetSubscription() *RootDefinition { + if s.subscription == nil { + s.subscription = NewRootDefinition(Subscription) + } + return s.subscription +} + +func (s *SchemaDescriptor) GetQuery() *RootDefinition { + if s.query == nil { + s.query = NewRootDefinition(Query) + } + + return s.query +} + +// make name be unique +// just create a map and register every name +func (s *SchemaDescriptor) uniqueName(d desc.Descriptor, input bool) (name string) { + if _, ok := d.(*desc.MessageDescriptor); input && ok { + name = strings.Title(CamelCaseSlice(strings.Split(strings.TrimPrefix(d.GetFullyQualifiedName(), d.GetFile().GetPackage()+"."), ".")) + "Input") + } else { + name = strings.Title(CamelCaseSlice(strings.Split(strings.TrimPrefix(d.GetFullyQualifiedName(), d.GetFile().GetPackage()+"."), "."))) + } + + d2, ok := s.reservedNames[name] + if ok { + if d == d2 { + return name //fixme + } + } + + originalName := name + for uniqueSuffix := 0; ; uniqueSuffix++ { + _, ok := s.reservedNames[name] + if !ok { + break + } + if uniqueSuffix == 0 { + name = CamelCaseSlice(strings.Split(d.GetFile().GetPackage(), ".")) + "_" + originalName + continue + } + name = CamelCaseSlice(strings.Split(d.GetFile().GetPackage(), ".")) + "_" + originalName + strconv.Itoa(uniqueSuffix) + } + + s.reservedNames[name] = d + return +} + +func (s *SchemaDescriptor) CreateObjects(msg *desc.MessageDescriptor, input bool) (*ObjectDescriptor, error) { + return s.createObjects(msg, input, NewCallstack()) +} + +func (s *SchemaDescriptor) createObjects(d desc.Descriptor, input bool, callstack Callstack) (obj *ObjectDescriptor, err error) { + // the case if trying to resolve a primitive as a object. In this case we just return nil + if d == nil { + return + } + if obj, ok := s.createdObjects[createdObjectKey{d, input}]; ok { + return obj, nil + } + callstack.Push(d) // if add a return statement dont forget to clean stack + defer func() { + callstack.Pop(d) + s.createdObjects[createdObjectKey{d, input}] = obj + }() + switch dd := d.(type) { + case *desc.MessageDescriptor: + if IsEmpty(dd) { + return obj, nil + } + if IsAny(dd) { + any := s.createScalar(s.uniqueName(dd, false), "Any is any json type") + return any, nil + } + + kind := ast.Object + if input { + kind = ast.InputObject + } + fields := FieldDescriptorList{} + outputOneofRegistrar := map[*desc.OneOfDescriptor]struct{}{} + + for _, df := range dd.GetFields() { + var fieldDirective []*ast.Directive + if callstack.Has(df.GetMessageType()) { + continue + } + + if oneof := df.GetOneOf(); oneof != nil { + if !input { + if _, ok := outputOneofRegistrar[oneof]; ok { + continue + } + outputOneofRegistrar[oneof] = struct{}{} + field, err := s.createUnion(oneof, callstack) + if err != nil { + return nil, err + } + fields = append(fields, field) + continue + } + + // create oneofs as directives for input objects + directive := &ast.DirectiveDefinition{ + Description: getDescription(oneof), + Name: s.uniqueName(oneof, input), + Locations: []ast.DirectiveLocation{ast.LocationInputFieldDefinition}, + Position: &ast.Position{Src: &ast.Source{}}, + } + s.Schema.Directives[directive.Name] = directive + fieldDirective = append(fieldDirective, &ast.Directive{ + Name: directive.Name, + Position: &ast.Position{Src: &ast.Source{}}, + //ParentDefinition: obj.Definition, TODO + Definition: directive, + Location: ast.LocationInputFieldDefinition, + }) + } + + obj, err = s.createObjects(resolveFieldType(df), input, callstack) + if err != nil { + return nil, err + } + if obj == nil && df.GetMessageType() != nil { + continue + } + f, err := s.createField(df, obj) + if err != nil { + return nil, err + } + f.Directives = fieldDirective + fields = append(fields, f) + } + + obj = &ObjectDescriptor{ + Definition: &ast.Definition{ + Kind: kind, + Description: getDescription(d), + Name: s.uniqueName(d, input), + Fields: fields.AsGraphql(), + Position: &ast.Position{}, + }, + Descriptor: d, + fields: fields, + } + case *desc.EnumDescriptor: + obj = &ObjectDescriptor{ + Definition: &ast.Definition{ + Kind: ast.Enum, + Description: getDescription(d), + Name: s.uniqueName(d, input), + EnumValues: enumValues(dd.GetValues()), + Position: &ast.Position{}, + }, + Descriptor: d, + } + default: + panic(fmt.Sprintf("received unexpected value %v of type %T", dd, dd)) + } + + s.objects = append(s.objects, obj) + return obj, nil +} + +func resolveFieldType(field *desc.FieldDescriptor) desc.Descriptor { + msgType := field.GetMessageType() + enumType := field.GetEnumType() + if msgType != nil { + return msgType + } + if enumType != nil { + return enumType + } + return nil +} + +func enumValues(evals []*desc.EnumValueDescriptor) (vlist ast.EnumValueList) { + for _, eval := range evals { + vlist = append(vlist, &ast.EnumValueDefinition{ + Description: getDescription(eval), + Name: eval.GetName(), + Position: &ast.Position{}, + }) + } + + return vlist +} + +type FieldDescriptorList []*FieldDescriptor + +func (fl FieldDescriptorList) AsGraphql() (dl []*ast.FieldDefinition) { + for _, f := range fl { + dl = append(dl, f.FieldDefinition) + } + return dl +} + +type FieldDescriptor struct { + *ast.FieldDefinition + *desc.FieldDescriptor + + typ *ObjectDescriptor +} + +func (f *FieldDescriptor) GetType() *ObjectDescriptor { + return f.typ +} + +type MethodDescriptor struct { + *desc.ServiceDescriptor + *desc.MethodDescriptor + + *ast.FieldDefinition + + input *ObjectDescriptor + output *ObjectDescriptor +} + +func (m *MethodDescriptor) AsGraphql() *ast.FieldDefinition { + return m.FieldDefinition +} + +func (m *MethodDescriptor) GetInput() *ObjectDescriptor { + return m.input +} + +func (m *MethodDescriptor) GetOutput() *ObjectDescriptor { + return m.output +} + +type RootDefinition struct { + *ast.Definition + + methods []*MethodDescriptor + methodNames map[string]*MethodDescriptor +} + +func (r *RootDefinition) Methods() []*MethodDescriptor { + return r.methods +} + +func (r *RootDefinition) addMethod(method *MethodDescriptor) { + r.methods = append(r.methods, method) + // TODO maybe not do it here? + r.Definition.Fields = append(r.Definition.Fields, method.FieldDefinition) +} + +type rootName string + +const ( + Mutation rootName = "Mutation" + Query rootName = "Query" + Subscription rootName = "Subscription" +) + +func NewRootDefinition(name rootName) *RootDefinition { + return &RootDefinition{Definition: &ast.Definition{ + Kind: ast.Object, + Name: string(name), + Position: &ast.Position{}, + }} +} + +func getDescription(descs ...desc.Descriptor) string { + var description []string + for _, d := range descs { + info := d.GetSourceInfo() + if info == nil { + continue + } + if info.LeadingComments != nil { + description = append(description, *info.LeadingComments) + } + if info.TrailingComments != nil { + description = append(description, *info.TrailingComments) + } + } + + return strings.Join(description, "\n") +} + +func (s *SchemaDescriptor) createMethod(svc *desc.ServiceDescriptor, rpc *desc.MethodDescriptor, in, out *ObjectDescriptor) *MethodDescriptor { + var args ast.ArgumentDefinitionList + if in != nil && (in.Descriptor != nil && !IsEmpty(in.Descriptor.(*desc.MessageDescriptor)) || in.Definition.Kind == ast.Scalar) { + args = append(args, &ast.ArgumentDefinition{ + Name: "in", + Type: ast.NamedType(in.Name, &ast.Position{}), + Position: &ast.Position{}, + }) + } + objType := ast.NamedType("Boolean", &ast.Position{}) + if out != nil && (out.Descriptor != nil && !IsEmpty(out.Descriptor.(*desc.MessageDescriptor)) || in.Definition.Kind == ast.Scalar) { + objType = ast.NamedType(out.Name, &ast.Position{}) + } + + svcDir := &ast.DirectiveDefinition{ + Description: getDescription(svc), + Name: svc.GetName(), + Locations: []ast.DirectiveLocation{ast.LocationFieldDefinition}, + Position: &ast.Position{Src: &ast.Source{}}, + } + s.Schema.Directives[svcDir.Name] = svcDir + + m := &MethodDescriptor{ + ServiceDescriptor: svc, + MethodDescriptor: rpc, + FieldDefinition: &ast.FieldDefinition{ + Description: getDescription(rpc), + Name: ToLowerFirst(svc.GetName()) + strings.Title(rpc.GetName()), + Arguments: args, + Type: objType, + Position: &ast.Position{}, + }, + input: in, + output: out, + } + if s.generateServiceDescriptors { + m.Directives = []*ast.Directive{{ + Name: svcDir.Name, + Position: &ast.Position{}, + Definition: svcDir, + Location: svcDir.Locations[0], + }} + } + return m +} + +func (s *SchemaDescriptor) createField(field *desc.FieldDescriptor, obj *ObjectDescriptor) (_ *FieldDescriptor, err error) { + fieldAst := &ast.FieldDefinition{ + Description: getDescription(field), + Name: ToLowerFirst(CamelCase(field.GetName())), + Type: &ast.Type{Position: &ast.Position{}}, + Position: &ast.Position{}, + } + switch field.GetType() { + case descriptor.FieldDescriptorProto_TYPE_DOUBLE, + descriptor.FieldDescriptorProto_TYPE_FLOAT: + fieldAst.Type.NamedType = ScalarFloat + + case descriptor.FieldDescriptorProto_TYPE_BYTES: + scalar := s.createScalar("Bytes", "") + fieldAst.Type.NamedType = scalar.Name + + case descriptor.FieldDescriptorProto_TYPE_INT64, + descriptor.FieldDescriptorProto_TYPE_SINT64, + descriptor.FieldDescriptorProto_TYPE_SFIXED64, + descriptor.FieldDescriptorProto_TYPE_INT32, + descriptor.FieldDescriptorProto_TYPE_SINT32, + descriptor.FieldDescriptorProto_TYPE_SFIXED32, + descriptor.FieldDescriptorProto_TYPE_UINT32, + descriptor.FieldDescriptorProto_TYPE_FIXED32, + descriptor.FieldDescriptorProto_TYPE_UINT64, + descriptor.FieldDescriptorProto_TYPE_FIXED64: + fieldAst.Type.NamedType = ScalarInt + + case descriptor.FieldDescriptorProto_TYPE_BOOL: + fieldAst.Type.NamedType = ScalarBoolean + + case descriptor.FieldDescriptorProto_TYPE_STRING: + fieldAst.Type.NamedType = ScalarString + + case descriptor.FieldDescriptorProto_TYPE_GROUP: + return nil, fmt.Errorf("proto2 groups are not supported please use proto3 syntax") + + case descriptor.FieldDescriptorProto_TYPE_ENUM: + fieldAst.Type.NamedType = obj.Name + + case descriptor.FieldDescriptorProto_TYPE_MESSAGE: + fieldAst.Type.NamedType = obj.Name + + default: + panic("unknown proto field type") + } + + if isRepeated(field) { + fieldAst.Type = ast.ListType(fieldAst.Type, &ast.Position{}) + fieldAst.Type.Elem.NonNull = true + } + if isRequired(field) { + fieldAst.Type.NonNull = true + } + + return &FieldDescriptor{ + FieldDefinition: fieldAst, + FieldDescriptor: field, + typ: obj, + }, nil +} + +func (s *SchemaDescriptor) createScalar(name string, description string) *ObjectDescriptor { + obj := &ObjectDescriptor{ + Definition: &ast.Definition{ + Kind: ast.Scalar, + Description: description, + Name: name, + Position: &ast.Position{}, + }, + } + s.objects = append(s.objects, obj) + return obj +} + +func (s *SchemaDescriptor) createUnion(oneof *desc.OneOfDescriptor, callstack Callstack) (*FieldDescriptor, error) { + var types []string + for _, choice := range oneof.GetChoices() { + obj, err := s.createObjects(resolveFieldType(choice), false, callstack) + if err != nil { + return nil, err + } + f, err := s.createField(choice, obj) + if err != nil { + return nil, err + } + + obj = &ObjectDescriptor{ + Definition: &ast.Definition{ + Kind: ast.Object, + Description: getDescription(f), + Name: CamelCaseSlice(strings.Split(strings.Trim(choice.GetParent().GetName()+"."+strings.Title(f.GetName()), "."), ".")), + Fields: ast.FieldList{f.FieldDefinition}, + Position: &ast.Position{}, + }, + Descriptor: f, + fields: []*FieldDescriptor{f}, + fieldNames: map[string]*FieldDescriptor{}, + } + s.objects = append(s.objects, obj) + types = append(types, obj.Name) + } + obj := &ObjectDescriptor{ + Definition: &ast.Definition{ + Kind: ast.Union, + Description: getDescription(oneof), + Name: s.uniqueName(oneof, false), + Types: types, + Position: &ast.Position{}, + }, + Descriptor: oneof, + } + s.objects = append(s.objects, obj) + + return &FieldDescriptor{ + FieldDefinition: &ast.FieldDefinition{ + Description: getDescription(oneof), + Name: ToLowerFirst(CamelCase(oneof.GetName())), + Type: ast.NamedType(obj.Name, &ast.Position{}), + Position: &ast.Position{}, + }, + FieldDescriptor: nil, + typ: obj, + }, nil +} + +func isRepeated(field *desc.FieldDescriptor) bool { + return field.GetLabel() == descriptor.FieldDescriptorProto_LABEL_REPEATED +} + +func isRequired(field *desc.FieldDescriptor) bool { + if v := graphqlFieldOptions(field); v != nil { + return v.GetRequired() + } + return false +} + +func graphqlFieldOptions(field *desc.FieldDescriptor) *gqlpb.Field { + if field.GetOptions() != nil { + v := proto.GetExtension(field.AsFieldDescriptorProto().GetOptions(), gqlpb.E_Field) + if v != nil && v.(*gqlpb.Field) != nil { + return v.(*gqlpb.Field) + } + } + return nil +} + +const ( + ScalarInt = "Int" + ScalarFloat = "Float" + ScalarString = "String" + ScalarBoolean = "Boolean" + ScalarID = "ID" +) + +var graphqlReservedNames = map[string]desc.Descriptor{ + "__Directive": nil, + "__Type": nil, + "__Field": nil, + "__EnumValue": nil, + "__InputValue": nil, + "__Schema": nil, + "Int": nil, + "Float": nil, + "String": nil, + "Boolean": nil, + "ID": nil, +} diff --git a/pkg/generator/registry.go b/pkg/generator/registry.go new file mode 100644 index 0000000..91f05d0 --- /dev/null +++ b/pkg/generator/registry.go @@ -0,0 +1,74 @@ +package generator + +import ( + "github.com/jhump/protoreflect/desc" + "github.com/vektah/gqlparser/v2/ast" +) + +type Registry interface { + FindMethodByName(name string) *desc.MethodDescriptor + FindObjectByName(name string) *desc.MessageDescriptor + + // Todo maybe find a better way to get ast definition + FindObjectByFullyQualifiedName(fqn string) (*desc.MessageDescriptor, *ast.Definition) + FindFieldByName(msg desc.Descriptor, name string) *desc.FieldDescriptor +} + +func NewRegistry(files SchemaDescriptorList) Registry { + v := &repository{ + methodsByName: map[string]*desc.MethodDescriptor{}, + objectsByName: map[string]*desc.MessageDescriptor{}, + objectsByFQN: map[string]*ObjectDescriptor{}, + gqlFieldsByName: map[desc.Descriptor]map[string]*desc.FieldDescriptor{}, + } + for _, f := range files { + for _, m := range f.GetMutation().Methods() { + v.methodsByName[m.Name] = m.MethodDescriptor + } + } + for _, f := range files { + for _, m := range f.Objects() { + v.gqlFieldsByName[m.Descriptor] = map[string]*desc.FieldDescriptor{} + for _, f := range m.GetFields() { + v.gqlFieldsByName[m.Descriptor][f.Name] = f.FieldDescriptor + } + + switch msgDesc := m.Descriptor.(type) { + case *desc.MessageDescriptor: + v.objectsByFQN[m.GetFullyQualifiedName()] = m + v.objectsByName[m.Name] = msgDesc + } + } + } + return v +} + +type repository struct { + files SchemaDescriptorList + + methodsByName map[string]*desc.MethodDescriptor + objectsByName map[string]*desc.MessageDescriptor + objectsByFQN map[string]*ObjectDescriptor + gqlFieldsByName map[desc.Descriptor]map[string]*desc.FieldDescriptor +} + +func (r repository) FindMethodByName(name string) *desc.MethodDescriptor { + m, _ := r.methodsByName[name] + return m +} + +func (r repository) FindObjectByName(name string) *desc.MessageDescriptor { + o, _ := r.objectsByName[name] + return o +} + +func (r repository) FindObjectByFullyQualifiedName(fqn string) (*desc.MessageDescriptor, *ast.Definition) { + o, _ := r.objectsByFQN[fqn] + msg, _ := o.Descriptor.(*desc.MessageDescriptor) + return msg, o.Definition +} + +func (r repository) FindFieldByName(msg desc.Descriptor, name string) *desc.FieldDescriptor { + f, _ := r.gqlFieldsByName[msg][name] + return f +} diff --git a/plugin/camelcase.go b/pkg/generator/utils.go similarity index 51% rename from plugin/camelcase.go rename to pkg/generator/utils.go index 5864e49..a7dd894 100644 --- a/plugin/camelcase.go +++ b/pkg/generator/utils.go @@ -1,10 +1,38 @@ -package plugin +package generator import ( + "strings" "unicode" "unicode/utf8" + + "github.com/jhump/protoreflect/desc" + "google.golang.org/protobuf/proto" + + gqlpb "github.com/danielvladco/go-proto-gql/pb" ) +func getMethodType(rpc *desc.MethodDescriptor) gqlpb.Type { + if rpc.GetOptions() != nil { + v := proto.GetExtension(rpc.AsMethodDescriptorProto().GetOptions(), gqlpb.E_RpcType) + if v != nil { + return v.(gqlpb.Type) + } + } + + return gqlpb.Type_DEFAULT +} + +func getServiceType(svc *desc.ServiceDescriptor) gqlpb.Type { + if svc.GetOptions() != nil { + v := proto.GetExtension(svc.AsServiceDescriptorProto().GetOptions(), gqlpb.E_SvcType) + if v != nil { + return v.(gqlpb.Type) + } + } + + return gqlpb.Type_DEFAULT +} + // Split splits the camelcase word and returns a list of words. It also // supports digits. Both lower camel case and upper camel case are supported. // For more info please check: http://en.wikipedia.org/wiki/CamelCase @@ -86,3 +114,71 @@ func SplitCamelCase(src string) (entries []string) { } return } + +// CamelCase returns the CamelCased name. +// If there is an interior underscore followed by a lower case letter, +// drop the underscore and convert the letter to upper case. +// There is a remote possibility of this rewrite causing a name collision, +// but it's so remote we're prepared to pretend it's nonexistent - since the +// C++ generator lowercases names, it's extremely unlikely to have two fields +// with different capitalizations. +// In short, _my_field_name_2 becomes XMyFieldName_2. +func CamelCase(s string) string { + if s == "" { + return "" + } + t := make([]byte, 0, 32) + i := 0 + if s[0] == '_' { + // Need a capital letter; drop the '_'. + t = append(t, 'X') + i++ + } + // Invariant: if the next letter is lower case, it must be converted + // to upper case. + // That is, we process a word at a time, where words are marked by _ or + // upper case letter. Digits are treated as words. + for ; i < len(s); i++ { + c := s[i] + if c == '_' && i+1 < len(s) && isASCIILower(s[i+1]) { + continue // Skip the underscore in s. + } + if isASCIIDigit(c) { + t = append(t, c) + continue + } + // Assume we have a letter now - if not, it's a bogus identifier. + // The next word is a sequence of characters that must start upper case. + if isASCIILower(c) { + c ^= ' ' // Make it a capital letter. + } + t = append(t, c) // Guaranteed not lower case. + // Accept lower case sequence that follows. + for i+1 < len(s) && isASCIILower(s[i+1]) { + i++ + t = append(t, s[i]) + } + } + return string(t) +} + +// CamelCaseSlice is like CamelCase, but the argument is a slice of strings to +// be joined with "_". +func CamelCaseSlice(elem []string) string { return CamelCase(strings.Join(elem, "_")) } + +// Is c an ASCII lower-case letter? +func isASCIILower(c byte) bool { + return 'a' <= c && c <= 'z' +} + +// Is c an ASCII digit? +func isASCIIDigit(c byte) bool { + return '0' <= c && c <= '9' +} + +func ToLowerFirst(s string) string { + if len(s) > 0 { + return string(unicode.ToLower(rune(s[0]))) + s[1:] + } + return "" +} diff --git a/pkg/reflection/fetch.go b/pkg/reflection/fetch.go new file mode 100644 index 0000000..211d188 --- /dev/null +++ b/pkg/reflection/fetch.go @@ -0,0 +1,84 @@ +// Package grpcreflection provides gRPC reflection client. +// Currently, gRPC reflection depends on Protocol Buffers, so we split this package from grpc package. +package reflection + +import ( + "context" + "errors" + "fmt" + "strings" + + "github.com/jhump/protoreflect/desc" + gr "github.com/jhump/protoreflect/grpcreflect" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection/grpc_reflection_v1alpha" + "google.golang.org/grpc/status" +) + +const reflectionServiceName = "grpc.reflection.v1alpha.ServerReflection" + +var ErrTLSHandshakeFailed = errors.New("TLS handshake failed") + +// Client defines gRPC reflection client. +type Client interface { + // ListPackages lists file descriptors from the gRPC reflection server. + // ListPackages returns these errors: + // - ErrTLSHandshakeFailed: TLS misconfig. + ListPackages() ([]*desc.FileDescriptor, error) + // Reset clears internal states of Client. + Reset() +} + +type client struct { + client *gr.Client +} + +// NewClient returns an instance of gRPC reflection client for gRPC protocol. +func NewClient(conn grpc.ClientConnInterface) Client { + return &client{ + client: gr.NewClient(context.Background(), grpc_reflection_v1alpha.NewServerReflectionClient(conn)), + } +} + +// NewWebClient returns an instance of gRPC reflection client for gRPC-Web protocol. +//func NewWebClient(conn *grpcweb.ClientConn) Client { +// return &client{ +// client: gr.NewClient(context.Background(), grpcweb_reflection_v1alpha.NewServerReflectionClient(conn)), +// } +//} + +func (c *client) ListPackages() ([]*desc.FileDescriptor, error) { + //c.client.FileContainingExtension() + ssvcs, err := c.client.ListServices() + if err != nil { + msg := status.Convert(err).Message() + // Check whether the error message contains TLS related error. + // If the server didn't enable TLS, the error message contains the first string. + // If Evans didn't enable TLS against to the TLS enabled server, the error message contains + // the second string. + if strings.Contains(msg, "tls: first record does not look like a TLS handshake") || + strings.Contains(msg, "latest connection error: ") { + return nil, ErrTLSHandshakeFailed + } + return nil, fmt.Errorf("failed to list services from reflecton enabled gRPC server: %w", err) + } + + var fds []*desc.FileDescriptor + for _, s := range ssvcs { + if s == reflectionServiceName { + continue + } + svc, err := c.client.ResolveService(s) + if err != nil { + return nil, err + } + + fd := svc.GetFile() //.AsFileDescriptorProto() + fds = append(fds, fd) + } + return fds, nil +} + +func (c *client) Reset() { + c.client.Reset() +} diff --git a/pkg/server/grpc.go b/pkg/server/grpc.go new file mode 100644 index 0000000..3e79452 --- /dev/null +++ b/pkg/server/grpc.go @@ -0,0 +1,99 @@ +package server + +import ( + "context" + "log" + "time" + + "github.com/golang/protobuf/proto" + "github.com/jhump/protoreflect/desc" + "github.com/jhump/protoreflect/dynamic/grpcdynamic" + "google.golang.org/grpc" + + "github.com/danielvladco/go-proto-gql/pkg/reflection" +) + +type Caller interface { + Call(ctx context.Context, svc *desc.ServiceDescriptor, rpc *desc.MethodDescriptor, message proto.Message) (proto.Message, error) +} + +type caller struct { + serviceStub map[*desc.ServiceDescriptor]grpcdynamic.Stub +} + +func NewReflectCaller(endpoints []string) (*caller, []*desc.FileDescriptor, []string, error) { + var descs []*desc.FileDescriptor + + descsconn := map[*desc.FileDescriptor]*grpc.ClientConn{} + for _, e := range endpoints { + conn, err := grpc.Dial(e, grpc.WithInsecure()) + if err != nil { + return nil, nil, nil, err + } + client := reflection.NewClient(conn) + + tempdesc, err := client.ListPackages() + if err != nil { + return nil, nil, nil, err + } + + for _, d := range tempdesc { + descsconn[d] = conn + descs = append(descs, d) + } + } + + origServices := map[*desc.ServiceDescriptor]grpcdynamic.Stub{} + for _, d := range descs { + for _, svc := range d.GetServices() { + origServices[svc] = grpcdynamic.NewStub(descsconn[d]) + } + } + + var filesToGenerate []string + //var protoFiles []*descriptor.FileDescriptorProto + for _, d := range descs { + //p := d.AsFileDescriptorProto() + //n := fmt.Sprintf("_%d_%s", i, p.GetName()) + //p.Name = &n + //gopkg := "github.com/danielvladco/go-proto-gql/reflect/grpcserver1/pb;pb" + //p.Options.GoPackage = &gopkg + filesToGenerate = append(filesToGenerate, d.AsFileDescriptorProto().GetName()) + //protoFiles = append(protoFiles, p) + for _, dp := range getDeps(d) { + // protoFiles = append(protoFiles, dp.AsFileDescriptorProto()) + descs = append(descs, dp) + } + } + + return &caller{ + serviceStub: origServices, + }, descs, filesToGenerate, nil +} + +func getDeps(file *desc.FileDescriptor) []*desc.FileDescriptor { + mp := map[*desc.FileDescriptor]struct{}{} + getAllDependencies(file, mp) + deps := make([]*desc.FileDescriptor, len(mp)) + i := 0 + for dp := range mp { + deps[i] = dp + i++ + } + return deps +} + +func getAllDependencies(file *desc.FileDescriptor, files map[*desc.FileDescriptor]struct{}) { + deps := file.GetDependencies() + for _, d := range deps { + files[d] = struct{}{} + getAllDependencies(d, files) + } +} + +func (c caller) Call(ctx context.Context, svc *desc.ServiceDescriptor, rpc *desc.MethodDescriptor, message proto.Message) (proto.Message, error) { + startTime := time.Now() + res, err := c.serviceStub[svc].InvokeRpc(ctx, rpc, message) + log.Printf("[INFO] grpc request took: %fms", float64(time.Since(startTime))/float64(time.Millisecond)) + return res, err +} diff --git a/pkg/server/queryer.go b/pkg/server/queryer.go new file mode 100644 index 0000000..d719d75 --- /dev/null +++ b/pkg/server/queryer.go @@ -0,0 +1,478 @@ +package server + +import ( + "context" + "encoding/base64" + "errors" + "fmt" + "log" + "reflect" + "time" + + graphql99 "github.com/99designs/gqlgen/graphql" + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/protoc-gen-go/descriptor" + "github.com/golang/protobuf/ptypes" + "github.com/jhump/protoreflect/desc" + "github.com/jhump/protoreflect/dynamic" + "github.com/nautilus/graphql" + "github.com/vektah/gqlparser/v2/ast" + "google.golang.org/protobuf/types/known/anypb" + + "github.com/danielvladco/go-proto-gql/pkg/generator" +) + +type any = map[string]interface{} + +func NewQueryer(pm generator.Registry, caller Caller) graphql.Queryer { + return &queryer{pm: pm, c: caller} +} + +type queryer struct { + pm generator.Registry + + c Caller +} +type QueryerLogger struct { + Next graphql.Queryer +} + +func (q QueryerLogger) Query(ctx context.Context, input *graphql.QueryInput, i interface{}) (err error) { + startTime := time.Now() + err = q.Next.Query(ctx, input, i) + log.Printf("[INFO] gql to grpc call took: %fms", float64(time.Since(startTime))/float64(time.Millisecond)) + return err +} + +func (q *queryer) Query(ctx context.Context, input *graphql.QueryInput, result interface{}) error { + var res = map[string]interface{}{} + var err error + var selection ast.SelectionSet + for _, op := range input.QueryDocument.Operations { + selection, err = graphql.ApplyFragments(op.SelectionSet, input.QueryDocument.Fragments) + if err != nil { + return err + } + switch op.Operation { + case ast.Query: + // TODO add parallel execution + err = q.resolveSelection(ctx, selection, res, input.Variables) + + case ast.Mutation: + err = q.resolveSelection(ctx, selection, res, input.Variables) + + case ast.Subscription: + panic("subscription not implemented") + } + } + + val := reflect.ValueOf(result) + if val.Kind() != reflect.Ptr { + return errors.New("result must be a pointer") + } + val = val.Elem() + if !val.CanAddr() { + return errors.New("result must be addressable (a pointer)") + } + val.Set(reflect.ValueOf(res)) + return err +} + +func (q *queryer) resolveSelection(ctx context.Context, selection ast.SelectionSet, res any, vars map[string]interface{}) (err error) { + for _, ss := range selection { + field, ok := ss.(*ast.Field) + if !ok { + continue + } + if field.Name == "__typename" { + res[nameOrAlias(field)] = field.ObjectDefinition.Name + continue + } + res[nameOrAlias(field)], err = q.resolveCall(ctx, field, vars) + if err != nil { + return err + } + } + return +} + +func (q *queryer) resolveCall(ctx context.Context, field *ast.Field, vars map[string]interface{}) (interface{}, error) { + method := q.pm.FindMethodByName(field.Name) + if method == nil { + return nil, errors.New("method not found") + } + + inputMsg, err := q.pbEncode(method.GetInputType(), field, vars) + if err != nil { + return nil, err + } + + msg, err := q.c.Call(ctx, method.GetService(), method, inputMsg) + if err != nil { + return nil, err + } + + return q.pbDecode(field, msg) +} + +func (q *queryer) pbEncode(in *desc.MessageDescriptor, field *ast.Field, vars map[string]interface{}) (proto.Message, error) { + inputMsg := dynamic.NewMessage(in) + inArg := field.Arguments.ForName("in") + if inArg == nil { + return inputMsg, nil + } + + var anyObj *desc.MessageDescriptor + if generator.IsAny(in) { + _, _ = graphql99.UnmarshalAny(nil) + if len(inArg.Value.Children) == 0 { + return nil, errors.New("no '__typename' provided") + } + typename := inArg.Value.Children.ForName("__typename") + if typename == nil { + return nil, errors.New("no '__typename' provided") + } + + vv, err := typename.Value(vars) + if err != nil { + return nil, errors.New("no '__typename' provided") + } + vvv, ok := vv.(string) + if !ok { + return nil, errors.New("no '__typename' provided") + } + + obj := q.pm.FindObjectByName(vvv) + if obj == nil { + return nil, errors.New("__typename should be a valid typename") + } + anyObj = obj + inputMsg = dynamic.NewMessage(anyObj) + } + oneofValidate := map[*desc.OneOfDescriptor]struct{}{} + for _, arg := range inArg.Value.Children { + val, err := arg.Value.Value(vars) + if err != nil { + return nil, err + } + if arg.Name == "__typename" { + continue + } + + var reqDesc *desc.FieldDescriptor + if anyObj != nil { + reqDesc = q.pm.FindFieldByName(anyObj, arg.Name) + //reqDesc = q.pm.fields[q.p.FieldBack(anyObj.AsDescriptorProto(), arg.Name)] + } else { + reqDesc = in.FindFieldByName(arg.Name) + //reqDesc = q.pm.fields[q.p.FieldBack(in.DescriptorProto, arg.Name)] + } + + oneof := reqDesc.GetOneOf() + if oneof != nil { + _, ok := oneofValidate[oneof] + if ok { + return nil, fmt.Errorf("field with name %q on Object %q can't be set", arg.Name, in.GetName()) + } + oneofValidate[oneof] = struct{}{} + } + + if val, err = q.pbValue(val, reqDesc); err != nil { + return nil, err + } + + inputMsg.SetField(reqDesc, val) + } + + if anyObj != nil { + //anyMsgDesc := q.pm.messages[in.DescriptorProto] + //anyMsg := dynamic.NewMessage(q.pm.messages[in.DescriptorProto]) + //typeUrl := anyMsgDesc.FindFieldByName("type_url") + //value := anyMsgDesc.FindFieldByName("value") + //anyMsg.SetField(typeUrl, anyObj.GetFullyQualifiedName()) + return ptypes.MarshalAny(inputMsg) + } + return inputMsg, nil +} + +func (q *queryer) pbValue(val interface{}, reqDesc *desc.FieldDescriptor) (_ interface{}, err error) { + msgDesc := reqDesc.GetMessageType() + + switch v := val.(type) { + case float64: + if reqDesc.GetType() == descriptor.FieldDescriptorProto_TYPE_FLOAT { + return float32(v), nil + } + case int64: + switch reqDesc.GetType() { + case descriptor.FieldDescriptorProto_TYPE_INT32, + descriptor.FieldDescriptorProto_TYPE_SINT32, + descriptor.FieldDescriptorProto_TYPE_SFIXED32: + return int32(v), nil + + case descriptor.FieldDescriptorProto_TYPE_UINT32, + descriptor.FieldDescriptorProto_TYPE_FIXED32: + return uint32(v), nil + + case descriptor.FieldDescriptorProto_TYPE_UINT64, + descriptor.FieldDescriptorProto_TYPE_FIXED64: + return uint64(v), nil + case descriptor.FieldDescriptorProto_TYPE_FLOAT: + return float32(v), nil + case descriptor.FieldDescriptorProto_TYPE_DOUBLE: + return float64(v), nil + } + case string: + switch reqDesc.GetType() { + case descriptor.FieldDescriptorProto_TYPE_ENUM: + // TODO predefine this + enumDesc := reqDesc.GetEnumType() + values := map[string]int32{} + for _, v := range enumDesc.GetValues() { + values[v.GetName()] = v.GetNumber() + } + return values[v], nil + case descriptor.FieldDescriptorProto_TYPE_BYTES: + bytes, err := base64.StdEncoding.DecodeString(v) + if err != nil { + return nil, fmt.Errorf("bytes should be a base64 encoded string") + } + return bytes, nil + } + case []interface{}: + v2 := make([]interface{}, len(v)) + for i, vv := range v { + v2[i], err = q.pbValue(vv, reqDesc) + if err != nil { + return nil, err + } + } + return v2, nil + case map[string]interface{}: + var anyTypeDescriptor *desc.MessageDescriptor + var vvv string + var ok bool + for kk, vv := range v { + if kk == "__typename" { + vvv, ok = vv.(string) + if !ok { + return nil, errors.New("'__typename' must be a string") + } + delete(v, "__typename") + break + } + } + var msg *dynamic.Message + protoDesc := msgDesc + if generator.IsAny(protoDesc) { + anyTypeDescriptor = q.pm.FindObjectByName(vvv) + if anyTypeDescriptor == nil { + return nil, errors.New("'__typename' must be a valid INPUT_OBJECT") + } + msg = dynamic.NewMessage(anyTypeDescriptor) + } else { + msg = dynamic.NewMessage(protoDesc) + } + oneofValidate := map[*desc.OneOfDescriptor]struct{}{} + for kk, vv := range v { + + if anyTypeDescriptor != nil { + msgDesc = anyTypeDescriptor + } + //plugType := q.pm.inputs[msgDesc] + //fieldDesc := q.pm.fields[q.p.FieldBack(plugType.DescriptorProto, kk)] + fieldDesc := msgDesc.FindFieldByName(kk) + oneof := fieldDesc.GetOneOf() + if oneof != nil { + _, ok := oneofValidate[oneof] + if ok { + return nil, fmt.Errorf("field with name %q on Object %q can't be set", kk, msgDesc.GetName()) + } + oneofValidate[oneof] = struct{}{} + } + + vv2, err := q.pbValue(vv, fieldDesc) + if err != nil { + return nil, err + } + msg.SetField(msgDesc.FindFieldByName(kk), vv2) + } + if anyTypeDescriptor != nil { + return ptypes.MarshalAny(msg) + } + return msg, nil + } + + return val, nil +} + +func (q *queryer) pbDecodeOneofField(desc *desc.MessageDescriptor, dynamicMsg *dynamic.Message, selection ast.SelectionSet) (oneof any, err error) { + oneof = any{} + for _, f := range selection { + out, ok := f.(*ast.Field) + if !ok { + continue + } + if out.Name == "__typename" { + oneof[nameOrAlias(out)] = out.ObjectDefinition.Name + continue + } + + fieldDesc := q.pm.FindFieldByName(desc, out.Name) + protoVal := dynamicMsg.GetField(fieldDesc) + oneof[nameOrAlias(out)], err = q.gqlValue(protoVal, fieldDesc.GetMessageType(), fieldDesc.GetEnumType(), out) + if err != nil { + return nil, err + } + } + return oneof, nil +} + +func (q *queryer) pbDecode(field *ast.Field, msg proto.Message) (res interface{}, err error) { + switch dynamicMsg := msg.(type) { + case *dynamic.Message: + return q.gqlValue(dynamicMsg, dynamicMsg.GetMessageDescriptor(), nil, field) + case *anypb.Any: + return q.gqlValue(dynamicMsg, nil, nil, field) + default: + return nil, fmt.Errorf("expected proto message of type *dynamic.Message or *anypb.Any but received: %T", msg) + } +} + +// FIXME take care of recursive calls +func (q *queryer) gqlValue(val interface{}, msgDesc *desc.MessageDescriptor, enumDesc *desc.EnumDescriptor, field *ast.Field) (_ interface{}, err error) { + switch v := val.(type) { + case int32: + // int32 enum + if enumDesc != nil { + values := map[int32]string{} + for _, v := range enumDesc.GetValues() { + values[v.GetNumber()] = v.GetName() + } + + return values[v], nil + } + + case map[interface{}]interface{}: + res := make([]interface{}, len(v)) + i := 0 + for kk, vv := range v { + vals := any{} + for _, f := range field.SelectionSet { + out, ok := f.(*ast.Field) + if !ok { + continue + } + switch out.Name { + case "value": + valueField := msgDesc.FindFieldByName("value") + if vals[nameOrAlias(out)], err = q.gqlValue(vv, valueField.GetMessageType(), valueField.GetEnumType(), out); err != nil { + return nil, err + } + case "key": + vals[nameOrAlias(out)] = kk + case "__typename": + vals[nameOrAlias(out)] = out.ObjectDefinition.Name + } + } + + res[i] = vals + i++ + } + return res, nil + + case []interface{}: + v2 := make([]interface{}, len(v)) + for i, vv := range v { + v2[i], err = q.gqlValue(vv, msgDesc, enumDesc, field) + if err != nil { + return nil, err + } + } + return v2, nil + + case *dynamic.Message: + if v == nil { + return nil, nil + } + fields := v.GetKnownFields() + vals := make(map[string]interface{}, len(fields)) + //gqlFields := map[string]string{} + for _, s := range field.SelectionSet { + out, ok := s.(*ast.Field) + if !ok { + continue + } + + if out.Name == "__typename" { + vals[nameOrAlias(out)] = out.ObjectDefinition.Name + continue + } + + descMsg := v.GetMessageDescriptor() + fieldDesc := q.pm.FindFieldByName(descMsg, out.Name) + if fieldDesc == nil { + vals[nameOrAlias(out)], err = q.pbDecodeOneofField(descMsg, v, out.SelectionSet) + if err != nil { + return nil, err + } + break + } + + vals[nameOrAlias(out)], err = q.gqlValue(v.GetField(fieldDesc), fieldDesc.GetMessageType(), fieldDesc.GetEnumType(), out) + if err != nil { + return nil, err + } + } + return vals, nil + case *anypb.Any: + fqn, err := ptypes.AnyMessageName(v) + if err != nil { + return nil, err + } + //tp := q.pm.pbtypeToDesc[fqn] + grpcType, gqlType := q.pm.FindObjectByFullyQualifiedName(fqn) + outputMsg := dynamic.NewMessage(grpcType) + err = outputMsg.Unmarshal(v.Value) + if err != nil { + return nil, err + } + val, err := q.gqlValue(outputMsg, outputMsg.GetMessageDescriptor(), nil, field) + if err != nil { + return nil, err + } + + vals := map[string]interface{}{} + for _, f := range field.SelectionSet { + out, ok := f.(*ast.Field) + if !ok { + continue + } + if out.Name == "__typename" { + vals[nameOrAlias(out)] = gqlType.Name + } + } + + vv, ok := val.(map[string]interface{}) + if !ok { + return nil, errors.New("any type can be only of message type") + } + for k, v := range vv { + vals[k] = v + } + return vals, nil + + case []byte: + return base64.StdEncoding.EncodeToString(v), nil + } + + return val, nil +} + +func nameOrAlias(field *ast.Field) string { + if field.Alias != "" { + return field.Alias + } + + return field.Name +} diff --git a/pkg/types/any.go b/pkg/types/any.go new file mode 100644 index 0000000..20c3ac9 --- /dev/null +++ b/pkg/types/any.go @@ -0,0 +1,37 @@ +package types + +import ( + "encoding/json" + "fmt" + "io" + + "github.com/99designs/gqlgen/graphql" + "github.com/golang/protobuf/ptypes" + "google.golang.org/protobuf/types/known/anypb" +) + +// TODO create mapping for proto to graphql types to unmarshal any +func MarshalAny(any *anypb.Any) graphql.Marshaler { + return graphql.WriterFunc(func(w io.Writer) { + d := &ptypes.DynamicAny{} + if err := ptypes.UnmarshalAny(any, d); err != nil { + panic("unable to unmarshal any: " + err.Error()) + return + } + + if err := json.NewEncoder(w).Encode(d.Message); err != nil { + panic("unable to encode json: " + err.Error()) + } + }) +} + +func UnmarshalAny(v interface{}) (*anypb.Any, error) { + switch v := v.(type) { + case []byte: + return &anypb.Any{}, nil //TODO add an unmarshal mechanism + case json.RawMessage: + return &anypb.Any{}, nil + default: + return &anypb.Any{}, fmt.Errorf("%T is not json.RawMessage", v) + } +} diff --git a/pkg/types/bytes.go b/pkg/types/bytes.go new file mode 100644 index 0000000..fde2d09 --- /dev/null +++ b/pkg/types/bytes.go @@ -0,0 +1,30 @@ +package types + +import ( + "encoding/json" + "fmt" + "io" + + "github.com/99designs/gqlgen/graphql" +) + +func MarshalBytes(b []byte) graphql.Marshaler { + return graphql.WriterFunc(func(w io.Writer) { + _, _ = fmt.Fprintf(w, "%q", string(b)) + }) +} + +func UnmarshalBytes(v interface{}) ([]byte, error) { + switch v := v.(type) { + case string: + return []byte(v), nil + case *string: + return []byte(*v), nil + case []byte: + return v, nil + case json.RawMessage: + return []byte(v), nil + default: + return nil, fmt.Errorf("%T is not []byte", v) + } +} diff --git a/pkg/types/float32.go b/pkg/types/float32.go new file mode 100644 index 0000000..6d5ffdc --- /dev/null +++ b/pkg/types/float32.go @@ -0,0 +1,30 @@ +package types + +import ( + "encoding/json" + "fmt" + "io" + "strconv" + + "github.com/99designs/gqlgen/graphql" +) + +func MarshalFloat32(any float32) graphql.Marshaler { + return graphql.WriterFunc(func(w io.Writer) { + _, _ = w.Write([]byte(strconv.Itoa(int(any)))) + }) +} + +func UnmarshalFloat32(v interface{}) (float32, error) { + switch v := v.(type) { + case int: + return float32(v), nil + case float32: + return v, nil + case json.Number: + f, err := v.Float64() + return float32(f), err + default: + return 0, fmt.Errorf("%T is not float32", v) + } +} diff --git a/pkg/types/uint32.go b/pkg/types/uint32.go new file mode 100644 index 0000000..6cb6d18 --- /dev/null +++ b/pkg/types/uint32.go @@ -0,0 +1,37 @@ +package types + +import ( + "encoding/json" + "fmt" + "io" + "strconv" + + "github.com/99designs/gqlgen/graphql" +) + +func MarshalUint32(i uint32) graphql.Marshaler { + return graphql.WriterFunc(func(w io.Writer) { + io.WriteString(w, strconv.FormatUint(uint64(i), 10)) + }) +} + +func UnmarshalUint32(v interface{}) (uint32, error) { + switch v := v.(type) { + case string: + ui64, err := strconv.ParseUint(v, 10, 32) + return uint32(ui64), err + case int: + return uint32(v), nil + case uint: + return uint32(v), nil + case int32: + return uint32(v), nil + case uint32: + return v, nil + case json.Number: + ui64, err := strconv.ParseUint(string(v), 10, 32) + return uint32(ui64), err + default: + return 0, fmt.Errorf("%T is not an int", v) + } +} diff --git a/pkg/types/uint64.go b/pkg/types/uint64.go new file mode 100644 index 0000000..c11c9c5 --- /dev/null +++ b/pkg/types/uint64.go @@ -0,0 +1,35 @@ +package types + +import ( + "encoding/json" + "fmt" + "io" + "strconv" + + "github.com/99designs/gqlgen/graphql" +) + +func MarshalUint64(i uint64) graphql.Marshaler { + return graphql.WriterFunc(func(w io.Writer) { + io.WriteString(w, strconv.FormatUint(i, 10)) + }) +} + +func UnmarshalUint64(v interface{}) (uint64, error) { + switch v := v.(type) { + case string: + return strconv.ParseUint(v, 10, 64) + case int: + return uint64(v), nil + case uint: + return uint64(v), nil + case int64: + return uint64(v), nil + case uint64: + return v, nil + case json.Number: + return strconv.ParseUint(string(v), 10, 64) + default: + return 0, fmt.Errorf("%T is not an int", v) + } +} diff --git a/plugin/callstack.go b/plugin/callstack.go deleted file mode 100644 index 5ef9783..0000000 --- a/plugin/callstack.go +++ /dev/null @@ -1,47 +0,0 @@ -package plugin - -type Callstack interface { - Push(entry string) - Pop(entry string) - Has(entry string) bool - Free() - List() []string -} - -func NewCallstack() Callstack { - return &callstack{stack: make(map[string]int), index: 0} -} - -type callstack struct { - stack map[string]int - sorted []string - index int -} - -func (c *callstack) Free() { - c.stack = make(map[string]int) - c.index = 0 -} - -func (c *callstack) Pop(entry string) { - delete(c.stack, entry) - c.index-- -} - -func (c *callstack) Push(entry string) { - c.stack[entry] = c.index - c.index++ -} - -func (c *callstack) List() []string { - res := make([]string, len(c.stack)) - for s, si := range c.stack { - res[si] = s - } - return res -} - -func (c *callstack) Has(entry string) bool { - _, ok := c.stack[entry] - return ok -} diff --git a/plugin/helpers.go b/plugin/helpers.go deleted file mode 100644 index 2ab8913..0000000 --- a/plugin/helpers.go +++ /dev/null @@ -1,81 +0,0 @@ -package plugin - -import ( - "github.com/gogo/protobuf/protoc-gen-gogo/generator" - "strings" - "unicode" - - "github.com/danielvladco/go-proto-gql/pb" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" -) - -func getEnum(file *descriptor.FileDescriptorProto, typeName string) *descriptor.EnumDescriptorProto { - for _, enum := range file.GetEnumType() { - if enum.GetName() == typeName { - return enum - } - } - - for _, msg := range file.GetMessageType() { - if nes := getNestedEnum(file, msg, strings.TrimPrefix(typeName, msg.GetName()+".")); nes != nil { - return nes - } - } - return nil -} - -func getNestedEnum(file *descriptor.FileDescriptorProto, msg *descriptor.DescriptorProto, typeName string) *descriptor.EnumDescriptorProto { - for _, enum := range msg.GetEnumType() { - if enum.GetName() == typeName { - return enum - } - } - - for _, nes := range msg.GetNestedType() { - if res := getNestedEnum(file, nes, strings.TrimPrefix(typeName, nes.GetName()+".")); res != nil { - return res - } - } - return nil -} - -func resolveRequired(field *descriptor.FieldDescriptorProto) bool { - if v := GetGqlFieldOptions(field); v != nil { - return v.GetRequired() - } - return false -} - -func ToLowerFirst(s string) string { - if len(s) > 0 { - return string(unicode.ToLower(rune(s[0]))) + s[1:] - } - return "" -} - -func GetGqlFieldOptions(field *descriptor.FieldDescriptorProto) *gql.Field { - if field.Options != nil { - v, err := proto.GetExtension(field.Options, gql.E_Field) - if err == nil && v.(*gql.Field) != nil { - return v.(*gql.Field) - } - } - return nil -} - -// Match parsing algorithm from Generator.CommandLineParameters -func Params(gen *generator.Generator) map[string]string { - params := make(map[string]string) - - for _, parameter := range strings.Split(gen.Request.GetParameter(), ",") { - kvp := strings.SplitN(parameter, "=", 2) - if len(kvp) != 2 { - continue - } - - params[kvp[0]] = kvp[1] - } - - return params -} diff --git a/plugin/models.go b/plugin/models.go deleted file mode 100644 index 45e935f..0000000 --- a/plugin/models.go +++ /dev/null @@ -1,72 +0,0 @@ -package plugin - -import ( - "sort" - - "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" -) - -type ModelDescriptor struct { - BuiltIn bool - PackageDir string - TypeName string - UsedAsInput bool - Index int - OneofTypes map[string]struct{} - - packageName string - originalPackage string -} - -type Method struct { - Name string - InputType string - OutputType string - Phony bool - ServiceIndex int - Index int - - *descriptor.MethodDescriptorProto - *descriptor.ServiceDescriptorProto -} - -type Methods []*Method - -func (ms Methods) NameExists(name string) bool { - for _, m := range ms { - if m.Name == name { - return true - } - } - return false -} - -type Type struct { - *descriptor.DescriptorProto - *descriptor.EnumDescriptorProto - ModelDescriptor -} - -type TypeMapList []*TypeMapEntry - -func (t TypeMapList) Len() int { return len(t) } -func (t TypeMapList) Less(i, j int) bool { return t[i].Key < t[j].Key } -func (t TypeMapList) Swap(i, j int) { t[i], t[j] = t[j], t[i] } - -func TypeMap2List(t map[string]*Type) (m TypeMapList) { - for key, val := range t { - m = append(m, &TypeMapEntry{Key: key, Value: val}) - } - sort.Sort(m) - return -} - -type TypeMapEntry struct { - Key string - Value *Type -} - -type OneofRef struct { - Parent *Type - Index int32 -} diff --git a/plugin/plugin.go b/plugin/plugin.go deleted file mode 100644 index cc6c46c..0000000 --- a/plugin/plugin.go +++ /dev/null @@ -1,631 +0,0 @@ -package plugin - -import ( - "bytes" - "errors" - "fmt" - "log" - "os" - "reflect" - "strconv" - "strings" - - "github.com/danielvladco/go-proto-gql/pb" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" - "github.com/gogo/protobuf/protoc-gen-gogo/generator" - "github.com/gogo/protobuf/types" - golangproto "github.com/golang/protobuf/proto" - "github.com/golang/protobuf/ptypes/any" -) - -const ( - ScalarBytes = "Bytes" - ScalarFloat32 = "Float32" - ScalarInt64 = "Int64" - ScalarInt32 = "Int32" - ScalarUint32 = "Uint32" - ScalarUint64 = "Uint64" - ScalarAny = "Any" - ScalarDirective = "__Directive" - ScalarType = "__Type" - ScalarField = "__Field" - ScalarEnumValue = "__EnumValue" - ScalarInputValue = "__InputValue" - ScalarSchema = "__Schema" - ScalarInt = "Int" - ScalarFloat = "Float" - ScalarString = "String" - ScalarBoolean = "Boolean" - ScalarID = "ID" -) - -func NewPlugin() *Plugin { - return &Plugin{ - fileIndex: -1, - types: make(map[string]*Type), - inputs: make(map[string]*Type), - enums: make(map[string]*Type), - maps: make(map[string]*Type), - oneofs: make(map[string]*Type), - oneofsRef: make(map[OneofRef]string), - scalars: map[string]*Type{ - "__Directive": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "__Type": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "__Field": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "__EnumValue": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "__InputValue": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "__Schema": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "Int": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "Float": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "String": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "Boolean": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - "ID": {ModelDescriptor: ModelDescriptor{BuiltIn: true}}, - }, - logger: log.New(os.Stderr, "protoc-gen-gogql: ", log.Lshortfile), - } -} - -type Plugin struct { - *generator.Generator - - // info for the current schema - mutations Methods - queries Methods - subscriptions Methods - inputs map[string]*Type // map containing string representation of proto message that is used as gql input - types map[string]*Type // map containing string representation of proto message that is used as gql type - enums map[string]*Type // map containing string representation of proto enum that is used as gql enum - scalars map[string]*Type - maps map[string]*Type - oneofs map[string]*Type - oneofsRef map[OneofRef]string // map containing reference to gql oneof names, we need this since oneofs cant fe found by name - - fileIndex int - schemas []*schema - gqlModelNames []map[*Type]string // map containing reference to gql type names - - logger *log.Logger -} - -func (p *Plugin) GetOneof(ref OneofRef) *Type { return p.oneofs[p.oneofsRef[ref]] } -func (p *Plugin) Oneofs() map[string]*Type { return p.oneofs } -func (p *Plugin) Maps() map[string]*Type { return p.maps } -func (p *Plugin) Scalars() map[string]*Type { return p.scalars } -func (p *Plugin) Enums() map[string]*Type { return p.enums } -func (p *Plugin) Types() map[string]*Type { return p.types } -func (p *Plugin) Inputs() map[string]*Type { return p.inputs } -func (p *Plugin) Subscriptions() Methods { return p.subscriptions } -func (p *Plugin) Queries() Methods { return p.queries } -func (p *Plugin) Mutations() Methods { return p.mutations } -func (p *Plugin) GetSchemaByIndex(index int) *bytes.Buffer { return p.schemas[index].buffer } - -func (p *Plugin) IsAny(typeName string) (ok bool) { - if len(typeName) > 0 && typeName[0] == '.' { - messageType := proto.MessageType(strings.TrimPrefix(typeName, ".")) - if messageType == nil { - messageType = golangproto.MessageType(strings.TrimPrefix(typeName, ".")) - if messageType == nil { - return false - } - - _, ok = reflect.New(messageType).Elem().Interface().(*any.Any) - return ok - } - - _, ok = reflect.New(messageType).Elem().Interface().(*types.Any) - return ok - } - - return false -} - -// same isEmpty but for mortals -func (p *Plugin) IsEmpty(t *Type) bool { return p.isEmpty(t, make(map[*Type]struct{})) } - -// make sure objects are fulled with all types -func (p *Plugin) isEmpty(t *Type, callstack map[*Type]struct{}) bool { - callstack[t] = struct{}{} // don't forget to free stack on calling return when needed - - if t.DescriptorProto != nil { - if len(t.DescriptorProto.GetField()) == 0 { - return true - } else { - for _, f := range t.GetField() { - if !f.IsMessage() { - delete(callstack, t) - return false - } - fieldType, ok := p.inputs[f.GetTypeName()] - if !ok { - if fieldType, ok = p.types[f.GetTypeName()]; !ok { - if fieldType, ok = p.enums[f.GetTypeName()]; !ok { - if fieldType, ok = p.scalars[f.GetTypeName()]; !ok { - if fieldType, ok = p.maps[f.GetTypeName()]; !ok { - continue - } - } - } - } - } - - // check if the call stack already contains a reference to this type and prevent it from calling itself again - if _, ok := callstack[fieldType]; ok { - return true - } - if !p.isEmpty(fieldType, callstack) { - delete(callstack, t) - return false - } - } - delete(callstack, t) - return true - } - } - delete(callstack, t) - return false -} - -func (p *Plugin) Error(err error, msgs ...string) { - s := strings.Join(msgs, " ") + ":" + err.Error() - _ = p.logger.Output(2, s) - os.Exit(1) -} - -func (p *Plugin) Warn(msgs ...interface{}) { - _ = p.logger.Output(2, fmt.Sprintln(append([]interface{}{"WARN: "}, msgs...)...)) -} - -func (p *Plugin) getImportPath(file *descriptor.FileDescriptorProto) string { - fileName := strings.Split(file.GetName(), "/") - gopackageOpt := strings.Split(file.GetOptions().GetGoPackage(), ";") - - if path, ok := p.ImportMap[file.GetName()]; ok { - return path - } - - if len(gopackageOpt) == 1 && strings.Contains(gopackageOpt[0], "/") { // check if it is a path or if it is just the package name - return gopackageOpt[0] - } - if len(gopackageOpt) == 2 { - return gopackageOpt[0] - } - if len(fileName) > 1 { - return strings.Join(fileName[:len(fileName)-1], "/") - } - - p.Warn(fmt.Errorf("go import path for %s could not be resolved correctly: use option go_package with full package name in this file", file.GetName())) - return file.GetName() -} - -func (p *Plugin) getEnumType(file *descriptor.FileDescriptorProto, typeName string) *Type { - packagePrefix := "." + file.GetPackage() + "." - if strings.HasPrefix(typeName, packagePrefix) { - typeWithoutPrefix := strings.TrimPrefix(typeName, packagePrefix) - if e := getEnum(file, typeWithoutPrefix); e != nil { - return &Type{EnumDescriptorProto: e, ModelDescriptor: ModelDescriptor{ - TypeName: generator.CamelCaseSlice(strings.Split(typeWithoutPrefix, ".")), - PackageDir: p.getImportPath(file), - originalPackage: file.GetPackage(), - packageName: strings.Replace(file.GetPackage(), ".", "_", -1) + "_", - }} - } - } - return nil -} - -// recursively goes trough all fields of the types from messages map and fills it with child types. -// i. e. if message Type1 { Type2: field1 = 1; } exists in the map this function will look up Type2 and add Type2 to the map as well -func (p *Plugin) FillTypeMap(typeName string, messages map[string]*Type, inputField bool) { - p.fillTypeMap(typeName, messages, inputField, NewCallstack()) -} - -// creates oneof type with full path name -func (p *Plugin) createOneofFromParent(name string, parent *Type, callstack Callstack, inputField bool, field *descriptor.FieldDescriptorProto, file *descriptor.FileDescriptorProto) { - objects := make(map[string]*Type) - if inputField { - objects = p.inputs - } else { - objects = p.types - } - - oneofName := "" - for _, typeName := range callstack.List() { - oneofName += "." - oneofName += objects[typeName].DescriptorProto.GetName() - } - - // the name of the generated type - fieldType := "." + strings.Trim(parent.originalPackage, ".") + oneofName + "_" + strings.Title(generator.CamelCase(field.GetName())) - - uniqueOneofName := "." + strings.Trim(parent.originalPackage, ".") + oneofName + "." + name - - // create types for each field - if !inputField { - objects[fieldType] = &Type{ - DescriptorProto: &descriptor.DescriptorProto{ - Field: []*descriptor.FieldDescriptorProto{{TypeName: field.TypeName, Name: field.Name, Type: field.Type, Options: field.Options}}, - }, - ModelDescriptor: ModelDescriptor{ - TypeName: generator.CamelCaseSlice(strings.Split(strings.Trim(oneofName+"."+strings.Title(field.GetName()), "."), ".")), - PackageDir: parent.PackageDir, - Index: 0, - packageName: parent.packageName, - originalPackage: parent.originalPackage, - UsedAsInput: inputField, - }, - } - } - - // create type for a Oneof construct - if _, ok := p.oneofs[uniqueOneofName]; !ok { - p.oneofs[uniqueOneofName] = &Type{ - ModelDescriptor: ModelDescriptor{ - OneofTypes: map[string]struct{}{fieldType: {}}, - originalPackage: parent.originalPackage, - packageName: parent.packageName, - UsedAsInput: inputField, - Index: 0, - PackageDir: parent.PackageDir, - TypeName: generator.CamelCaseSlice(strings.Split("Is"+strings.Trim(oneofName+"."+name, "."), ".")), - }, - } - } else { - p.oneofs[uniqueOneofName].OneofTypes[fieldType] = struct{}{} - } - p.oneofsRef[OneofRef{Parent: parent, Index: field.GetOneofIndex()}] = uniqueOneofName -} - -func (p *Plugin) getMessageType(file *descriptor.FileDescriptorProto, typeName string) *Type { - packagePrefix := "." + file.GetPackage() + "." - if strings.HasPrefix(typeName, packagePrefix) { - typeWithoutPrefix := strings.TrimPrefix(typeName, packagePrefix) - if m := file.GetMessage(typeWithoutPrefix); m != nil { - - // Any is considered to be scalar - if p.IsAny(typeName) { - p.scalars[typeName] = &Type{ModelDescriptor: ModelDescriptor{ - PackageDir: "github.com/danielvladco/go-proto-gql/pb", //TODO generate gqlgen.yml - TypeName: ScalarAny, - }} - return nil - } - - return &Type{DescriptorProto: m, ModelDescriptor: ModelDescriptor{ - TypeName: generator.CamelCaseSlice(strings.Split(typeWithoutPrefix, ".")), - PackageDir: p.getImportPath(file), - originalPackage: file.GetPackage(), - packageName: strings.Replace(file.GetPackage(), ".", "_", -1) + "_", - }} - } - } - return nil -} - -func (p *Plugin) fillTypeMap(typeName string, objects map[string]*Type, inputField bool, callstack Callstack) { - callstack.Push(typeName) // if add a return statement dont forget to clean stack - defer callstack.Pop(typeName) - - for _, file := range p.AllFiles().GetFile() { - if enum := p.getEnumType(file, typeName); enum != nil { - if enum.EnumDescriptorProto != nil { - p.enums[typeName] = enum - continue - } - } - - if message := p.getMessageType(file, typeName); message != nil { - if message.DescriptorProto.GetOptions().GetMapEntry() { // if the message is a map - message.UsedAsInput = inputField - p.maps[typeName] = message - } else { - objects[typeName] = message - } - - for _, field := range message.GetField() { - if field.OneofIndex != nil { - p.createOneofFromParent(message.OneofDecl[field.GetOneofIndex()].GetName(), message, callstack, inputField, field, file) - } - - // defines scalars for unsupported graphql types - switch *field.Type { - case descriptor.FieldDescriptorProto_TYPE_BYTES: - p.scalars[ScalarBytes] = &Type{ModelDescriptor: ModelDescriptor{PackageDir: "github.com/danielvladco/go-proto-gql/pb", TypeName: ScalarBytes}} - - case descriptor.FieldDescriptorProto_TYPE_FLOAT: - p.scalars[ScalarFloat32] = &Type{ModelDescriptor: ModelDescriptor{PackageDir: "github.com/danielvladco/go-proto-gql/pb", TypeName: ScalarFloat32}} - - case descriptor.FieldDescriptorProto_TYPE_INT64, - descriptor.FieldDescriptorProto_TYPE_SINT64, - descriptor.FieldDescriptorProto_TYPE_SFIXED64: - p.scalars[ScalarInt64] = &Type{ModelDescriptor: ModelDescriptor{PackageDir: "github.com/danielvladco/go-proto-gql/pb", TypeName: ScalarInt64}} - - case descriptor.FieldDescriptorProto_TYPE_INT32, - descriptor.FieldDescriptorProto_TYPE_SINT32, - descriptor.FieldDescriptorProto_TYPE_SFIXED32: - p.scalars[ScalarInt32] = &Type{ModelDescriptor: ModelDescriptor{PackageDir: "github.com/danielvladco/go-proto-gql/pb", TypeName: ScalarInt32}} - - case descriptor.FieldDescriptorProto_TYPE_UINT32, - descriptor.FieldDescriptorProto_TYPE_FIXED32: - p.scalars[ScalarUint32] = &Type{ModelDescriptor: ModelDescriptor{PackageDir: "github.com/danielvladco/go-proto-gql/pb", TypeName: ScalarUint32}} - - case descriptor.FieldDescriptorProto_TYPE_UINT64, - descriptor.FieldDescriptorProto_TYPE_FIXED64: - p.scalars[ScalarUint64] = &Type{ModelDescriptor: ModelDescriptor{PackageDir: "github.com/danielvladco/go-proto-gql/pb", TypeName: ScalarUint64}} - } - - if !field.IsMessage() && !field.IsEnum() { - continue - } - - // check if already called and do nothing - if callstack.Has(field.GetTypeName()) { - continue - } - - p.fillTypeMap(field.GetTypeName(), objects, inputField, callstack) - } - - return // we know that it is not possible for multiple messages to have the same name - } - } -} - -func (p *Plugin) defineGqlTypes(entries map[string]*Type, suffix ...string) { - gqlModels := make(map[string]*Type) - scalars := make(map[string]struct{}) - for _, scalar := range p.scalars { - scalars[scalar.TypeName] = struct{}{} - } - - for _, entry := range entries { - entryName := entry.ModelDescriptor.TypeName - - // concatenate package name in case if the message has a scalar name, Any is considered a scalar - if _, ok := scalars[entryName]; ok { - entryName = entry.packageName + entryName - } else { - - // add suffix to type if needed but only if it is not a scalar type - for _, sf := range suffix { - entryName += sf - } - } - - // concatenate package name in case if two types with the same name are found - if sameModel, ok := gqlModels[entryName]; ok { - // redesign old type to have package namespace as well - p.gqlModelNames[p.fileIndex][sameModel] = sameModel.packageName + entryName - gqlModels[sameModel.packageName+entryName] = sameModel - - entryName = entry.packageName + entryName - } - - // add entries to the type map - p.gqlModelNames[p.fileIndex][entry] = entryName - gqlModels[entryName] = entry - } -} - -func (p *Plugin) getMethodType(rpc *descriptor.MethodDescriptorProto) gql.Type { - if rpc.Options != nil { - v, err := proto.GetExtension(rpc.Options, gql.E_RpcType) - if err == nil { - tt := v.(*gql.Type) - if tt != nil { - return *tt - } - } - } - - return gql.Type_DEFAULT -} - -func (p *Plugin) getServiceType(svc *descriptor.ServiceDescriptorProto) gql.Type { - if svc.Options != nil { - v, err := proto.GetExtension(svc.Options, gql.E_SvcType) - if err == nil { - tt := v.(*gql.Type) - if tt != nil { - return *tt - } - } - } - - return gql.Type_DEFAULT -} - -func (p *Plugin) PrintComments(path ...int) bool { - nl := "" - comments := p.Comments(strings.Join(func() (pp []string) { - for p := range path { - pp = append(pp, strconv.Itoa(p)) - } - return - }(), ",")) - if comments == "" { - return false - } - for _, line := range strings.Split(comments, "\n") { - p.schemas[p.fileIndex].P(nl, "# ", strings.TrimPrefix(line, " ")) - nl = "\n" - } - return true -} - -func (p *Plugin) checkInitialized() { - if p.fileIndex == -1 { - panic("file is not initialized! please use the InitFile(file) method for the file you want to generate code") - } -} - -func (p *Plugin) GraphQLType(field *descriptor.FieldDescriptorProto, messagesIn map[string]*Type) string { - p.checkInitialized() - var gqltype string - switch field.GetType() { - case descriptor.FieldDescriptorProto_TYPE_DOUBLE: - gqltype = ScalarFloat - - case descriptor.FieldDescriptorProto_TYPE_BYTES: - gqltype = ScalarBytes - - case descriptor.FieldDescriptorProto_TYPE_FLOAT: - gqltype = ScalarFloat32 - - case descriptor.FieldDescriptorProto_TYPE_INT64, - descriptor.FieldDescriptorProto_TYPE_SINT64, - descriptor.FieldDescriptorProto_TYPE_SFIXED64: - gqltype = ScalarInt64 - - case descriptor.FieldDescriptorProto_TYPE_INT32, - descriptor.FieldDescriptorProto_TYPE_SINT32, - descriptor.FieldDescriptorProto_TYPE_SFIXED32: - gqltype = ScalarInt32 - - case descriptor.FieldDescriptorProto_TYPE_UINT32, - descriptor.FieldDescriptorProto_TYPE_FIXED32: - gqltype = ScalarUint32 - - case descriptor.FieldDescriptorProto_TYPE_UINT64, - descriptor.FieldDescriptorProto_TYPE_FIXED64: - gqltype = ScalarUint64 - - case descriptor.FieldDescriptorProto_TYPE_BOOL: - gqltype = ScalarBoolean - - case descriptor.FieldDescriptorProto_TYPE_STRING: - gqltype = ScalarString - - case descriptor.FieldDescriptorProto_TYPE_GROUP: - p.Error(errors.New("proto2 groups are not supported please use proto3 syntax")) - - case descriptor.FieldDescriptorProto_TYPE_ENUM: - gqltype = p.gqlModelNames[p.fileIndex][p.enums[field.GetTypeName()]] - - case descriptor.FieldDescriptorProto_TYPE_MESSAGE: - if msg, ok := messagesIn[field.GetTypeName()]; ok { - gqltype = p.gqlModelNames[p.fileIndex][msg] - } else if scalar, ok := p.scalars[field.GetTypeName()]; ok { - gqltype = p.gqlModelNames[p.fileIndex][scalar] - } else if mp, ok := p.maps[field.GetTypeName()]; ok { - return p.gqlModelNames[p.fileIndex][mp] - } else { - panic("unknown proto field type") - } - - default: - panic("unknown proto field type") - } - - suffix := "" - prefix := "" - if field.IsRepeated() { - prefix += "[" - suffix += "!]" - } - if resolveRequired(field) { - suffix += "!" - } - - return prefix + gqltype + suffix -} - -func (p *Plugin) In() { - p.checkInitialized() - p.schemas[p.fileIndex].In() -} - -func (p *Plugin) Out() { - p.checkInitialized() - p.schemas[p.fileIndex].Out() -} - -func (p *Plugin) P(str ...interface{}) { - p.checkInitialized() - p.schemas[p.fileIndex].P(str...) -} -func (p *Plugin) GqlModelNames() map[*Type]string { - p.checkInitialized() - return p.gqlModelNames[p.fileIndex] -} - -func (p *Plugin) defineMethods(file *generator.FileDescriptor) { - for svci, svc := range file.GetService() { - for rpci, rpc := range svc.GetMethod() { - m := &Method{ - Name: ToLowerFirst(svc.GetName()) + strings.Title(rpc.GetName()), - InputType: rpc.GetInputType(), - OutputType: rpc.GetOutputType(), - ServiceIndex: svci, - Index: rpci, - MethodDescriptorProto: rpc, - ServiceDescriptorProto: svc, - } - - if rpc.GetClientStreaming() && rpc.GetServerStreaming() { - p.mutations = append(p.mutations, &Method{ - Name: ToLowerFirst(svc.GetName()) + strings.Title(rpc.GetName()), - InputType: rpc.GetInputType(), - OutputType: "", - Phony: true, - ServiceIndex: svci, - Index: rpci, - MethodDescriptorProto: rpc, - ServiceDescriptorProto: svc, - }) - } - - if rpc.GetServerStreaming() { - p.subscriptions = append(p.subscriptions, m) - } else { - switch p.getMethodType(rpc) { - case gql.Type_DEFAULT: - switch ttt := p.getServiceType(svc); ttt { - case gql.Type_DEFAULT, gql.Type_MUTATION: - p.mutations = append(p.mutations, m) - case gql.Type_QUERY: - p.queries = append(p.queries, m) - } - case gql.Type_MUTATION: - p.mutations = append(p.mutations, m) - case gql.Type_QUERY: - p.queries = append(p.queries, m) - } - } - - p.inputs[rpc.GetInputType()] = &Type{} - p.types[rpc.GetOutputType()] = &Type{} - } - } -} - -func (p *Plugin) InitFile(file *generator.FileDescriptor) { - p.fileIndex++ - p.schemas = append(p.schemas, &schema{buffer: &bytes.Buffer{}}) - p.gqlModelNames = append(p.gqlModelNames, make(map[*Type]string)) - // purge data for the current schema - p.types, p.inputs, p.enums, p.maps, p.scalars, p.oneofs, p.oneofsRef, - p.subscriptions, p.mutations, p.queries = - make(map[string]*Type), make(map[string]*Type), make(map[string]*Type), - make(map[string]*Type), make(map[string]*Type), make(map[string]*Type), - make(map[OneofRef]string), nil, nil, nil - - p.defineMethods(file) - // get all input messages - for inputName := range p.inputs { - p.FillTypeMap(inputName, p.inputs, true) - } - - // get all type messages - for inputName := range p.types { - p.FillTypeMap(inputName, p.types, false) - } - - //p.mapToScalar() - p.defineGqlTypes(p.inputs, "Input") - p.defineGqlTypes(p.types) - p.defineGqlTypes(p.enums) - p.defineGqlTypes(p.maps) - p.defineGqlTypes(p.scalars) - p.defineGqlTypes(p.oneofs) -} diff --git a/plugin/schema.go b/plugin/schema.go deleted file mode 100644 index 8ca746f..0000000 --- a/plugin/schema.go +++ /dev/null @@ -1,53 +0,0 @@ -package plugin - -import ( - "bytes" - "fmt" - - "github.com/gogo/protobuf/protoc-gen-gogo/generator" -) - -type schema struct { - indent string - buffer *bytes.Buffer - *generator.Generator -} - -// In Indents the output one tab stop. -func (s *schema) In() { s.indent += "\t" } - -// Out unindents the output one tab stop. -func (s *schema) Out() { - if len(s.indent) > 0 { - s.indent = s.indent[1:] - } -} -func (s *schema) P(str ...interface{}) { - g := s.buffer - _, _ = fmt.Fprint(g, s.indent) - for _, v := range str { - switch s := v.(type) { - case string: - _, _ = fmt.Fprint(g, s) - case *string: - _, _ = fmt.Fprint(g, *s) - case bool: - _, _ = fmt.Fprintf(g, "%t", s) - case *bool: - _, _ = fmt.Fprintf(g, "%t", *s) - case int: - _, _ = fmt.Fprintf(g, "%d", s) - case *int32: - _, _ = fmt.Fprintf(g, "%d", *s) - case *int64: - _, _ = fmt.Fprintf(g, "%d", *s) - case float64: - _, _ = fmt.Fprintf(g, "%g", s) - case *float64: - _, _ = fmt.Fprintf(g, "%g", *s) - default: - panic(fmt.Sprintf("unknown type in printer: %T", v)) - } - } - g.WriteByte('\n') -} diff --git a/protoc-gen-gogql/main.go b/protoc-gen-gogql/main.go new file mode 100644 index 0000000..1b08e6d --- /dev/null +++ b/protoc-gen-gogql/main.go @@ -0,0 +1,258 @@ +package main + +import ( + "fmt" + "strings" + + "google.golang.org/protobuf/compiler/protogen" + "google.golang.org/protobuf/reflect/protoreflect" + + "github.com/danielvladco/go-proto-gql/pkg/generator" +) + +func main() { + + protogen.Options{}.Run(Generate) +} + +var ( + ioPkg = protogen.GoImportPath("io") + fmtPkg = protogen.GoImportPath("fmt") + graphqlPkg = protogen.GoImportPath("github.com/99designs/gqlgen/graphql") + contextPkg = protogen.GoImportPath("context") +) + +func Generate(p *protogen.Plugin) error { + + for _, file := range p.Files { + if !file.Generate { + continue + } + g := p.NewGeneratedFile(file.GeneratedFilenamePrefix+".gqlgen.pb.go", file.GoImportPath) + g.P("package ", file.GoPackageName) + //InitFile(file) + for _, svc := range file.Services { + g.P(`type `, svc.GoName, `Resolvers struct { Service `, svc.GoName, `Server }`) + for _, rpc := range svc.Methods { + // TODO handle streaming + if rpc.Desc.IsStreamingClient() || rpc.Desc.IsStreamingServer() { + continue + } + + //TODO better logic + methodName := strings.Replace(generator.CamelCase(string(svc.Desc.Name())+string(rpc.Desc.Name())), "_", "", -1) + methodNameSplit := generator.SplitCamelCase(methodName) + var methodNameSplitNew []string + for _, m := range methodNameSplit { + if m == "id" || m == "Id" { + m = "ID" + } + methodNameSplitNew = append(methodNameSplitNew, m) + } + methodName = strings.Join(methodNameSplitNew, "") + + typeIn := g.QualifiedGoIdent(rpc.Input.GoIdent) + typeOut := g.QualifiedGoIdent(rpc.Output.GoIdent) + in, inref := ", in *"+typeIn, ", in" + if IsEmpty(rpc.Input) { + in, inref = "", ", &"+typeIn+"{}" + } + if IsEmpty(rpc.Output) { + g.P("func (s *", svc.GoName, "Resolvers) ", methodName, "(ctx ", contextPkg.Ident("Context"), in, ") (*bool, error) { _, err := s.Service.", rpc.GoName, "(ctx", inref, ")\n return nil, err }") + } else { + g.P("func (s *", svc.GoName, "Resolvers) ", methodName, "(ctx ", contextPkg.Ident("Context"), in, ") (*", typeOut, ", error) { return s.Service.", rpc.GoName, "(ctx", inref, ") }") + } + } + } + + generateMapsAndOneofs(g, file.Messages) + generateEnums(g, file.Enums) + } + return nil +} + +// TODO logic for generation in case the package is different than that of generated protobufs +// This is basically working code + +func generateEnums(g *protogen.GeneratedFile, enums []*protogen.Enum) { + for _, enum := range enums { + enumType := enum.GoIdent.GoName + g.P(` +func Marshal`, enumType, `(x `, enumType, `) `, graphqlPkg.Ident("Marshaler"), ` { + return `, graphqlPkg.Ident("WriterFunc"), `(func(w `, ioPkg.Ident("Writer"), `) { + _, _ = `, fmtPkg.Ident("Fprintf"), `(w, "%q", x.String()) + }) +} + +func Unmarshal`, enumType, ` (v interface{}) (`, enumType, `, error) { + code, ok := v.(string) + if ok { + return `, enumType, `(`, enumType, `_value[code]), nil + } + return 0, `, fmtPkg.Ident("Errorf"), `("cannot unmarshal `, enumType, ` enum") +} +`) + } +} + +func generateMapsAndOneofs(g *protogen.GeneratedFile, messages []*protogen.Message) { + //var resolvers []*protogen.Message + for _, msg := range messages { + if msg.Desc.IsMapEntry() { + var ( + //mapName = msg.Fields + //mapType = fieldGoType(g, protoreflect.MessageKind, msg, nil) + keyType, _ = fieldGoType(g, msg.Fields[0], true) + valType, _ = fieldGoType(g, msg.Fields[1], true) + ) + + g.P(` +type `, msg.GoIdent.GoName, `Input = `, msg.GoIdent.GoName, ` +type `, msg.GoIdent.GoName, ` struct { + Key `, keyType, ` + Value `, valType, ` +} +`) + } else { + g.P("type ", msg.GoIdent.GoName, "Input = ", msg.GoIdent) + } + var mapResolver bool + for _, f := range msg.Fields { + if f.Message == nil || !f.Message.Desc.IsMapEntry() { + continue + } + if !mapResolver { + g.P("type ", msg.GoIdent.GoName, "Resolvers struct{}") + g.P("type ", msg.GoIdent.GoName, "InputResolvers struct{}") + } + mapResolver = true + g.P(` + +func (r `, msg.GoIdent.GoName, `Resolvers) `, f.GoName, `(_ `, contextPkg.Ident("Context"), `, obj *`, msg.GoIdent, `) (list []*`, f.Message.GoIdent, `, _ error) { + for k,v := range obj.`, f.GoName, ` { + list = append(list, &`, f.Message.GoIdent, `{ + Key: k, + Value: v, + }) + } + return +} + +func (m `, msg.GoIdent.GoName, `InputResolvers) `, f.GoName, `(_ `, contextPkg.Ident("Context"), `, obj *`, msg.GoIdent, `, data []*`, f.Message.GoIdent, `) error { + for _, v := range data { + obj.`, f.GoName, `[v.Key] = v.Value + } + return nil +} +`) + } + + var oneofResolver bool + for _, oneof := range msg.Oneofs { + if !oneofResolver { + g.P("type ", msg.GoIdent.GoName, "Resolvers struct{}") + g.P("type ", msg.GoIdent.GoName, "InputResolvers struct{}") + } + oneofResolver = true + for _, f := range oneof.Fields { + goFieldType, isPointer := fieldGoType(g, f, false) + drawRef := "" + if !isPointer { + drawRef = "*" + } + g.P(` +func (o `, msg.GoIdent.GoName, `InputResolvers) `, f.GoName, `(_ `, contextPkg.Ident("Context"), `, obj *`, msg.GoIdent, `, data *`, goFieldType, `) error { + obj.`, oneof.GoName, ` = &`, f.GoIdent.GoName, `{`, f.GoName, `: `, drawRef, `data} + return nil +} +`) + } + g.P(` +func (o `, msg.GoIdent.GoName, `Resolvers) `, oneof.GoName, `(_ `, contextPkg.Ident("Context"), `, obj *`, msg.GoIdent, `) (`, oneof.GoIdent, `, error) { + return obj.`, oneof.GoName, `, nil +}`) + g.P(`type `, oneof.GoIdent, " interface{}") + } + generateEnums(g, msg.Enums) + generateMapsAndOneofs(g, msg.Messages) + } +} + +func noUnderscore(s string) string { + return strings.ReplaceAll(s, "_", "") +} + +// same isEmpty but for mortals +func IsEmpty(o *protogen.Message) bool { return isEmpty(o, generator.NewCallstack()) } + +// make sure objects are fulled with all objects +func isEmpty(o *protogen.Message, callstack generator.Callstack) bool { + callstack.Push(o) + defer callstack.Pop(o) + + if len(o.Fields) == 0 { + return true + } + for _, f := range o.Fields { + objType := f.Message + if objType == nil { + return false + } + + // check if the call stack already contains a reference to this type and prevent it from calling itself again + if callstack.Has(objType) { + return true + } + if !isEmpty(objType, callstack) { + return false + } + } + + return true +} + +func fieldGoType(g *protogen.GeneratedFile, field *protogen.Field, includePointer bool) (goType string, pointer bool) { + if field.Desc.IsWeak() { + return "struct{}", false + } + + //pointer = field.Desc.HasPresence() + switch field.Desc.Kind() { + case protoreflect.BoolKind: + goType = "bool" + case protoreflect.EnumKind: + goType = g.QualifiedGoIdent(field.Enum.GoIdent) + case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: + goType = "int32" + case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: + goType = "uint32" + case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: + goType = "int64" + case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: + goType = "uint64" + case protoreflect.FloatKind: + goType = "float32" + case protoreflect.DoubleKind: + goType = "float64" + case protoreflect.StringKind: + goType = "string" + case protoreflect.BytesKind: + goType = "[]byte" + pointer = false // rely on nullability of slices for presence + case protoreflect.MessageKind, protoreflect.GroupKind: + if includePointer { + goType = "*" + } + goType += g.QualifiedGoIdent(field.Message.GoIdent) + pointer = true + } + switch { + case field.Desc.IsList(): + return "[]" + goType, false + case field.Desc.IsMap(): + keyType, _ := fieldGoType(g, field.Message.Fields[0], includePointer) + valType, _ := fieldGoType(g, field.Message.Fields[1], includePointer) + return fmt.Sprintf("map[%v]%v", keyType, valType), false + } + return goType, pointer +} diff --git a/protoc-gen-gogqlgen/main.go b/protoc-gen-gogqlgen/main.go deleted file mode 100644 index cccd832..0000000 --- a/protoc-gen-gogqlgen/main.go +++ /dev/null @@ -1,197 +0,0 @@ -package main - -import ( - "fmt" - "io/ioutil" - "os" - "strconv" - "strings" - - gqlplugin "github.com/danielvladco/go-proto-gql/plugin" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/protoc-gen-gogo/generator" - "github.com/gogo/protobuf/vanity" -) - -func main() { - gen := generator.New() - - data, err := ioutil.ReadAll(os.Stdin) - if err != nil { - gen.Error(err, "reading input") - } - - if err := proto.Unmarshal(data, gen.Request); err != nil { - gen.Error(err, "parsing input proto") - } - - if len(gen.Request.FileToGenerate) == 0 { - gen.Fail("no files to generate") - } - - useGogoImport := false - if gogoimport, ok := gqlplugin.Params(gen)["gogoimport"]; ok { - useGogoImport, err = strconv.ParseBool(gogoimport) - if err != nil { - gen.Error(err, "parsing gogoimport option") - } - } - - gen.CommandLineParameters(gen.Request.GetParameter()) - gen.WrapTypes() - gen.SetPackageNames() - gen.BuildTypeNameMap() - gen.GeneratePlugin(&plugin{ - useGogoImport: useGogoImport, - enums: make(map[string]struct{}), - messages: make(map[string]struct{}), - Plugin: gqlplugin.NewPlugin(), - }) - - for i := 0; i < len(gen.Response.File); i++ { - gen.Response.File[i].Name = proto.String(strings.Replace(*gen.Response.File[i].Name, ".pb.go", ".gqlgen.pb.go", -1)) - } - - // Send back the results. - data, err = proto.Marshal(gen.Response) - if err != nil { - gen.Error(err, "failed to marshal output proto") - } - _, err = os.Stdout.Write(data) - if err != nil { - gen.Error(err, "failed to write output proto") - } -} - -type plugin struct { - *gqlplugin.Plugin - generator.PluginImports - ioPkg generator.Single - fmtPkg generator.Single - graphqlPkg generator.Single - jsonPkg generator.Single - contextPkg generator.Single - - enums map[string]struct{} - messages map[string]struct{} - - useGogoImport bool -} - -func (p *plugin) Name() string { return "gogqlgen" } -func (p *plugin) Init(g *generator.Generator) { p.Generator = g } -func (p *plugin) Generate(file *generator.FileDescriptor) { - if !p.useGogoImport { - vanity.TurnOffGogoImport(file.FileDescriptorProto) - } - - p.PluginImports = generator.NewPluginImports(p.Generator) - p.fmtPkg = p.NewImport("fmt") - p.ioPkg = p.NewImport("io") - p.graphqlPkg = p.NewImport("github.com/danielvladco/go-proto-gql/pb") - p.jsonPkg = p.NewImport("encoding/json") - p.contextPkg = p.NewImport("context") - - p.Scalars() - for _, r := range p.Request.FileToGenerate { - if r == file.GetName() { - p.InitFile(file) - for _, svc := range file.GetService() { - p.Generator.P(`type `, svc.GetName(), `GQLServer struct { Service `, svc.GetName(), `Server }`) - for _, rpc := range svc.GetMethod() { - if rpc.GetClientStreaming() || rpc.GetServerStreaming() { - continue - } - methodName := strings.Replace(generator.CamelCase(svc.GetName()+rpc.GetName()), "_", "", -1) - methodNameSplit := gqlplugin.SplitCamelCase(methodName) - var methodNameSplitNew []string - for _, m := range methodNameSplit { - if m == "id" || m == "Id" { - m = "ID" - } - methodNameSplitNew = append(methodNameSplitNew, m) - } - methodName = strings.Join(methodNameSplitNew, "") - - typeInObj := p.TypeNameByObject(rpc.GetInputType()) - p.NewImport(string(typeInObj.GoImportPath())) - typeOutObj := p.TypeNameByObject(rpc.GetOutputType()) - typeIn := generator.CamelCaseSlice(typeInObj.TypeName()) - typeOut := generator.CamelCaseSlice(typeOutObj.TypeName()) - if p.DefaultPackageName(typeInObj) != "" { - typeIn = p.NewImport(string(typeInObj.GoImportPath())).Use() + "." + typeIn - } - if p.DefaultPackageName(typeOutObj) != "" { - typeOut = p.NewImport(string(typeOutObj.GoImportPath())).Use() + "." + typeOut - } - in, inref := ", in *"+typeIn, ", in" - if p.IsEmpty(p.Inputs()[rpc.GetInputType()]) { - in, inref = "", ", &"+typeIn+"{}" - } - if p.IsEmpty(p.Types()[rpc.GetOutputType()]) { - p.Generator.P("func (s *", svc.GetName(), "GQLServer) ", methodName, "(ctx ", p.contextPkg.Use(), ".Context", in, ") (*bool, error) { _, err := s.Service.", generator.CamelCase(rpc.GetName()), "(ctx", inref, ")\n return nil, err }") - } else { - p.Generator.P("func (s *", svc.GetName(), "GQLServer) ", methodName, "(ctx ", p.contextPkg.Use(), ".Context", in, ") (*", typeOut, ", error) { return s.Service.", generator.CamelCase(rpc.GetName()), "(ctx", inref, ") }") - } - } - } - for _, msg := range file.Messages() { - if msg.GetOptions().GetMapEntry() { - key, value := msg.GetMapFields() - - mapName := generator.CamelCaseSlice(msg.TypeName()) - keyType, _ := p.GoType(msg, key) - valType, _ := p.GoType(msg, value) - - mapType := fmt.Sprintf("map[%s]%s", keyType, valType) - p.Generator.P(` -func Marshal`, mapName, `(mp `, mapType, `) `, p.graphqlPkg.Use(), `.Marshaler { - return `, p.graphqlPkg.Use(), `.WriterFunc(func(w `, p.ioPkg.Use(), `.Writer) { - err := `, p.jsonPkg.Use(), `.NewEncoder(w).Encode(mp) - if err != nil { - panic("this map type is not supported") - } - }) -} - -func Unmarshal`, mapName, `(v interface{}) (mp `, mapType, `, err error) { - switch vv := v.(type) { - case []byte: - err = `, p.jsonPkg.Use(), `.Unmarshal(vv, &mp) - return mp, err - case `, p.jsonPkg.Use(), `.RawMessage: - err = `, p.jsonPkg.Use(), `.Unmarshal(vv, &mp) - return mp, err - default: - return nil, `, p.fmtPkg.Use(), `.Errorf("%T is not `, mapType, `", v) - } -} -`) - } - for _, oneof := range msg.OneofDecl { - oneofName := append(msg.TypeName(), oneof.GetName()) - p.Generator.P(`type Is`, generator.CamelCaseSlice(oneofName), - " interface{\n\tis", generator.CamelCaseSlice(oneofName), "()\n}") - } - } - for _, enum := range file.Enums() { - enumType := generator.CamelCaseSlice(enum.TypeName()) - p.Generator.P(` -func (c *`, enumType, `) UnmarshalGQL(v interface{}) error { - code, ok := v.(string) - if ok { - *c = `, enumType, `(`, enumType, `_value[code]) - return nil - } - return fmt.Errorf("cannot unmarshal `, enumType, ` enum") -} - -func (c `, enumType, `) MarshalGQL(w `, p.ioPkg.Use(), `.Writer) { - `, p.fmtPkg.Use(), `.Fprintf(w, "%q", c.String()) -} -`) - } - - } - } -} diff --git a/protoc-gen-gql/main.go b/protoc-gen-gql/main.go index 3ce1f57..2e5dd0e 100644 --- a/protoc-gen-gql/main.go +++ b/protoc-gen-gql/main.go @@ -1,273 +1,114 @@ package main import ( - "fmt" + "bytes" "io/ioutil" + "log" "os" - "sort" + "path" + "path/filepath" "strconv" "strings" - . "github.com/danielvladco/go-proto-gql/plugin" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/protoc-gen-gogo/generator" + "github.com/jhump/protoreflect/desc" + "github.com/vektah/gqlparser/v2/formatter" + "google.golang.org/protobuf/proto" + descriptor "google.golang.org/protobuf/types/descriptorpb" + "google.golang.org/protobuf/types/pluginpb" + + "github.com/danielvladco/go-proto-gql/pkg/generator" ) func main() { - gen := generator.New() - - data, err := ioutil.ReadAll(os.Stdin) + in, err := ioutil.ReadAll(os.Stdin) if err != nil { - gen.Error(err, "reading input") - } - - if err := proto.Unmarshal(data, gen.Request); err != nil { - gen.Error(err, "parsing input proto") - } - - serviceDirectives := false - if gogoimport, ok := Params(gen)["svcdir"]; ok { - serviceDirectives, err = strconv.ParseBool(gogoimport) - if err != nil { - gen.Error(err, "parsing svcdir option") - } + log.Fatal(err) } - - p := &plugin{NewPlugin(), serviceDirectives} - - gen.CommandLineParameters(gen.Request.GetParameter()) - gen.WrapTypes() - gen.SetPackageNames() - gen.BuildTypeNameMap() - gen.GeneratePlugin(p) - - fileLen := len(gen.Response.GetFile()) - for i := 0; i < fileLen; i++ { - gen.Response.File[i].Name = proto.String(strings.Replace(gen.Response.File[i].GetName(), ".pb.go", ".pb.graphqls", -1)) - gen.Response.File[i].Content = proto.String(p.GetSchemaByIndex(i).String()) + req := &pluginpb.CodeGeneratorRequest{} + if err := proto.Unmarshal(in, req); err != nil { + log.Fatal(err) } - data, err = proto.Marshal(gen.Response) + files, err := generate(req) + res := &pluginpb.CodeGeneratorResponse{File: files} if err != nil { - gen.Error(err, "failed to marshal output proto") + res.Error = proto.String(err.Error()) } - _, err = os.Stdout.Write(data) + + out, err := proto.Marshal(res) if err != nil { - gen.Error(err, "failed to write output proto") + log.Fatal(err) } -} - -type plugin struct { - *Plugin - serviceDirectives bool -} - -func (p *plugin) GenerateImports(file *generator.FileDescriptor) {} -func (p *plugin) Name() string { return "gql" } -func (p *plugin) Init(g *generator.Generator) { p.Generator = g } - -func (p *plugin) Generate(file *generator.FileDescriptor) { - for _, fileName := range p.Request.FileToGenerate { - if fileName == file.GetName() { - p.InitFile(file) - p.generate(file) - } + if _, err := os.Stdout.Write(out); err != nil { + log.Fatal(err) } } -func (p *plugin) generate(file *generator.FileDescriptor) { - p.P("# Code generated by protoc-gen-gogql. DO NOT EDIT") - p.P("# source: ", file.GetName(), "\n") - p.PrintComments(2) - // TODO: add comments from proto to gql for documentation purposes to all elements. Currently are supported only a few - - if len(p.Oneofs()) > 0 { - p.P("directive @oneof(name: String) on INPUT_FIELD_DEFINITION\n") - } - - // Define a directive for each service, useful for service specific middleware - if p.serviceDirectives { - for _, svc := range file.Service { - p.P("directive @", svc.GetName(), "(name: String) on FIELD_DEFINITION\n") - } - } - - // scalars - for _, entry := range TypeMap2List(p.Scalars()) { - scalar := entry.Value - if !scalar.BuiltIn { - p.P("scalar ", p.GqlModelNames()[scalar], "\n") - } - } - - // maps - for _, entry := range TypeMap2List(p.Maps()) { - m := entry.Value - key, val := m.GetMapFields() - - messagesIn := make(map[string]*Type) - if m.UsedAsInput { - messagesIn = p.Inputs() - } else { - messagesIn = p.Types() - } - p.P("# map with key: '", p.GraphQLType(key, nil), "' and value: '", p.GraphQLType(val, messagesIn), "'") - p.P("scalar ", p.GqlModelNames()[m], "\n") - } - - // render gql inputs - for _, entry := range TypeMap2List(p.Inputs()) { - protoTypeName, m := entry.Key, entry.Value - if p.IsEmpty(m) || p.IsAny(protoTypeName) { - continue +func generate(req *pluginpb.CodeGeneratorRequest) (outFiles []*pluginpb.CodeGeneratorResponse_File, err error) { + var genServiceDesc bool + var merge bool + for _, param := range strings.Split(req.GetParameter(), ",") { + var value string + if i := strings.Index(param, "="); i >= 0 { + value, param = param[i+1:], param[0:i] } - p.P("input ", p.GqlModelNames()[m], " {") - p.In() - for _, f := range m.GetField() { - opts := GetGqlFieldOptions(f) - if opts != nil { - if opts.Dirs != nil { - *opts.Dirs = strings.Trim(*opts.Dirs, " ") - } - } - - if typ, ok := p.Inputs()[f.GetTypeName()]; ok { - if p.IsEmpty(typ) { - continue - } + switch param { + case "svc": + if genServiceDesc, err = strconv.ParseBool(value); err != nil { + return nil, err } - oneof := "" - if f.OneofIndex != nil { - oneof = fmt.Sprintf("@oneof(name: %q)", p.GqlModelNames()[p.GetOneof(OneofRef{Parent: m, Index: f.GetOneofIndex()})]) + case "merge": + if merge, err = strconv.ParseBool(value); err != nil { + return nil, err } - p.P(ToLowerFirst(generator.CamelCase(f.GetName())), ": ", p.GraphQLType(f, p.Inputs()), " ", oneof, " ", opts.GetDirs()) } - p.Out() - p.P("}\n") } - - // render gql types - for _, entry := range TypeMap2List(p.Types()) { - protoTypeName, m := entry.Key, entry.Value - if p.IsEmpty(m) || p.IsAny(protoTypeName) { - continue - } - p.P("type ", p.GqlModelNames()[m], " {") - p.In() - oneofs := make(map[OneofRef]struct{}) - for _, f := range m.GetField() { - if f.OneofIndex != nil { - oneofRef := OneofRef{Parent: m, Index: *f.OneofIndex} - if _, ok := oneofs[oneofRef]; !ok { - p.P(ToLowerFirst(generator.CamelCase(m.OneofDecl[*f.OneofIndex].GetName())), ": ", p.GqlModelNames()[p.GetOneof(oneofRef)]) - } - oneofs[oneofRef] = struct{}{} - continue - } - opts := GetGqlFieldOptions(f) - if opts != nil { - if opts.Params != nil { - *opts.Params = "(" + strings.Trim(*opts.Params, " ") + ")" - } - if opts.Dirs != nil { - *opts.Dirs = strings.Trim(*opts.Dirs, " ") - } - } - - if typ, ok := p.Types()[f.GetTypeName()]; ok { - if p.IsEmpty(typ) { - continue - } + dd, err := desc.CreateFileDescriptorsFromSet(&descriptor.FileDescriptorSet{ + File: req.GetProtoFile(), + }) + if err != nil { + return nil, err + } + var descs []*desc.FileDescriptor + for _, d := range dd { + for _, filename := range req.FileToGenerate { + if filename == d.GetName() { + descs = append(descs, d) } - - p.P(ToLowerFirst(generator.CamelCase(f.GetName())), opts.GetParams(), ": ", p.GraphQLType(f, p.Types()), " ", opts.GetDirs()) } - p.Out() - p.P("}\n") } - for _, entry := range TypeMap2List(p.Oneofs()) { - oneof := entry.Value - p.P("union ", p.GqlModelNames()[oneof], " = ", strings.Join(func() (ss []string) { - for typeName := range oneof.OneofTypes { - ss = append(ss, p.GqlModelNames()[p.Types()[typeName]]) - } - - sort.Sort(sort.StringSlice(ss)) - return ss - }(), " | "), "\n") + gqlDesc, err := generator.NewSchemas(descs, merge, genServiceDesc) + if err != nil { + return nil, err } + for _, schema := range gqlDesc { + buff := &bytes.Buffer{} + formatter.NewFormatter(buff).FormatSchema(schema.AsGraphql()) + protoFileName := schema.FileDescriptors[0].GetName() - // render enums - for _, entry := range TypeMap2List(p.Enums()) { - e := entry.Value - p.P("enum ", p.GqlModelNames()[e], " {") - p.In() - for _, v := range e.GetValue() { - p.P(v.GetName()) - } - p.Out() - p.P("}\n") + outFiles = append(outFiles, &pluginpb.CodeGeneratorResponse_File{ + Name: proto.String(resolveGraphqlFilename(protoFileName, merge)), + Content: proto.String(buff.String()), + }) } - if len(p.Mutations()) > 0 { - p.P("type Mutation {") - p.In() - p.renderMethod(p.Mutations()) - p.Out() - p.P("}\n") - } - if len(p.Queries()) > 0 { - p.P("type Query {") - p.In() - p.renderMethod(p.Queries()) - p.Out() - p.P("}\n") - } else { - p.P("type Query { dummy: Boolean }\n") - } - if len(p.Subscriptions()) > 0 { - p.P("type Subscription {") - p.In() - p.renderMethod(p.Subscriptions()) - p.Out() - p.P("}\n") - } + return } -func (p *plugin) renderMethod(methods []*Method) { - for _, m := range methods { - in, out := "", "Boolean" - - // some scalars can be used as inputs such as 'Any' - if scalar, ok := p.Scalars()[m.InputType]; ok { - if !p.IsEmpty(scalar) { - in = "(in: " + p.GqlModelNames()[scalar] + ")" - } - } else if input, ok := p.Inputs()[m.InputType]; ok { - if !p.IsEmpty(input) { - in = "(in: " + p.GqlModelNames()[input] + ")" +func resolveGraphqlFilename(protoFileName string, merge bool) string { + if merge { + gqlFileName := "schema.graphqls" + absProtoFileName, err := filepath.Abs(protoFileName) + if err == nil { + protoDirSlice := strings.Split(filepath.Dir(absProtoFileName), string(filepath.Separator)) + if len(protoDirSlice) > 0 { + gqlFileName = protoDirSlice[len(protoDirSlice)-1] + ".graphqls" } } - if scalar, ok := p.Scalars()[m.OutputType]; ok { - if !p.IsEmpty(scalar) { - in = "(in: " + p.GqlModelNames()[scalar] + ")" - } - } else if typ, ok := p.Types()[m.OutputType]; ok { - if !p.IsEmpty(typ) { - out = p.GqlModelNames()[typ] - } - } - - p.PrintComments(6, m.ServiceIndex, 2, m.Index) - if m.Phony { - p.P("# See the Subscription with the same name") - } - // Define a directive for each service, useful for service specific middleware - serviceDirective := "" - if p.serviceDirectives { - serviceDirective = " @" + m.ServiceDescriptorProto.GetName() - } - p.P(m.Name, in, ": ", out, serviceDirective) + protoDir, _ := path.Split(protoFileName) + return path.Join(protoDir, gqlFileName) } + + return strings.TrimSuffix(protoFileName, path.Ext(protoFileName)) + ".graphqls" } diff --git a/protoc-gen-gqlgencfg/main.go b/protoc-gen-gqlgencfg/main.go deleted file mode 100644 index 0dd852b..0000000 --- a/protoc-gen-gqlgencfg/main.go +++ /dev/null @@ -1,119 +0,0 @@ -package main - -import ( - "errors" - "io/ioutil" - "os" - "path" - "strings" - - . "github.com/danielvladco/go-proto-gql/plugin" - "github.com/gogo/protobuf/proto" - "github.com/gogo/protobuf/protoc-gen-gogo/generator" - "gopkg.in/yaml.v2" -) - -func main() { - gen := generator.New() - - data, err := ioutil.ReadAll(os.Stdin) - if err != nil { - gen.Error(err, "reading input") - } - - if err := proto.Unmarshal(data, gen.Request); err != nil { - gen.Error(err, "parsing input proto") - } - - p := &plugin{Plugin: NewPlugin()} - gen.CommandLineParameters(gen.Request.GetParameter()) - gen.WrapTypes() - gen.SetPackageNames() - gen.BuildTypeNameMap() - gen.GeneratePlugin(p) - - fileLen := len(gen.Response.GetFile()) - for i := 0; i < fileLen; i++ { - gen.Response.File[i].Name = proto.String(strings.Replace(gen.Response.File[i].GetName(), ".pb.go", ".gqlgen.pb.yml", -1)) - _, file := path.Split(strings.Replace(gen.Response.File[i].GetName(), ".gqlgen.pb.yml", ".pb.graphqls", -1)) - p.config[i].SchemaFilename = []string{path.Join(".", file)} - b, err := yaml.Marshal(p.config[i]) - if err != nil { - p.Error(errors.New("cannot create codegen.yml")) - } - gen.Response.File[i].Content = proto.String(string(b)) - } - - data, err = proto.Marshal(gen.Response) - if err != nil { - gen.Error(err, "failed to marshal output proto") - } - _, err = os.Stdout.Write(data) - if err != nil { - gen.Error(err, "failed to write output proto") - } -} - -type plugin struct { - *Plugin - - config []*config -} - -func (p *plugin) GenerateImports(file *generator.FileDescriptor) {} -func (p *plugin) Name() string { return "gqlgencfg" } -func (p *plugin) Init(g *generator.Generator) { p.Generator = g } -func (p *plugin) Generate(file *generator.FileDescriptor) { - for _, fileName := range p.Request.FileToGenerate { - if fileName == file.GetName() { - p.InitFile(file) - - cfg := &config{ - SchemaFilename: []string{}, - Exec: packageConfig{Filename: "exec.go"}, - Model: packageConfig{Filename: "models.go"}, - Models: make(map[string]typeMapEntry), - } - - for typ, key := range p.GqlModelNames() { - if typ == nil || p.IsEmpty(typ) || key == "Input" || key == "" { // filter possible junk data - continue - } - - if m, ok := cfg.Models[key]; ok { - m.Model = []string{typ.PackageDir + "." + typ.TypeName} - cfg.Models[key] = m - } else { - cfg.Models[key] = typeMapEntry{Model: []string{typ.PackageDir + "." + typ.TypeName}} - } - } - p.config = append(p.config, cfg) - } - } -} - -type ( - config struct { - SchemaFilename []string `yaml:"schema,omitempty"` - Exec packageConfig `yaml:"exec"` - Model packageConfig `yaml:"model"` - Resolver packageConfig `yaml:"resolver,omitempty"` - Models map[string]typeMapEntry `yaml:"models,omitempty"` - StructTag string `yaml:"struct_tag,omitempty"` - } - - packageConfig struct { - Filename string `yaml:"filename,omitempty"` - Package string `yaml:"package,omitempty"` - Type string `yaml:"type,omitempty"` - } - - typeMapEntry struct { - Model []string `yaml:"model"` - Fields map[string]typeMapField `yaml:"fields,omitempty"` - } - typeMapField struct { - Resolver bool `yaml:"resolver"` - FieldName string `yaml:"fieldName"` - } -) diff --git a/scripts/install-protoc.sh b/scripts/install-protoc.sh new file mode 100755 index 0000000..ec3030d --- /dev/null +++ b/scripts/install-protoc.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +PROTOC_VERSION=${PROTOC_VERSION:-"3.13.0"} +OS="linux" +if [[ $(uname) == "Darwin" ]]; then + OS="osx" +fi + +ARCHIVE_NAME="protoc-$PROTOC_VERSION-$OS-$(uname -m)" +curl -LO "https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$ARCHIVE_NAME.zip" + +cleanup () { + rm -f "$ARCHIVE_NAME.zip" + rm -rf $ARCHIVE_NAME +} + +trap cleanup EXIT +unzip -o $ARCHIVE_NAME -d $ARCHIVE_NAME +GOPATH="$(go env GOPATH)" +mv $ARCHIVE_NAME/bin/protoc $GOPATH/bin +rm -rf $GOPATH/include +mv $ARCHIVE_NAME/include $GOPATH diff --git a/tools/tools.go b/tools/tools.go new file mode 100644 index 0000000..217833d --- /dev/null +++ b/tools/tools.go @@ -0,0 +1,9 @@ +// +build tools + +package tools + +import ( + _ "github.com/99designs/gqlgen" + _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" + _ "google.golang.org/protobuf/cmd/protoc-gen-go" +)