diff --git a/example/starwars/spec/starwars/starwars.graphql.go b/example/starwars/spec/starwars/starwars.graphql.go index 7ce1c44..88a6ff0 100644 --- a/example/starwars/spec/starwars/starwars.graphql.go +++ b/example/starwars/spec/starwars/starwars.graphql.go @@ -13,12 +13,12 @@ var ( gql__enum_Type *graphql.Enum // enum Type in starwars/starwars.proto gql__enum_Episode *graphql.Enum // enum Episode in starwars/starwars.proto gql__interface_Character *graphql.Interface // message Character in starwars/starwars.proto - gql__type_ListDroidsResponse *graphql.Object // message ListDroidsResponse in starwars/starwars.proto - gql__type_ListHumansResponse *graphql.Object // message ListHumansResponse in starwars/starwars.proto - gql__type_GetHumanRequest *graphql.Object // message GetHumanRequest in starwars/starwars.proto gql__type_Character *graphql.Object // message Character in starwars/starwars.proto - gql__type_GetDroidRequest *graphql.Object // message GetDroidRequest in starwars/starwars.proto + gql__type_GetHumanRequest *graphql.Object // message GetHumanRequest in starwars/starwars.proto gql__type_GetHeroRequest *graphql.Object // message GetHeroRequest in starwars/starwars.proto + gql__type_ListDroidsResponse *graphql.Object // message ListDroidsResponse in starwars/starwars.proto + gql__type_GetDroidRequest *graphql.Object // message GetDroidRequest in starwars/starwars.proto + gql__type_ListHumansResponse *graphql.Object // message ListHumansResponse in starwars/starwars.proto ) func Gql__enum_Type() *graphql.Enum { @@ -93,49 +93,6 @@ func Gql__interface_Character() *graphql.Interface { return gql__interface_Character } -func Gql__type_ListDroidsResponse() *graphql.Object { - if gql__type_ListDroidsResponse == nil { - gql__type_ListDroidsResponse = graphql.NewObject(graphql.ObjectConfig{ - Name: "ListDroidsResponse", - Fields: graphql.Fields{ - "droids": &graphql.Field{ - Type: graphql.NewList(Gql__type_Character()), - }, - }, - }) - } - return gql__type_ListDroidsResponse -} - -func Gql__type_ListHumansResponse() *graphql.Object { - if gql__type_ListHumansResponse == nil { - gql__type_ListHumansResponse = graphql.NewObject(graphql.ObjectConfig{ - Name: "ListHumansResponse", - Fields: graphql.Fields{ - "humans": &graphql.Field{ - Type: graphql.NewList(Gql__type_Character()), - }, - }, - }) - } - return gql__type_ListHumansResponse -} - -func Gql__type_GetHumanRequest() *graphql.Object { - if gql__type_GetHumanRequest == nil { - gql__type_GetHumanRequest = graphql.NewObject(graphql.ObjectConfig{ - Name: "GetHumanRequest", - Fields: graphql.Fields{ - "id": &graphql.Field{ - Type: graphql.NewNonNull(graphql.Int), - Description: `id of the human`, - }, - }, - }) - } - return gql__type_GetHumanRequest -} - func Gql__type_Character() *graphql.Object { if gql__type_Character == nil { gql__type_Character = graphql.NewObject(graphql.ObjectConfig{ @@ -171,19 +128,19 @@ func Gql__type_Character() *graphql.Object { return gql__type_Character } -func Gql__type_GetDroidRequest() *graphql.Object { - if gql__type_GetDroidRequest == nil { - gql__type_GetDroidRequest = graphql.NewObject(graphql.ObjectConfig{ - Name: "GetDroidRequest", +func Gql__type_GetHumanRequest() *graphql.Object { + if gql__type_GetHumanRequest == nil { + gql__type_GetHumanRequest = graphql.NewObject(graphql.ObjectConfig{ + Name: "GetHumanRequest", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.NewNonNull(graphql.Int), - Description: `id of the droid`, + Description: `id of the human`, }, }, }) } - return gql__type_GetDroidRequest + return gql__type_GetHumanRequest } func Gql__type_GetHeroRequest() *graphql.Object { @@ -201,6 +158,49 @@ func Gql__type_GetHeroRequest() *graphql.Object { return gql__type_GetHeroRequest } +func Gql__type_ListDroidsResponse() *graphql.Object { + if gql__type_ListDroidsResponse == nil { + gql__type_ListDroidsResponse = graphql.NewObject(graphql.ObjectConfig{ + Name: "ListDroidsResponse", + Fields: graphql.Fields{ + "droids": &graphql.Field{ + Type: graphql.NewList(Gql__type_Character()), + }, + }, + }) + } + return gql__type_ListDroidsResponse +} + +func Gql__type_GetDroidRequest() *graphql.Object { + if gql__type_GetDroidRequest == nil { + gql__type_GetDroidRequest = graphql.NewObject(graphql.ObjectConfig{ + Name: "GetDroidRequest", + Fields: graphql.Fields{ + "id": &graphql.Field{ + Type: graphql.NewNonNull(graphql.Int), + Description: `id of the droid`, + }, + }, + }) + } + return gql__type_GetDroidRequest +} + +func Gql__type_ListHumansResponse() *graphql.Object { + if gql__type_ListHumansResponse == nil { + gql__type_ListHumansResponse = graphql.NewObject(graphql.ObjectConfig{ + Name: "ListHumansResponse", + Fields: graphql.Fields{ + "humans": &graphql.Field{ + Type: graphql.NewList(Gql__type_Character()), + }, + }, + }) + } + return gql__type_ListHumansResponse +} + // graphql__resolver_StartwarsService is a struct for making query, mutation and resolve fields. // This struct must be implemented runtime.SchemaBuilder interface. type graphql__resolver_StartwarsService struct { diff --git a/example/starwars/spec/starwars/starwars.pb.go b/example/starwars/spec/starwars/starwars.pb.go index 1871921..f851cd9 100644 --- a/example/starwars/spec/starwars/starwars.pb.go +++ b/example/starwars/spec/starwars/starwars.pb.go @@ -1,29 +1,34 @@ // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.21.0 +// protoc v3.7.1 // source: starwars/starwars.proto package starwars import ( context "context" - fmt "fmt" proto "github.com/golang/protobuf/proto" _ "github.com/ysugimoto/grpc-graphql-gateway/graphql" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 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 +// 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 @@ -32,22 +37,43 @@ const ( Type_DROID Type = 1 ) -var Type_name = map[int32]string{ - 0: "HUMAN", - 1: "DROID", -} +// Enum value maps for Type. +var ( + Type_name = map[int32]string{ + 0: "HUMAN", + 1: "DROID", + } + Type_value = map[string]int32{ + "HUMAN": 0, + "DROID": 1, + } +) -var Type_value = map[string]int32{ - "HUMAN": 0, - "DROID": 1, +func (x Type) Enum() *Type { + p := new(Type) + *p = x + return p } func (x Type) String() string { - return proto.EnumName(Type_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Type) Descriptor() protoreflect.EnumDescriptor { + return file_starwars_starwars_proto_enumTypes[0].Descriptor() +} + +func (Type) Type() protoreflect.EnumType { + return &file_starwars_starwars_proto_enumTypes[0] +} + +func (x Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use Type.Descriptor instead. func (Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d6da60d3f39fcaf9, []int{0} + return file_starwars_starwars_proto_rawDescGZIP(), []int{0} } type Episode int32 @@ -59,407 +85,671 @@ const ( Episode_JEDI Episode = 3 ) -var Episode_name = map[int32]string{ - 0: "_", - 1: "NEWHOPE", - 2: "EMPIRE", - 3: "JEDI", -} +// Enum value maps for Episode. +var ( + Episode_name = map[int32]string{ + 0: "_", + 1: "NEWHOPE", + 2: "EMPIRE", + 3: "JEDI", + } + Episode_value = map[string]int32{ + "_": 0, + "NEWHOPE": 1, + "EMPIRE": 2, + "JEDI": 3, + } +) -var Episode_value = map[string]int32{ - "_": 0, - "NEWHOPE": 1, - "EMPIRE": 2, - "JEDI": 3, +func (x Episode) Enum() *Episode { + p := new(Episode) + *p = x + return p } func (x Episode) String() string { - return proto.EnumName(Episode_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (Episode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d6da60d3f39fcaf9, []int{1} +func (Episode) Descriptor() protoreflect.EnumDescriptor { + return file_starwars_starwars_proto_enumTypes[1].Descriptor() } -type Character struct { - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Friends []*Character `protobuf:"bytes,3,rep,name=friends,proto3" json:"friends,omitempty"` - AppearsIn []Episode `protobuf:"varint,4,rep,packed,name=appears_in,json=appearsIn,proto3,enum=startwars.Episode" json:"appears_in,omitempty"` - HomePlanet string `protobuf:"bytes,5,opt,name=home_planet,json=homePlanet,proto3" json:"home_planet,omitempty"` - PrimaryFunction string `protobuf:"bytes,6,opt,name=primary_function,json=primaryFunction,proto3" json:"primary_function,omitempty"` - Type Type `protobuf:"varint,7,opt,name=type,proto3,enum=startwars.Type" json:"type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Character) Reset() { *m = Character{} } -func (m *Character) String() string { return proto.CompactTextString(m) } -func (*Character) ProtoMessage() {} -func (*Character) Descriptor() ([]byte, []int) { - return fileDescriptor_d6da60d3f39fcaf9, []int{0} +func (Episode) Type() protoreflect.EnumType { + return &file_starwars_starwars_proto_enumTypes[1] +} + +func (x Episode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } -func (m *Character) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Character.Unmarshal(m, b) +// Deprecated: Use Episode.Descriptor instead. +func (Episode) EnumDescriptor() ([]byte, []int) { + return file_starwars_starwars_proto_rawDescGZIP(), []int{1} } -func (m *Character) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Character.Marshal(b, m, deterministic) + +type Character struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Friends []*Character `protobuf:"bytes,3,rep,name=friends,proto3" json:"friends,omitempty"` + AppearsIn []Episode `protobuf:"varint,4,rep,packed,name=appears_in,json=appearsIn,proto3,enum=startwars.Episode" json:"appears_in,omitempty"` + HomePlanet string `protobuf:"bytes,5,opt,name=home_planet,json=homePlanet,proto3" json:"home_planet,omitempty"` + PrimaryFunction string `protobuf:"bytes,6,opt,name=primary_function,json=primaryFunction,proto3" json:"primary_function,omitempty"` + Type Type `protobuf:"varint,7,opt,name=type,proto3,enum=startwars.Type" json:"type,omitempty"` } -func (m *Character) XXX_Merge(src proto.Message) { - xxx_messageInfo_Character.Merge(m, src) + +func (x *Character) Reset() { + *x = Character{} + if protoimpl.UnsafeEnabled { + mi := &file_starwars_starwars_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *Character) XXX_Size() int { - return xxx_messageInfo_Character.Size(m) + +func (x *Character) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *Character) XXX_DiscardUnknown() { - xxx_messageInfo_Character.DiscardUnknown(m) + +func (*Character) ProtoMessage() {} + +func (x *Character) ProtoReflect() protoreflect.Message { + mi := &file_starwars_starwars_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) } -var xxx_messageInfo_Character proto.InternalMessageInfo +// Deprecated: Use Character.ProtoReflect.Descriptor instead. +func (*Character) Descriptor() ([]byte, []int) { + return file_starwars_starwars_proto_rawDescGZIP(), []int{0} +} -func (m *Character) GetId() int64 { - if m != nil { - return m.Id +func (x *Character) GetId() int64 { + if x != nil { + return x.Id } return 0 } -func (m *Character) GetName() string { - if m != nil { - return m.Name +func (x *Character) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *Character) GetFriends() []*Character { - if m != nil { - return m.Friends +func (x *Character) GetFriends() []*Character { + if x != nil { + return x.Friends } return nil } -func (m *Character) GetAppearsIn() []Episode { - if m != nil { - return m.AppearsIn +func (x *Character) GetAppearsIn() []Episode { + if x != nil { + return x.AppearsIn } return nil } -func (m *Character) GetHomePlanet() string { - if m != nil { - return m.HomePlanet +func (x *Character) GetHomePlanet() string { + if x != nil { + return x.HomePlanet } return "" } -func (m *Character) GetPrimaryFunction() string { - if m != nil { - return m.PrimaryFunction +func (x *Character) GetPrimaryFunction() string { + if x != nil { + return x.PrimaryFunction } return "" } -func (m *Character) GetType() Type { - if m != nil { - return m.Type +func (x *Character) GetType() Type { + if x != nil { + return x.Type } return Type_HUMAN } type GetHeroRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // If omitted, returns the hero of the whope saga. If provided, returns the hero of that particular episode. - Episode Episode `protobuf:"varint,1,opt,name=episode,proto3,enum=startwars.Episode" json:"episode,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Episode Episode `protobuf:"varint,1,opt,name=episode,proto3,enum=startwars.Episode" json:"episode,omitempty"` } -func (m *GetHeroRequest) Reset() { *m = GetHeroRequest{} } -func (m *GetHeroRequest) String() string { return proto.CompactTextString(m) } -func (*GetHeroRequest) ProtoMessage() {} -func (*GetHeroRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d6da60d3f39fcaf9, []int{1} +func (x *GetHeroRequest) Reset() { + *x = GetHeroRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_starwars_starwars_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetHeroRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHeroRequest.Unmarshal(m, b) -} -func (m *GetHeroRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHeroRequest.Marshal(b, m, deterministic) +func (x *GetHeroRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetHeroRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHeroRequest.Merge(m, src) -} -func (m *GetHeroRequest) XXX_Size() int { - return xxx_messageInfo_GetHeroRequest.Size(m) -} -func (m *GetHeroRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetHeroRequest.DiscardUnknown(m) + +func (*GetHeroRequest) ProtoMessage() {} + +func (x *GetHeroRequest) ProtoReflect() protoreflect.Message { + mi := &file_starwars_starwars_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) } -var xxx_messageInfo_GetHeroRequest proto.InternalMessageInfo +// Deprecated: Use GetHeroRequest.ProtoReflect.Descriptor instead. +func (*GetHeroRequest) Descriptor() ([]byte, []int) { + return file_starwars_starwars_proto_rawDescGZIP(), []int{1} +} -func (m *GetHeroRequest) GetEpisode() Episode { - if m != nil { - return m.Episode +func (x *GetHeroRequest) GetEpisode() Episode { + if x != nil { + return x.Episode } return Episode__ } type GetHumanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // id of the human - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (m *GetHumanRequest) Reset() { *m = GetHumanRequest{} } -func (m *GetHumanRequest) String() string { return proto.CompactTextString(m) } -func (*GetHumanRequest) ProtoMessage() {} -func (*GetHumanRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d6da60d3f39fcaf9, []int{2} +func (x *GetHumanRequest) Reset() { + *x = GetHumanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_starwars_starwars_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetHumanRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetHumanRequest.Unmarshal(m, b) -} -func (m *GetHumanRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetHumanRequest.Marshal(b, m, deterministic) -} -func (m *GetHumanRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetHumanRequest.Merge(m, src) -} -func (m *GetHumanRequest) XXX_Size() int { - return xxx_messageInfo_GetHumanRequest.Size(m) +func (x *GetHumanRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetHumanRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetHumanRequest.DiscardUnknown(m) + +func (*GetHumanRequest) ProtoMessage() {} + +func (x *GetHumanRequest) ProtoReflect() protoreflect.Message { + mi := &file_starwars_starwars_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) } -var xxx_messageInfo_GetHumanRequest proto.InternalMessageInfo +// Deprecated: Use GetHumanRequest.ProtoReflect.Descriptor instead. +func (*GetHumanRequest) Descriptor() ([]byte, []int) { + return file_starwars_starwars_proto_rawDescGZIP(), []int{2} +} -func (m *GetHumanRequest) GetId() int64 { - if m != nil { - return m.Id +func (x *GetHumanRequest) GetId() int64 { + if x != nil { + return x.Id } return 0 } type GetDroidRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // id of the droid - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` } -func (m *GetDroidRequest) Reset() { *m = GetDroidRequest{} } -func (m *GetDroidRequest) String() string { return proto.CompactTextString(m) } -func (*GetDroidRequest) ProtoMessage() {} -func (*GetDroidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d6da60d3f39fcaf9, []int{3} +func (x *GetDroidRequest) Reset() { + *x = GetDroidRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_starwars_starwars_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GetDroidRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GetDroidRequest.Unmarshal(m, b) -} -func (m *GetDroidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GetDroidRequest.Marshal(b, m, deterministic) -} -func (m *GetDroidRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDroidRequest.Merge(m, src) +func (x *GetDroidRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GetDroidRequest) XXX_Size() int { - return xxx_messageInfo_GetDroidRequest.Size(m) -} -func (m *GetDroidRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetDroidRequest.DiscardUnknown(m) + +func (*GetDroidRequest) ProtoMessage() {} + +func (x *GetDroidRequest) ProtoReflect() protoreflect.Message { + mi := &file_starwars_starwars_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) } -var xxx_messageInfo_GetDroidRequest proto.InternalMessageInfo +// Deprecated: Use GetDroidRequest.ProtoReflect.Descriptor instead. +func (*GetDroidRequest) Descriptor() ([]byte, []int) { + return file_starwars_starwars_proto_rawDescGZIP(), []int{3} +} -func (m *GetDroidRequest) GetId() int64 { - if m != nil { - return m.Id +func (x *GetDroidRequest) GetId() int64 { + if x != nil { + return x.Id } return 0 } type ListEmptyRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields } -func (m *ListEmptyRequest) Reset() { *m = ListEmptyRequest{} } -func (m *ListEmptyRequest) String() string { return proto.CompactTextString(m) } -func (*ListEmptyRequest) ProtoMessage() {} -func (*ListEmptyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d6da60d3f39fcaf9, []int{4} +func (x *ListEmptyRequest) Reset() { + *x = ListEmptyRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_starwars_starwars_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ListEmptyRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListEmptyRequest.Unmarshal(m, b) -} -func (m *ListEmptyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListEmptyRequest.Marshal(b, m, deterministic) -} -func (m *ListEmptyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListEmptyRequest.Merge(m, src) -} -func (m *ListEmptyRequest) XXX_Size() int { - return xxx_messageInfo_ListEmptyRequest.Size(m) -} -func (m *ListEmptyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ListEmptyRequest.DiscardUnknown(m) +func (x *ListEmptyRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -var xxx_messageInfo_ListEmptyRequest proto.InternalMessageInfo +func (*ListEmptyRequest) ProtoMessage() {} -type ListHumansResponse struct { - Humans []*Character `protobuf:"bytes,1,rep,name=humans,proto3" json:"humans,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (x *ListEmptyRequest) ProtoReflect() protoreflect.Message { + mi := &file_starwars_starwars_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) } -func (m *ListHumansResponse) Reset() { *m = ListHumansResponse{} } -func (m *ListHumansResponse) String() string { return proto.CompactTextString(m) } -func (*ListHumansResponse) ProtoMessage() {} -func (*ListHumansResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d6da60d3f39fcaf9, []int{5} +// Deprecated: Use ListEmptyRequest.ProtoReflect.Descriptor instead. +func (*ListEmptyRequest) Descriptor() ([]byte, []int) { + return file_starwars_starwars_proto_rawDescGZIP(), []int{4} } -func (m *ListHumansResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListHumansResponse.Unmarshal(m, b) -} -func (m *ListHumansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListHumansResponse.Marshal(b, m, deterministic) +type ListHumansResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Humans []*Character `protobuf:"bytes,1,rep,name=humans,proto3" json:"humans,omitempty"` } -func (m *ListHumansResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListHumansResponse.Merge(m, src) + +func (x *ListHumansResponse) Reset() { + *x = ListHumansResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_starwars_starwars_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ListHumansResponse) XXX_Size() int { - return xxx_messageInfo_ListHumansResponse.Size(m) + +func (x *ListHumansResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ListHumansResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListHumansResponse.DiscardUnknown(m) + +func (*ListHumansResponse) ProtoMessage() {} + +func (x *ListHumansResponse) ProtoReflect() protoreflect.Message { + mi := &file_starwars_starwars_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) } -var xxx_messageInfo_ListHumansResponse proto.InternalMessageInfo +// Deprecated: Use ListHumansResponse.ProtoReflect.Descriptor instead. +func (*ListHumansResponse) Descriptor() ([]byte, []int) { + return file_starwars_starwars_proto_rawDescGZIP(), []int{5} +} -func (m *ListHumansResponse) GetHumans() []*Character { - if m != nil { - return m.Humans +func (x *ListHumansResponse) GetHumans() []*Character { + if x != nil { + return x.Humans } return nil } type ListDroidsResponse struct { - Droids []*Character `protobuf:"bytes,1,rep,name=droids,proto3" json:"droids,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -func (m *ListDroidsResponse) Reset() { *m = ListDroidsResponse{} } -func (m *ListDroidsResponse) String() string { return proto.CompactTextString(m) } -func (*ListDroidsResponse) ProtoMessage() {} -func (*ListDroidsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d6da60d3f39fcaf9, []int{6} + Droids []*Character `protobuf:"bytes,1,rep,name=droids,proto3" json:"droids,omitempty"` } -func (m *ListDroidsResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ListDroidsResponse.Unmarshal(m, b) -} -func (m *ListDroidsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ListDroidsResponse.Marshal(b, m, deterministic) -} -func (m *ListDroidsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ListDroidsResponse.Merge(m, src) +func (x *ListDroidsResponse) Reset() { + *x = ListDroidsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_starwars_starwars_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *ListDroidsResponse) XXX_Size() int { - return xxx_messageInfo_ListDroidsResponse.Size(m) + +func (x *ListDroidsResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *ListDroidsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ListDroidsResponse.DiscardUnknown(m) + +func (*ListDroidsResponse) ProtoMessage() {} + +func (x *ListDroidsResponse) ProtoReflect() protoreflect.Message { + mi := &file_starwars_starwars_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) } -var xxx_messageInfo_ListDroidsResponse proto.InternalMessageInfo +// Deprecated: Use ListDroidsResponse.ProtoReflect.Descriptor instead. +func (*ListDroidsResponse) Descriptor() ([]byte, []int) { + return file_starwars_starwars_proto_rawDescGZIP(), []int{6} +} -func (m *ListDroidsResponse) GetDroids() []*Character { - if m != nil { - return m.Droids +func (x *ListDroidsResponse) GetDroids() []*Character { + if x != nil { + return x.Droids } return nil } -func init() { - proto.RegisterEnum("startwars.Type", Type_name, Type_value) - proto.RegisterEnum("startwars.Episode", Episode_name, Episode_value) - proto.RegisterType((*Character)(nil), "startwars.Character") - proto.RegisterType((*GetHeroRequest)(nil), "startwars.GetHeroRequest") - proto.RegisterType((*GetHumanRequest)(nil), "startwars.GetHumanRequest") - proto.RegisterType((*GetDroidRequest)(nil), "startwars.GetDroidRequest") - proto.RegisterType((*ListEmptyRequest)(nil), "startwars.ListEmptyRequest") - proto.RegisterType((*ListHumansResponse)(nil), "startwars.ListHumansResponse") - proto.RegisterType((*ListDroidsResponse)(nil), "startwars.ListDroidsResponse") -} - -func init() { proto.RegisterFile("starwars/starwars.proto", fileDescriptor_d6da60d3f39fcaf9) } - -var fileDescriptor_d6da60d3f39fcaf9 = []byte{ - // 604 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x4d, 0x6f, 0xd3, 0x40, - 0x14, 0xac, 0xf3, 0xe5, 0xe4, 0x55, 0x4a, 0xcd, 0x13, 0x15, 0x26, 0x80, 0x88, 0xc2, 0x25, 0x54, - 0x6d, 0xd2, 0xa6, 0xea, 0x85, 0x03, 0x12, 0x4d, 0x0c, 0x49, 0x45, 0x3f, 0xe4, 0x82, 0x90, 0xb8, - 0x44, 0xdb, 0x64, 0x1b, 0xaf, 0x54, 0xdb, 0xdb, 0xf5, 0x86, 0xe2, 0x33, 0xff, 0x2a, 0x47, 0x7e, - 0x19, 0xf2, 0x7a, 0xdd, 0x3a, 0x51, 0x09, 0xe2, 0x94, 0xe7, 0xd9, 0xd9, 0x99, 0xa7, 0x99, 0x68, - 0xe1, 0x59, 0x24, 0x89, 0xb8, 0x23, 0x22, 0xea, 0x66, 0x43, 0x87, 0x8b, 0x50, 0x86, 0x58, 0x4b, - 0xbe, 0x65, 0x02, 0x34, 0xb6, 0x67, 0x82, 0x70, 0xef, 0xf6, 0xa6, 0xab, 0x7f, 0x53, 0x46, 0xeb, - 0x57, 0x01, 0x6a, 0x7d, 0x8f, 0x08, 0x32, 0x91, 0x54, 0x60, 0x1d, 0x0a, 0x6c, 0x6a, 0x1b, 0x4d, - 0xa3, 0x5d, 0x74, 0x0b, 0x6c, 0x8a, 0x08, 0xa5, 0x80, 0xf8, 0xd4, 0x2e, 0x34, 0x8d, 0x76, 0xcd, - 0x55, 0x33, 0x76, 0xc0, 0xbc, 0x16, 0x8c, 0x06, 0xd3, 0xc8, 0x2e, 0x36, 0x8b, 0xed, 0xcd, 0xde, - 0xd3, 0xce, 0xbd, 0x4b, 0xe7, 0x5e, 0xca, 0xcd, 0x48, 0x78, 0x00, 0x40, 0x38, 0xa7, 0x44, 0x44, - 0x63, 0x16, 0xd8, 0xa5, 0x66, 0xb1, 0x5d, 0xef, 0x61, 0xee, 0x8a, 0xc3, 0x59, 0x14, 0x4e, 0xa9, - 0x5b, 0xd3, 0xac, 0x51, 0x80, 0xaf, 0x61, 0xd3, 0x0b, 0x7d, 0x3a, 0xe6, 0x37, 0x24, 0xa0, 0xd2, - 0x2e, 0x2b, 0x77, 0x48, 0xa0, 0x0b, 0x85, 0xe0, 0x5b, 0xb0, 0xb8, 0x60, 0x3e, 0x11, 0xf1, 0xf8, - 0x7a, 0x1e, 0x4c, 0x24, 0x0b, 0x03, 0xbb, 0xa2, 0x58, 0x5b, 0x1a, 0xff, 0xa8, 0x61, 0x7c, 0x03, - 0x25, 0x19, 0x73, 0x6a, 0x9b, 0x4d, 0xa3, 0x5d, 0xef, 0x6d, 0xe5, 0x8c, 0xbf, 0xc4, 0x9c, 0xba, - 0xea, 0xb0, 0xf5, 0x1e, 0xea, 0x9f, 0xa8, 0x1c, 0x52, 0x11, 0xba, 0xf4, 0x76, 0x4e, 0x23, 0x89, - 0xbb, 0x60, 0xd2, 0x74, 0x31, 0x15, 0xc7, 0xe3, 0x2b, 0x67, 0x94, 0x56, 0x1b, 0xb6, 0x92, 0xfb, - 0x73, 0x9f, 0x04, 0x99, 0xc0, 0xf6, 0x43, 0x94, 0xc7, 0xe5, 0x45, 0xbf, 0x50, 0x35, 0x92, 0x44, - 0x35, 0x73, 0x20, 0x42, 0x36, 0xfd, 0x07, 0x13, 0xc1, 0xfa, 0xcc, 0x22, 0xe9, 0xf8, 0x5c, 0xc6, - 0x9a, 0xda, 0x3a, 0x06, 0x4c, 0x30, 0x65, 0x14, 0xb9, 0x34, 0xe2, 0x61, 0x10, 0x51, 0xdc, 0x85, - 0x8a, 0xa7, 0x10, 0xdb, 0x58, 0x53, 0x88, 0xe6, 0x64, 0x1a, 0x6a, 0x85, 0x25, 0x8d, 0xa9, 0x42, - 0xd6, 0x6b, 0xa4, 0x9c, 0x9d, 0x97, 0x50, 0x4a, 0xd2, 0xc3, 0x1a, 0x94, 0x87, 0x5f, 0x4f, 0x3f, - 0x9c, 0x59, 0x1b, 0xc9, 0x38, 0x70, 0xcf, 0x47, 0x03, 0xcb, 0xd8, 0x39, 0x04, 0x53, 0x27, 0x84, - 0x65, 0x30, 0xc6, 0xd6, 0x06, 0x6e, 0x82, 0x79, 0xe6, 0x7c, 0x1b, 0x9e, 0x5f, 0x38, 0x96, 0x81, - 0x00, 0x15, 0xe7, 0xf4, 0x62, 0xe4, 0x3a, 0x56, 0x01, 0xab, 0x50, 0x3a, 0x71, 0x06, 0x23, 0xab, - 0xd8, 0xfb, 0x5d, 0x04, 0xeb, 0x32, 0xb3, 0xbc, 0xa4, 0xe2, 0x07, 0x9b, 0x50, 0x74, 0xc0, 0xd4, - 0xbd, 0xe0, 0xf3, 0xdc, 0x42, 0xcb, 0x5d, 0x35, 0x1e, 0xdd, 0xb5, 0x55, 0x5b, 0xf4, 0x2b, 0x58, - 0xf2, 0x92, 0xbb, 0x43, 0xa8, 0x66, 0xf5, 0x60, 0x63, 0x45, 0x27, 0xd7, 0xd9, 0x5f, 0x84, 0x60, - 0xd1, 0x37, 0xb1, 0xac, 0xd2, 0xd3, 0x4a, 0x2a, 0xbb, 0x55, 0xa5, 0x7c, 0xa7, 0x6b, 0x95, 0x54, - 0x86, 0x38, 0x06, 0x78, 0xa8, 0x12, 0x5f, 0xe4, 0xf8, 0xab, 0xad, 0x37, 0x5e, 0xad, 0x1c, 0x2e, - 0xd7, 0xdf, 0xda, 0x5e, 0xf4, 0x11, 0xb3, 0x76, 0xab, 0xd9, 0x94, 0x19, 0xa4, 0x3d, 0xff, 0x9f, - 0xc1, 0xf2, 0x7f, 0x43, 0x1b, 0xa4, 0xd5, 0x27, 0x06, 0xe9, 0xd4, 0x78, 0xb2, 0xe8, 0xd7, 0x01, - 0x66, 0x82, 0x4f, 0xde, 0x1d, 0xed, 0xef, 0x1f, 0x1d, 0x58, 0xc6, 0xf1, 0xc9, 0xf7, 0xe1, 0x8c, - 0x49, 0x6f, 0x7e, 0xd5, 0x99, 0x84, 0x7e, 0x37, 0x8e, 0xe6, 0x33, 0xe6, 0x87, 0x32, 0xec, 0x26, - 0xa4, 0x3d, 0xfd, 0xf0, 0xec, 0xcd, 0x88, 0xa4, 0x77, 0x24, 0xee, 0xd2, 0x9f, 0xc4, 0xe7, 0x37, - 0xb4, 0xfb, 0xf0, 0x78, 0x71, 0x3a, 0xb9, 0xff, 0xba, 0xaa, 0xa8, 0x07, 0xea, 0xf0, 0x4f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x53, 0x80, 0x87, 0xc1, 0xdd, 0x04, 0x00, 0x00, +var File_starwars_starwars_proto protoreflect.FileDescriptor + +var file_starwars_starwars_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x73, 0x74, 0x61, 0x72, 0x77, 0x61, 0x72, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x72, 0x77, + 0x61, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x77, 0x61, 0x72, 0x73, 0x1a, 0x15, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2f, 0x67, 0x72, + 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x02, 0x0a, 0x09, + 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, + 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x61, + 0x63, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x73, 0x12, 0x31, 0x0a, + 0x0a, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x5f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x45, 0x70, + 0x69, 0x73, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x49, 0x6e, + 0x12, 0x1f, 0x0a, 0x0b, 0x68, 0x6f, 0x6d, 0x65, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x74, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x68, 0x6f, 0x6d, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x65, + 0x74, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x69, + 0x6d, 0x61, 0x72, 0x79, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x22, 0x3e, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, + 0x2e, 0x45, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x65, 0x70, 0x69, 0x73, 0x6f, 0x64, + 0x65, 0x22, 0x28, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x05, 0xba, 0x43, 0x02, 0x08, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x0f, 0x47, + 0x65, 0x74, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x05, 0xba, 0x43, 0x02, 0x08, + 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x42, 0x0a, 0x12, 0x4c, 0x69, 0x73, + 0x74, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x2c, 0x0a, 0x06, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x72, + 0x61, 0x63, 0x74, 0x65, 0x72, 0x52, 0x06, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x73, 0x22, 0x42, 0x0a, + 0x12, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, + 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x52, 0x06, 0x64, 0x72, 0x6f, 0x69, 0x64, + 0x73, 0x2a, 0x1c, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x48, 0x55, 0x4d, + 0x41, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x52, 0x4f, 0x49, 0x44, 0x10, 0x01, 0x2a, + 0x33, 0x0a, 0x07, 0x45, 0x70, 0x69, 0x73, 0x6f, 0x64, 0x65, 0x12, 0x05, 0x0a, 0x01, 0x5f, 0x10, + 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x45, 0x57, 0x48, 0x4f, 0x50, 0x45, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x45, 0x4d, 0x50, 0x49, 0x52, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x4a, 0x45, + 0x44, 0x49, 0x10, 0x03, 0x32, 0xc2, 0x03, 0x0a, 0x10, 0x53, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, + 0x72, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x47, 0x65, 0x74, + 0x48, 0x65, 0x72, 0x6f, 0x12, 0x19, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, + 0x2e, 0x47, 0x65, 0x74, 0x48, 0x65, 0x72, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x14, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x72, + 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0x09, 0xba, 0x43, 0x06, 0x12, 0x04, 0x68, 0x65, 0x72, 0x6f, + 0x12, 0x48, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x12, 0x1a, 0x2e, 0x73, + 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x75, 0x6d, 0x61, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x77, 0x61, 0x72, 0x73, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0x0a, + 0xba, 0x43, 0x07, 0x12, 0x05, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x12, 0x48, 0x0a, 0x08, 0x47, 0x65, + 0x74, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x12, 0x1a, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, + 0x72, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x43, + 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x22, 0x0a, 0xba, 0x43, 0x07, 0x12, 0x05, 0x64, + 0x72, 0x6f, 0x69, 0x64, 0x12, 0x5f, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x75, 0x6d, 0x61, + 0x6e, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1d, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x48, 0x75, 0x6d, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, + 0xba, 0x43, 0x12, 0x12, 0x06, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x73, 0x22, 0x08, 0x12, 0x06, 0x68, + 0x75, 0x6d, 0x61, 0x6e, 0x73, 0x12, 0x5f, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x72, 0x6f, + 0x69, 0x64, 0x73, 0x12, 0x1b, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x77, 0x61, 0x72, 0x73, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x44, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x15, 0xba, 0x43, 0x12, 0x12, 0x06, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x08, 0x12, 0x06, + 0x64, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x1a, 0x11, 0xba, 0x43, 0x0e, 0x0a, 0x0a, 0x67, 0x72, 0x70, + 0x63, 0x3a, 0x35, 0x30, 0x30, 0x35, 0x31, 0x10, 0x01, 0x42, 0x4a, 0x5a, 0x48, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x73, 0x75, 0x67, 0x69, 0x6d, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2d, 0x67, + 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x73, + 0x74, 0x61, 0x72, 0x77, 0x61, 0x72, 0x73, 0x2f, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x73, 0x74, 0x61, + 0x72, 0x77, 0x61, 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_starwars_starwars_proto_rawDescOnce sync.Once + file_starwars_starwars_proto_rawDescData = file_starwars_starwars_proto_rawDesc +) + +func file_starwars_starwars_proto_rawDescGZIP() []byte { + file_starwars_starwars_proto_rawDescOnce.Do(func() { + file_starwars_starwars_proto_rawDescData = protoimpl.X.CompressGZIP(file_starwars_starwars_proto_rawDescData) + }) + return file_starwars_starwars_proto_rawDescData +} + +var file_starwars_starwars_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_starwars_starwars_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_starwars_starwars_proto_goTypes = []interface{}{ + (Type)(0), // 0: startwars.Type + (Episode)(0), // 1: startwars.Episode + (*Character)(nil), // 2: startwars.Character + (*GetHeroRequest)(nil), // 3: startwars.GetHeroRequest + (*GetHumanRequest)(nil), // 4: startwars.GetHumanRequest + (*GetDroidRequest)(nil), // 5: startwars.GetDroidRequest + (*ListEmptyRequest)(nil), // 6: startwars.ListEmptyRequest + (*ListHumansResponse)(nil), // 7: startwars.ListHumansResponse + (*ListDroidsResponse)(nil), // 8: startwars.ListDroidsResponse +} +var file_starwars_starwars_proto_depIdxs = []int32{ + 2, // 0: startwars.Character.friends:type_name -> startwars.Character + 1, // 1: startwars.Character.appears_in:type_name -> startwars.Episode + 0, // 2: startwars.Character.type:type_name -> startwars.Type + 1, // 3: startwars.GetHeroRequest.episode:type_name -> startwars.Episode + 2, // 4: startwars.ListHumansResponse.humans:type_name -> startwars.Character + 2, // 5: startwars.ListDroidsResponse.droids:type_name -> startwars.Character + 3, // 6: startwars.StartwarsService.GetHero:input_type -> startwars.GetHeroRequest + 4, // 7: startwars.StartwarsService.GetHuman:input_type -> startwars.GetHumanRequest + 5, // 8: startwars.StartwarsService.GetDroid:input_type -> startwars.GetDroidRequest + 6, // 9: startwars.StartwarsService.ListHumans:input_type -> startwars.ListEmptyRequest + 6, // 10: startwars.StartwarsService.ListDroids:input_type -> startwars.ListEmptyRequest + 2, // 11: startwars.StartwarsService.GetHero:output_type -> startwars.Character + 2, // 12: startwars.StartwarsService.GetHuman:output_type -> startwars.Character + 2, // 13: startwars.StartwarsService.GetDroid:output_type -> startwars.Character + 7, // 14: startwars.StartwarsService.ListHumans:output_type -> startwars.ListHumansResponse + 8, // 15: startwars.StartwarsService.ListDroids:output_type -> startwars.ListDroidsResponse + 11, // [11:16] is the sub-list for method output_type + 6, // [6:11] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name +} + +func init() { file_starwars_starwars_proto_init() } +func file_starwars_starwars_proto_init() { + if File_starwars_starwars_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_starwars_starwars_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Character); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_starwars_starwars_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetHeroRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_starwars_starwars_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetHumanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_starwars_starwars_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetDroidRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_starwars_starwars_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEmptyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_starwars_starwars_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListHumansResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_starwars_starwars_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListDroidsResponse); 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_starwars_starwars_proto_rawDesc, + NumEnums: 2, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_starwars_starwars_proto_goTypes, + DependencyIndexes: file_starwars_starwars_proto_depIdxs, + EnumInfos: file_starwars_starwars_proto_enumTypes, + MessageInfos: file_starwars_starwars_proto_msgTypes, + }.Build() + File_starwars_starwars_proto = out.File + file_starwars_starwars_proto_rawDesc = nil + file_starwars_starwars_proto_goTypes = nil + file_starwars_starwars_proto_depIdxs = nil } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConn +var _ grpc.ClientConnInterface // 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.SupportPackageIsVersion6 // StartwarsServiceClient is the client API for StartwarsService service. // @@ -473,10 +763,10 @@ type StartwarsServiceClient interface { } type startwarsServiceClient struct { - cc *grpc.ClientConn + cc grpc.ClientConnInterface } -func NewStartwarsServiceClient(cc *grpc.ClientConn) StartwarsServiceClient { +func NewStartwarsServiceClient(cc grpc.ClientConnInterface) StartwarsServiceClient { return &startwarsServiceClient{cc} } @@ -538,19 +828,19 @@ type StartwarsServiceServer interface { type UnimplementedStartwarsServiceServer struct { } -func (*UnimplementedStartwarsServiceServer) GetHero(ctx context.Context, req *GetHeroRequest) (*Character, error) { +func (*UnimplementedStartwarsServiceServer) GetHero(context.Context, *GetHeroRequest) (*Character, error) { return nil, status.Errorf(codes.Unimplemented, "method GetHero not implemented") } -func (*UnimplementedStartwarsServiceServer) GetHuman(ctx context.Context, req *GetHumanRequest) (*Character, error) { +func (*UnimplementedStartwarsServiceServer) GetHuman(context.Context, *GetHumanRequest) (*Character, error) { return nil, status.Errorf(codes.Unimplemented, "method GetHuman not implemented") } -func (*UnimplementedStartwarsServiceServer) GetDroid(ctx context.Context, req *GetDroidRequest) (*Character, error) { +func (*UnimplementedStartwarsServiceServer) GetDroid(context.Context, *GetDroidRequest) (*Character, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDroid not implemented") } -func (*UnimplementedStartwarsServiceServer) ListHumans(ctx context.Context, req *ListEmptyRequest) (*ListHumansResponse, error) { +func (*UnimplementedStartwarsServiceServer) ListHumans(context.Context, *ListEmptyRequest) (*ListHumansResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListHumans not implemented") } -func (*UnimplementedStartwarsServiceServer) ListDroids(ctx context.Context, req *ListEmptyRequest) (*ListDroidsResponse, error) { +func (*UnimplementedStartwarsServiceServer) ListDroids(context.Context, *ListEmptyRequest) (*ListDroidsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListDroids not implemented") } diff --git a/go.mod b/go.mod index 63b9cb8..8da50bf 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/ysugimoto/grpc-graphql-gateway go 1.12 require ( - github.com/golang/protobuf v1.3.3 + github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0 github.com/graphql-go/graphql v0.7.8 github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 github.com/k0kubun/pp v3.0.1+incompatible // indirect @@ -12,5 +12,6 @@ require ( golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 // indirect golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 // indirect google.golang.org/grpc v1.27.0 + google.golang.org/protobuf v1.21.0 honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc // indirect ) diff --git a/go.sum b/go.sum index 6a580e0..8c16c4f 100644 --- a/go.sum +++ b/go.sum @@ -10,7 +10,15 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +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 h1:aRz0NBceriICVtjhCgKkDvl+RudKu1CT6h0ZvUTrNfE= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= 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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/graphql-go/graphql v0.7.8 h1:769CR/2JNAhLG9+aa8pfLkKdR0H+r5lsQqling5WwpU= github.com/graphql-go/graphql v0.7.8/go.mod h1:k6yrAYQaSP59DC5UVxbgxESlmVyojThKdORUqGDGmrI= github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 h1:VHgatEHNcBFEB7inlalqfNqw65aNkM1lGX2yt3NmbS8= @@ -46,6 +54,7 @@ golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGm 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-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +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/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -55,5 +64,11 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.27.0 h1:rRYRFMVgRv6E0D70Skyfsr28tDXIuuPZyWGMPdMcnXg= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +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 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= 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= diff --git a/graphql/graphql.pb.go b/graphql/graphql.pb.go index a2dfbe5..aa0c136 100644 --- a/graphql/graphql.pb.go +++ b/graphql/graphql.pb.go @@ -1,25 +1,37 @@ +// graphql.proto +// +// Copyright (c) 2020 ysugimoto +// +// Released under the MIT license. +// see https://opensource.org/licenses/MIT + // Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.21.0 +// protoc v3.7.1 // source: graphql.proto package graphql import ( - fmt "fmt" proto "github.com/golang/protobuf/proto" descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" - math "math" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf +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 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 +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 // explicit schema declaration enum type GraphqlType int32 @@ -31,22 +43,43 @@ const ( GraphqlType_MUTATION GraphqlType = 1 ) -var GraphqlType_name = map[int32]string{ - 0: "QUERY", - 1: "MUTATION", -} +// Enum value maps for GraphqlType. +var ( + GraphqlType_name = map[int32]string{ + 0: "QUERY", + 1: "MUTATION", + } + GraphqlType_value = map[string]int32{ + "QUERY": 0, + "MUTATION": 1, + } +) -var GraphqlType_value = map[string]int32{ - "QUERY": 0, - "MUTATION": 1, +func (x GraphqlType) Enum() *GraphqlType { + p := new(GraphqlType) + *p = x + return p } func (x GraphqlType) String() string { - return proto.EnumName(GraphqlType_name, int32(x)) + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GraphqlType) Descriptor() protoreflect.EnumDescriptor { + return file_graphql_proto_enumTypes[0].Descriptor() +} + +func (GraphqlType) Type() protoreflect.EnumType { + return &file_graphql_proto_enumTypes[0] +} + +func (x GraphqlType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) } +// Deprecated: Use GraphqlType.Descriptor instead. func (GraphqlType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3ce0fc368bdc1a51, []int{0} + return file_graphql_proto_rawDescGZIP(), []int{0} } // Extend ServiceOptions in order to define grpc connection setting. @@ -61,51 +94,59 @@ func (GraphqlType) EnumDescriptor() ([]byte, []int) { // ... some rpc definitions // } type GraphqlService struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // gRPC default connection host. // This value should include host and port, say localhost:50051. Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` // If true, automatic connection with insecure option. - Insecure bool `protobuf:"varint,2,opt,name=insecure,proto3" json:"insecure,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Insecure bool `protobuf:"varint,2,opt,name=insecure,proto3" json:"insecure,omitempty"` } -func (m *GraphqlService) Reset() { *m = GraphqlService{} } -func (m *GraphqlService) String() string { return proto.CompactTextString(m) } -func (*GraphqlService) ProtoMessage() {} -func (*GraphqlService) Descriptor() ([]byte, []int) { - return fileDescriptor_3ce0fc368bdc1a51, []int{0} +func (x *GraphqlService) Reset() { + *x = GraphqlService{} + if protoimpl.UnsafeEnabled { + mi := &file_graphql_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GraphqlService) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GraphqlService.Unmarshal(m, b) -} -func (m *GraphqlService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GraphqlService.Marshal(b, m, deterministic) -} -func (m *GraphqlService) XXX_Merge(src proto.Message) { - xxx_messageInfo_GraphqlService.Merge(m, src) +func (x *GraphqlService) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GraphqlService) XXX_Size() int { - return xxx_messageInfo_GraphqlService.Size(m) -} -func (m *GraphqlService) XXX_DiscardUnknown() { - xxx_messageInfo_GraphqlService.DiscardUnknown(m) + +func (*GraphqlService) ProtoMessage() {} + +func (x *GraphqlService) ProtoReflect() protoreflect.Message { + mi := &file_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) } -var xxx_messageInfo_GraphqlService proto.InternalMessageInfo +// Deprecated: Use GraphqlService.ProtoReflect.Descriptor instead. +func (*GraphqlService) Descriptor() ([]byte, []int) { + return file_graphql_proto_rawDescGZIP(), []int{0} +} -func (m *GraphqlService) GetHost() string { - if m != nil { - return m.Host +func (x *GraphqlService) GetHost() string { + if x != nil { + return x.Host } return "" } -func (m *GraphqlService) GetInsecure() bool { - if m != nil { - return m.Insecure +func (x *GraphqlService) GetInsecure() bool { + if x != nil { + return x.Insecure } return false } @@ -187,6 +228,10 @@ func (m *GraphqlService) GetInsecure() bool { // // Finally, user can access this query via /graphql?query={members{name}} type GraphqlSchema struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // graphql type. Enum of QUERY or MUTATION is valid value Type GraphqlType `protobuf:"varint,1,opt,name=type,proto3,enum=graphql.GraphqlType" json:"type,omitempty"` // query name. this field is required @@ -194,166 +239,186 @@ type GraphqlSchema struct { // Query request object configuration Request *GraphqlRequest `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"` // Query response object configuration - Response *GraphqlResponse `protobuf:"bytes,4,opt,name=response,proto3" json:"response,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Response *GraphqlResponse `protobuf:"bytes,4,opt,name=response,proto3" json:"response,omitempty"` } -func (m *GraphqlSchema) Reset() { *m = GraphqlSchema{} } -func (m *GraphqlSchema) String() string { return proto.CompactTextString(m) } -func (*GraphqlSchema) ProtoMessage() {} -func (*GraphqlSchema) Descriptor() ([]byte, []int) { - return fileDescriptor_3ce0fc368bdc1a51, []int{1} +func (x *GraphqlSchema) Reset() { + *x = GraphqlSchema{} + if protoimpl.UnsafeEnabled { + mi := &file_graphql_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GraphqlSchema) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GraphqlSchema.Unmarshal(m, b) -} -func (m *GraphqlSchema) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GraphqlSchema.Marshal(b, m, deterministic) +func (x *GraphqlSchema) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GraphqlSchema) XXX_Merge(src proto.Message) { - xxx_messageInfo_GraphqlSchema.Merge(m, src) -} -func (m *GraphqlSchema) XXX_Size() int { - return xxx_messageInfo_GraphqlSchema.Size(m) -} -func (m *GraphqlSchema) XXX_DiscardUnknown() { - xxx_messageInfo_GraphqlSchema.DiscardUnknown(m) + +func (*GraphqlSchema) ProtoMessage() {} + +func (x *GraphqlSchema) ProtoReflect() protoreflect.Message { + mi := &file_graphql_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) } -var xxx_messageInfo_GraphqlSchema proto.InternalMessageInfo +// Deprecated: Use GraphqlSchema.ProtoReflect.Descriptor instead. +func (*GraphqlSchema) Descriptor() ([]byte, []int) { + return file_graphql_proto_rawDescGZIP(), []int{1} +} -func (m *GraphqlSchema) GetType() GraphqlType { - if m != nil { - return m.Type +func (x *GraphqlSchema) GetType() GraphqlType { + if x != nil { + return x.Type } return GraphqlType_QUERY } -func (m *GraphqlSchema) GetName() string { - if m != nil { - return m.Name +func (x *GraphqlSchema) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *GraphqlSchema) GetRequest() *GraphqlRequest { - if m != nil { - return m.Request +func (x *GraphqlSchema) GetRequest() *GraphqlRequest { + if x != nil { + return x.Request } return nil } -func (m *GraphqlSchema) GetResponse() *GraphqlResponse { - if m != nil { - return m.Response +func (x *GraphqlSchema) GetResponse() *GraphqlResponse { + if x != nil { + return x.Response } return nil } // configuration option for request type GraphqlRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // Define input name. // This field enables only for mutation and note that if this field is specified, // the gRPC request message will be dealt with an input. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Define pluck message fields - Plucks []string `protobuf:"bytes,2,rep,name=plucks,proto3" json:"plucks,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Plucks []string `protobuf:"bytes,2,rep,name=plucks,proto3" json:"plucks,omitempty"` } -func (m *GraphqlRequest) Reset() { *m = GraphqlRequest{} } -func (m *GraphqlRequest) String() string { return proto.CompactTextString(m) } -func (*GraphqlRequest) ProtoMessage() {} -func (*GraphqlRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3ce0fc368bdc1a51, []int{2} +func (x *GraphqlRequest) Reset() { + *x = GraphqlRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_graphql_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GraphqlRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GraphqlRequest.Unmarshal(m, b) +func (x *GraphqlRequest) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GraphqlRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GraphqlRequest.Marshal(b, m, deterministic) -} -func (m *GraphqlRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GraphqlRequest.Merge(m, src) -} -func (m *GraphqlRequest) XXX_Size() int { - return xxx_messageInfo_GraphqlRequest.Size(m) -} -func (m *GraphqlRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GraphqlRequest.DiscardUnknown(m) + +func (*GraphqlRequest) ProtoMessage() {} + +func (x *GraphqlRequest) ProtoReflect() protoreflect.Message { + mi := &file_graphql_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) } -var xxx_messageInfo_GraphqlRequest proto.InternalMessageInfo +// Deprecated: Use GraphqlRequest.ProtoReflect.Descriptor instead. +func (*GraphqlRequest) Descriptor() ([]byte, []int) { + return file_graphql_proto_rawDescGZIP(), []int{2} +} -func (m *GraphqlRequest) GetName() string { - if m != nil { - return m.Name +func (x *GraphqlRequest) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *GraphqlRequest) GetPlucks() []string { - if m != nil { - return m.Plucks +func (x *GraphqlRequest) GetPlucks() []string { + if x != nil { + return x.Plucks } return nil } // configuration option for response type GraphqlResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // If true, this response object is required // But when you declare "expose", we respect expose field definition. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Define pluck message field. // Note that this field IS NOT repeated, just single string field. // It means the response could only be single. - Pluck string `protobuf:"bytes,2,opt,name=pluck,proto3" json:"pluck,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Pluck string `protobuf:"bytes,2,opt,name=pluck,proto3" json:"pluck,omitempty"` } -func (m *GraphqlResponse) Reset() { *m = GraphqlResponse{} } -func (m *GraphqlResponse) String() string { return proto.CompactTextString(m) } -func (*GraphqlResponse) ProtoMessage() {} -func (*GraphqlResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3ce0fc368bdc1a51, []int{3} +func (x *GraphqlResponse) Reset() { + *x = GraphqlResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_graphql_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GraphqlResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GraphqlResponse.Unmarshal(m, b) -} -func (m *GraphqlResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GraphqlResponse.Marshal(b, m, deterministic) -} -func (m *GraphqlResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GraphqlResponse.Merge(m, src) +func (x *GraphqlResponse) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GraphqlResponse) XXX_Size() int { - return xxx_messageInfo_GraphqlResponse.Size(m) -} -func (m *GraphqlResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GraphqlResponse.DiscardUnknown(m) + +func (*GraphqlResponse) ProtoMessage() {} + +func (x *GraphqlResponse) ProtoReflect() protoreflect.Message { + mi := &file_graphql_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) } -var xxx_messageInfo_GraphqlResponse proto.InternalMessageInfo +// Deprecated: Use GraphqlResponse.ProtoReflect.Descriptor instead. +func (*GraphqlResponse) Descriptor() ([]byte, []int) { + return file_graphql_proto_rawDescGZIP(), []int{3} +} -func (m *GraphqlResponse) GetRequired() bool { - if m != nil { - return m.Required +func (x *GraphqlResponse) GetRequired() bool { + if x != nil { + return x.Required } return false } -func (m *GraphqlResponse) GetPluck() string { - if m != nil { - return m.Pluck +func (x *GraphqlResponse) GetPluck() string { + if x != nil { + return x.Pluck } return "" } @@ -373,132 +438,303 @@ func (m *GraphqlResponse) GetPluck() string { // so the same as it, all GraphQL fields are optional as default. // If you need to be required, use 'required: true' option type GraphqlField struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + // If true, this field is required. Required bool `protobuf:"varint,1,opt,name=required,proto3" json:"required,omitempty"` // Use as other field name (not recommend) Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Define default value on input. - Default string `protobuf:"bytes,3,opt,name=default,proto3" json:"default,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Default string `protobuf:"bytes,3,opt,name=default,proto3" json:"default,omitempty"` } -func (m *GraphqlField) Reset() { *m = GraphqlField{} } -func (m *GraphqlField) String() string { return proto.CompactTextString(m) } -func (*GraphqlField) ProtoMessage() {} -func (*GraphqlField) Descriptor() ([]byte, []int) { - return fileDescriptor_3ce0fc368bdc1a51, []int{4} +func (x *GraphqlField) Reset() { + *x = GraphqlField{} + if protoimpl.UnsafeEnabled { + mi := &file_graphql_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } } -func (m *GraphqlField) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_GraphqlField.Unmarshal(m, b) -} -func (m *GraphqlField) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_GraphqlField.Marshal(b, m, deterministic) -} -func (m *GraphqlField) XXX_Merge(src proto.Message) { - xxx_messageInfo_GraphqlField.Merge(m, src) -} -func (m *GraphqlField) XXX_Size() int { - return xxx_messageInfo_GraphqlField.Size(m) +func (x *GraphqlField) String() string { + return protoimpl.X.MessageStringOf(x) } -func (m *GraphqlField) XXX_DiscardUnknown() { - xxx_messageInfo_GraphqlField.DiscardUnknown(m) + +func (*GraphqlField) ProtoMessage() {} + +func (x *GraphqlField) ProtoReflect() protoreflect.Message { + mi := &file_graphql_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) } -var xxx_messageInfo_GraphqlField proto.InternalMessageInfo +// Deprecated: Use GraphqlField.ProtoReflect.Descriptor instead. +func (*GraphqlField) Descriptor() ([]byte, []int) { + return file_graphql_proto_rawDescGZIP(), []int{4} +} -func (m *GraphqlField) GetRequired() bool { - if m != nil { - return m.Required +func (x *GraphqlField) GetRequired() bool { + if x != nil { + return x.Required } return false } -func (m *GraphqlField) GetName() string { - if m != nil { - return m.Name +func (x *GraphqlField) GetName() string { + if x != nil { + return x.Name } return "" } -func (m *GraphqlField) GetDefault() string { - if m != nil { - return m.Default +func (x *GraphqlField) GetDefault() string { + if x != nil { + return x.Default } return "" } -var E_Service = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.ServiceOptions)(nil), - ExtensionType: (*GraphqlService)(nil), - Field: 1079, - Name: "graphql.service", - Tag: "bytes,1079,opt,name=service", - Filename: "graphql.proto", -} - -var E_Field = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.FieldOptions)(nil), - ExtensionType: (*GraphqlField)(nil), - Field: 1079, - Name: "graphql.field", - Tag: "bytes,1079,opt,name=field", - Filename: "graphql.proto", -} - -var E_Schema = &proto.ExtensionDesc{ - ExtendedType: (*descriptor.MethodOptions)(nil), - ExtensionType: (*GraphqlSchema)(nil), - Field: 1079, - Name: "graphql.schema", - Tag: "bytes,1079,opt,name=schema", - Filename: "graphql.proto", -} - -func init() { - proto.RegisterEnum("graphql.GraphqlType", GraphqlType_name, GraphqlType_value) - proto.RegisterType((*GraphqlService)(nil), "graphql.GraphqlService") - proto.RegisterType((*GraphqlSchema)(nil), "graphql.GraphqlSchema") - proto.RegisterType((*GraphqlRequest)(nil), "graphql.GraphqlRequest") - proto.RegisterType((*GraphqlResponse)(nil), "graphql.GraphqlResponse") - proto.RegisterType((*GraphqlField)(nil), "graphql.GraphqlField") - proto.RegisterExtension(E_Service) - proto.RegisterExtension(E_Field) - proto.RegisterExtension(E_Schema) -} - -func init() { proto.RegisterFile("graphql.proto", fileDescriptor_3ce0fc368bdc1a51) } - -var fileDescriptor_3ce0fc368bdc1a51 = []byte{ - // 448 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xdb, 0x6b, 0xd4, 0x40, - 0x14, 0xc6, 0x4d, 0xbb, 0x97, 0xe4, 0xf4, 0x62, 0x19, 0x6a, 0x0d, 0x05, 0x35, 0xe4, 0x41, 0x82, - 0xd0, 0x84, 0xb6, 0x3e, 0x2d, 0x3e, 0x78, 0x41, 0x45, 0xa4, 0x2e, 0x4e, 0xb7, 0xa0, 0xbe, 0x65, - 0xb3, 0x67, 0x93, 0x60, 0x76, 0x67, 0x3a, 0x33, 0x51, 0xf6, 0x1f, 0xd3, 0x7f, 0x4f, 0x76, 0x66, - 0x12, 0x4a, 0x52, 0x7c, 0xcb, 0x97, 0xf9, 0xce, 0x6f, 0xbe, 0x73, 0xe6, 0xc0, 0x41, 0x2e, 0x52, - 0x5e, 0xdc, 0x56, 0x31, 0x17, 0x4c, 0x31, 0x32, 0xb6, 0xf2, 0x34, 0xc8, 0x19, 0xcb, 0x2b, 0x4c, - 0xf4, 0xef, 0x79, 0xbd, 0x4c, 0x16, 0x28, 0x33, 0x51, 0x72, 0xc5, 0x84, 0xb1, 0x86, 0xaf, 0xe1, - 0xf0, 0xa3, 0x31, 0x5f, 0xa3, 0xf8, 0x55, 0x66, 0x48, 0x08, 0x0c, 0x0a, 0x26, 0x95, 0xef, 0x04, - 0x4e, 0xe4, 0x51, 0xfd, 0x4d, 0x4e, 0xc1, 0x2d, 0xd7, 0x12, 0xb3, 0x5a, 0xa0, 0xbf, 0x13, 0x38, - 0x91, 0x4b, 0x5b, 0x1d, 0xfe, 0x71, 0xe0, 0xa0, 0x41, 0x64, 0x05, 0xae, 0x52, 0x12, 0xc1, 0x40, - 0x6d, 0x38, 0x6a, 0xc2, 0xe1, 0xc5, 0x71, 0xdc, 0x84, 0xb3, 0xae, 0xd9, 0x86, 0x23, 0xd5, 0x8e, - 0xed, 0x5d, 0xeb, 0x74, 0x65, 0x98, 0x1e, 0xd5, 0xdf, 0xe4, 0x1c, 0xc6, 0x02, 0x6f, 0x6b, 0x94, - 0xca, 0xdf, 0x0d, 0x9c, 0x68, 0xef, 0xe2, 0x71, 0x17, 0x40, 0xcd, 0x31, 0x6d, 0x7c, 0xe4, 0x25, - 0xb8, 0x02, 0x25, 0x67, 0x6b, 0x89, 0xfe, 0x40, 0xd7, 0xf8, 0xfd, 0x1a, 0x73, 0x4e, 0x5b, 0x67, - 0xf8, 0xaa, 0x6d, 0xdd, 0x02, 0xdb, 0x38, 0xce, 0x9d, 0x38, 0x27, 0x30, 0xe2, 0x55, 0x9d, 0xfd, - 0x94, 0xfe, 0x4e, 0xb0, 0x1b, 0x79, 0xd4, 0xaa, 0xf0, 0x1d, 0x3c, 0xec, 0xa0, 0xb7, 0x53, 0xda, - 0x26, 0x2a, 0x05, 0x2e, 0x34, 0xc2, 0xa5, 0xad, 0x26, 0xc7, 0x30, 0xd4, 0x85, 0xb6, 0x55, 0x23, - 0xc2, 0x6f, 0xb0, 0x6f, 0x21, 0x1f, 0x4a, 0xac, 0x16, 0xff, 0x25, 0xdc, 0x37, 0x2b, 0x1f, 0xc6, - 0x0b, 0x5c, 0xa6, 0x75, 0x65, 0x66, 0xe5, 0xd1, 0x46, 0xbe, 0x78, 0x0e, 0x7b, 0x77, 0xc6, 0x4d, - 0x3c, 0x18, 0x7e, 0xbd, 0x79, 0x4f, 0xbf, 0x1f, 0x3d, 0x20, 0xfb, 0xe0, 0x5e, 0xdd, 0xcc, 0xde, - 0xcc, 0x3e, 0x4d, 0xbf, 0x1c, 0x39, 0x93, 0x6b, 0x18, 0x4b, 0xfb, 0xf0, 0xcf, 0x62, 0xb3, 0x2d, - 0x71, 0xb3, 0x2d, 0xb1, 0x5d, 0x89, 0x29, 0x57, 0x25, 0x5b, 0x4b, 0xff, 0xaf, 0x7b, 0xff, 0x7b, - 0x58, 0x1b, 0x6d, 0x48, 0x93, 0xcf, 0x30, 0x5c, 0xea, 0x7e, 0x9e, 0xf4, 0x90, 0xba, 0xcf, 0x0e, - 0xf0, 0x51, 0x17, 0xa8, 0x4d, 0xd4, 0x30, 0x26, 0x53, 0x18, 0x49, 0xb3, 0x57, 0x4f, 0x7b, 0xb4, - 0x2b, 0x54, 0x05, 0xeb, 0xe2, 0x4e, 0x7a, 0xf9, 0x74, 0x39, 0xb5, 0x98, 0xb7, 0x97, 0x3f, 0xce, - 0xf3, 0x52, 0x15, 0xf5, 0x3c, 0xce, 0xd8, 0x2a, 0xd9, 0xc8, 0x3a, 0x2f, 0x57, 0x4c, 0xb1, 0x24, - 0x17, 0x3c, 0x3b, 0xb3, 0xa5, 0x67, 0x79, 0xaa, 0xf0, 0x77, 0xba, 0x49, 0xac, 0x9e, 0x8f, 0xf4, - 0x9d, 0x97, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x27, 0x87, 0xcd, 0x9b, 0x6a, 0x03, 0x00, 0x00, +var file_graphql_proto_extTypes = []protoimpl.ExtensionInfo{ + { + ExtendedType: (*descriptor.ServiceOptions)(nil), + ExtensionType: (*GraphqlService)(nil), + Field: 1079, + Name: "graphql.service", + Tag: "bytes,1079,opt,name=service", + Filename: "graphql.proto", + }, + { + ExtendedType: (*descriptor.FieldOptions)(nil), + ExtensionType: (*GraphqlField)(nil), + Field: 1079, + Name: "graphql.field", + Tag: "bytes,1079,opt,name=field", + Filename: "graphql.proto", + }, + { + ExtendedType: (*descriptor.MethodOptions)(nil), + ExtensionType: (*GraphqlSchema)(nil), + Field: 1079, + Name: "graphql.schema", + Tag: "bytes,1079,opt,name=schema", + Filename: "graphql.proto", + }, +} + +// Extension fields to descriptor.ServiceOptions. +var ( + // optional graphql.GraphqlService service = 1079; + E_Service = &file_graphql_proto_extTypes[0] +) + +// Extension fields to descriptor.FieldOptions. +var ( + // optional graphql.GraphqlField field = 1079; + E_Field = &file_graphql_proto_extTypes[1] +) + +// Extension fields to descriptor.MethodOptions. +var ( + // optional graphql.GraphqlSchema schema = 1079; + E_Schema = &file_graphql_proto_extTypes[2] +) + +var File_graphql_proto protoreflect.FileDescriptor + +var file_graphql_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x07, 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, 0x40, 0x0a, 0x0e, 0x47, 0x72, + 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x22, 0xb6, 0x01, 0x0a, + 0x0d, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x28, + 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x67, + 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x31, 0x0a, 0x07, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x34, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x47, 0x72, 0x61, 0x70, + 0x68, 0x71, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x0a, 0x0e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, + 0x6c, 0x75, 0x63, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, + 0x63, 0x6b, 0x73, 0x22, 0x43, 0x0a, 0x0f, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 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, 0x14, 0x0a, 0x05, 0x70, 0x6c, 0x75, 0x63, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x70, 0x6c, 0x75, 0x63, 0x6b, 0x22, 0x58, 0x0a, 0x0c, 0x47, 0x72, 0x61, 0x70, + 0x68, 0x71, 0x6c, 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, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x66, 0x61, 0x75, + 0x6c, 0x74, 0x2a, 0x26, 0x0a, 0x0b, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x09, 0x0a, 0x05, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, + 0x4d, 0x55, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x3a, 0x53, 0x0a, 0x07, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 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, 0xb7, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x3a, + 0x4b, 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, 0xb7, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x4f, 0x0a, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 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, 0xb7, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x67, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x71, 0x6c, 0x53, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x42, 0x33, 0x5a, + 0x31, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x73, 0x75, 0x67, + 0x69, 0x6d, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2d, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x71, 0x6c, 0x2d, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x2f, 0x67, 0x72, 0x61, 0x70, 0x68, + 0x71, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_graphql_proto_rawDescOnce sync.Once + file_graphql_proto_rawDescData = file_graphql_proto_rawDesc +) + +func file_graphql_proto_rawDescGZIP() []byte { + file_graphql_proto_rawDescOnce.Do(func() { + file_graphql_proto_rawDescData = protoimpl.X.CompressGZIP(file_graphql_proto_rawDescData) + }) + return file_graphql_proto_rawDescData +} + +var file_graphql_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_graphql_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_graphql_proto_goTypes = []interface{}{ + (GraphqlType)(0), // 0: graphql.GraphqlType + (*GraphqlService)(nil), // 1: graphql.GraphqlService + (*GraphqlSchema)(nil), // 2: graphql.GraphqlSchema + (*GraphqlRequest)(nil), // 3: graphql.GraphqlRequest + (*GraphqlResponse)(nil), // 4: graphql.GraphqlResponse + (*GraphqlField)(nil), // 5: graphql.GraphqlField + (*descriptor.ServiceOptions)(nil), // 6: google.protobuf.ServiceOptions + (*descriptor.FieldOptions)(nil), // 7: google.protobuf.FieldOptions + (*descriptor.MethodOptions)(nil), // 8: google.protobuf.MethodOptions +} +var file_graphql_proto_depIdxs = []int32{ + 0, // 0: graphql.GraphqlSchema.type:type_name -> graphql.GraphqlType + 3, // 1: graphql.GraphqlSchema.request:type_name -> graphql.GraphqlRequest + 4, // 2: graphql.GraphqlSchema.response:type_name -> graphql.GraphqlResponse + 6, // 3: graphql.service:extendee -> google.protobuf.ServiceOptions + 7, // 4: graphql.field:extendee -> google.protobuf.FieldOptions + 8, // 5: graphql.schema:extendee -> google.protobuf.MethodOptions + 1, // 6: graphql.service:type_name -> graphql.GraphqlService + 5, // 7: graphql.field:type_name -> graphql.GraphqlField + 2, // 8: graphql.schema:type_name -> graphql.GraphqlSchema + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 6, // [6:9] is the sub-list for extension type_name + 3, // [3:6] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_graphql_proto_init() } +func file_graphql_proto_init() { + if File_graphql_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_graphql_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GraphqlService); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_graphql_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GraphqlSchema); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_graphql_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GraphqlRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_graphql_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GraphqlResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_graphql_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GraphqlField); 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_graphql_proto_rawDesc, + NumEnums: 1, + NumMessages: 5, + NumExtensions: 3, + NumServices: 0, + }, + GoTypes: file_graphql_proto_goTypes, + DependencyIndexes: file_graphql_proto_depIdxs, + EnumInfos: file_graphql_proto_enumTypes, + MessageInfos: file_graphql_proto_msgTypes, + ExtensionInfos: file_graphql_proto_extTypes, + }.Build() + File_graphql_proto = out.File + file_graphql_proto_rawDesc = nil + file_graphql_proto_goTypes = nil + file_graphql_proto_depIdxs = nil } diff --git a/protoc-gen-graphql/spec/field.go b/protoc-gen-graphql/spec/field.go index cf0b3b8..98b9681 100644 --- a/protoc-gen-graphql/spec/field.go +++ b/protoc-gen-graphql/spec/field.go @@ -188,7 +188,7 @@ func (f *Field) GraphqlType() string { func (f *Field) GraphqlGoType(rootPackage string, isInput bool) string { switch f.Type() { case descriptor.FieldDescriptorProto_TYPE_BOOL: - return "graphql.Bool" + return "graphql.Boolean" case descriptor.FieldDescriptorProto_TYPE_DOUBLE, descriptor.FieldDescriptorProto_TYPE_FLOAT: return "graphql.Float"