Documentation ¶
Overview ¶
Code generated by protoc-gen-graphql, DO NOT EDIT.
Index ¶
- Constants
- Variables
- func Gql__enum_Episode() *graphql.Enum
- func Gql__enum_Type() *graphql.Enum
- func Gql__input_Character() *graphql.InputObject
- func Gql__input_GetDroidRequest() *graphql.InputObject
- func Gql__input_GetHeroRequest() *graphql.InputObject
- func Gql__input_GetHumanRequest() *graphql.InputObject
- func Gql__input_ListDroidsResponse() *graphql.InputObject
- func Gql__input_ListHumansResponse() *graphql.InputObject
- func Gql__interface_Character() *graphql.Interface
- func Gql__type_Character() *graphql.Object
- func Gql__type_GetDroidRequest() *graphql.Object
- func Gql__type_GetHeroRequest() *graphql.Object
- func Gql__type_GetHumanRequest() *graphql.Object
- func Gql__type_ListDroidsResponse() *graphql.Object
- func Gql__type_ListHumansResponse() *graphql.Object
- func RegisterStarwarsServiceGraphql(mux *runtime.ServeMux) error
- func RegisterStarwarsServiceGraphqlHandler(mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterStarwarsServiceServer(s grpc.ServiceRegistrar, srv StarwarsServiceServer)
- type Character
- func (*Character) Descriptor() ([]byte, []int)deprecated
- func (x *Character) GetAppearsIn() []Episode
- func (x *Character) GetFriends() []*Character
- func (x *Character) GetHomePlanet() string
- func (x *Character) GetId() int64
- func (x *Character) GetName() string
- func (x *Character) GetPrimaryFunction() string
- func (x *Character) GetType() Type
- func (*Character) ProtoMessage()
- func (x *Character) ProtoReflect() protoreflect.Message
- func (x *Character) Reset()
- func (x *Character) String() string
- type Episode
- type GetDroidRequest
- type GetHeroRequest
- type GetHumanRequest
- type ListDroidsResponse
- func (*ListDroidsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListDroidsResponse) GetDroids() []*Character
- func (*ListDroidsResponse) ProtoMessage()
- func (x *ListDroidsResponse) ProtoReflect() protoreflect.Message
- func (x *ListDroidsResponse) Reset()
- func (x *ListDroidsResponse) String() string
- type ListEmptyRequest
- type ListHumansResponse
- func (*ListHumansResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListHumansResponse) GetHumans() []*Character
- func (*ListHumansResponse) ProtoMessage()
- func (x *ListHumansResponse) ProtoReflect() protoreflect.Message
- func (x *ListHumansResponse) Reset()
- func (x *ListHumansResponse) String() string
- type StarwarsServiceClient
- type StarwarsServiceServer
- type Type
- type UnimplementedStarwarsServiceServer
- func (UnimplementedStarwarsServiceServer) GetDroid(context.Context, *GetDroidRequest) (*Character, error)
- func (UnimplementedStarwarsServiceServer) GetHero(context.Context, *GetHeroRequest) (*Character, error)
- func (UnimplementedStarwarsServiceServer) GetHuman(context.Context, *GetHumanRequest) (*Character, error)
- func (UnimplementedStarwarsServiceServer) ListDroids(context.Context, *ListEmptyRequest) (*ListDroidsResponse, error)
- func (UnimplementedStarwarsServiceServer) ListHumans(context.Context, *ListEmptyRequest) (*ListHumansResponse, error)
- type UnsafeStarwarsServiceServer
Constants ¶
const ( StarwarsService_GetHero_FullMethodName = "/starwars.StarwarsService/GetHero" StarwarsService_GetHuman_FullMethodName = "/starwars.StarwarsService/GetHuman" StarwarsService_GetDroid_FullMethodName = "/starwars.StarwarsService/GetDroid" StarwarsService_ListHumans_FullMethodName = "/starwars.StarwarsService/ListHumans" StarwarsService_ListDroids_FullMethodName = "/starwars.StarwarsService/ListDroids" )
Variables ¶
var ( Type_name = map[int32]string{ 0: "HUMAN", 1: "DROID", } Type_value = map[string]int32{ "HUMAN": 0, "DROID": 1, } )
Enum value maps for Type.
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, } )
Enum value maps for Episode.
var File_starwars_starwars_proto protoreflect.FileDescriptor
var StarwarsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "starwars.StarwarsService", HandlerType: (*StarwarsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetHero", Handler: _StarwarsService_GetHero_Handler, }, { MethodName: "GetHuman", Handler: _StarwarsService_GetHuman_Handler, }, { MethodName: "GetDroid", Handler: _StarwarsService_GetDroid_Handler, }, { MethodName: "ListHumans", Handler: _StarwarsService_ListHumans_Handler, }, { MethodName: "ListDroids", Handler: _StarwarsService_ListDroids_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "starwars/starwars.proto", }
StarwarsService_ServiceDesc is the grpc.ServiceDesc for StarwarsService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func Gql__enum_Episode ¶
func Gql__enum_Type ¶
func Gql__input_Character ¶
func Gql__input_Character() *graphql.InputObject
func Gql__input_GetDroidRequest ¶
func Gql__input_GetDroidRequest() *graphql.InputObject
func Gql__input_GetHeroRequest ¶
func Gql__input_GetHeroRequest() *graphql.InputObject
func Gql__input_GetHumanRequest ¶
func Gql__input_GetHumanRequest() *graphql.InputObject
func Gql__input_ListDroidsResponse ¶
func Gql__input_ListDroidsResponse() *graphql.InputObject
func Gql__input_ListHumansResponse ¶
func Gql__input_ListHumansResponse() *graphql.InputObject
func Gql__type_Character ¶
func RegisterStarwarsServiceGraphql ¶
Register package divided graphql handler "without" *grpc.ClientConn, therefore gRPC connection will be opened and closed automatically. Occasionally you may worry about open/close performance for each handling graphql request, then you can call RegisterStarwarsServiceGraphqlHandler with *grpc.ClientConn manually.
func RegisterStarwarsServiceGraphqlHandler ¶
func RegisterStarwarsServiceGraphqlHandler(mux *runtime.ServeMux, conn *grpc.ClientConn) error
Register package divided graphql handler "with" *grpc.ClientConn. this function accepts your defined grpc connection, so that we reuse that and never close connection inside. You need to close it maunally when application will terminate. Otherwise, you can specify automatic opening connection with ServiceOption directive:
service StarwarsService { option (graphql.service) = { host: "host:port" insecure: true or false }; ...with RPC definitions }
func RegisterStarwarsServiceServer ¶
func RegisterStarwarsServiceServer(s grpc.ServiceRegistrar, srv StarwarsServiceServer)
Types ¶
type Character ¶
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=starwars.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=starwars.Type" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Character) Descriptor
deprecated
func (*Character) GetAppearsIn ¶
func (*Character) GetFriends ¶
func (*Character) GetHomePlanet ¶
func (*Character) GetPrimaryFunction ¶
func (*Character) ProtoMessage ¶
func (*Character) ProtoMessage()
func (*Character) ProtoReflect ¶
func (x *Character) ProtoReflect() protoreflect.Message
type Episode ¶
type Episode int32
func (Episode) Descriptor ¶
func (Episode) Descriptor() protoreflect.EnumDescriptor
func (Episode) EnumDescriptor
deprecated
func (Episode) Number ¶
func (x Episode) Number() protoreflect.EnumNumber
func (Episode) Type ¶
func (Episode) Type() protoreflect.EnumType
type GetDroidRequest ¶
type GetDroidRequest struct { // id of the droid Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetDroidRequest) Descriptor
deprecated
func (*GetDroidRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetDroidRequest.ProtoReflect.Descriptor instead.
func (*GetDroidRequest) GetId ¶
func (x *GetDroidRequest) GetId() int64
func (*GetDroidRequest) ProtoMessage ¶
func (*GetDroidRequest) ProtoMessage()
func (*GetDroidRequest) ProtoReflect ¶
func (x *GetDroidRequest) ProtoReflect() protoreflect.Message
func (*GetDroidRequest) Reset ¶
func (x *GetDroidRequest) Reset()
func (*GetDroidRequest) String ¶
func (x *GetDroidRequest) String() string
type GetHeroRequest ¶
type GetHeroRequest struct { // 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=starwars.Episode" json:"episode,omitempty"` // contains filtered or unexported fields }
func (*GetHeroRequest) Descriptor
deprecated
func (*GetHeroRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetHeroRequest.ProtoReflect.Descriptor instead.
func (*GetHeroRequest) GetEpisode ¶
func (x *GetHeroRequest) GetEpisode() Episode
func (*GetHeroRequest) ProtoMessage ¶
func (*GetHeroRequest) ProtoMessage()
func (*GetHeroRequest) ProtoReflect ¶
func (x *GetHeroRequest) ProtoReflect() protoreflect.Message
func (*GetHeroRequest) Reset ¶
func (x *GetHeroRequest) Reset()
func (*GetHeroRequest) String ¶
func (x *GetHeroRequest) String() string
type GetHumanRequest ¶
type GetHumanRequest struct { // id of the human Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*GetHumanRequest) Descriptor
deprecated
func (*GetHumanRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetHumanRequest.ProtoReflect.Descriptor instead.
func (*GetHumanRequest) GetId ¶
func (x *GetHumanRequest) GetId() int64
func (*GetHumanRequest) ProtoMessage ¶
func (*GetHumanRequest) ProtoMessage()
func (*GetHumanRequest) ProtoReflect ¶
func (x *GetHumanRequest) ProtoReflect() protoreflect.Message
func (*GetHumanRequest) Reset ¶
func (x *GetHumanRequest) Reset()
func (*GetHumanRequest) String ¶
func (x *GetHumanRequest) String() string
type ListDroidsResponse ¶
type ListDroidsResponse struct { Droids []*Character `protobuf:"bytes,1,rep,name=droids,proto3" json:"droids,omitempty"` // contains filtered or unexported fields }
func (*ListDroidsResponse) Descriptor
deprecated
func (*ListDroidsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListDroidsResponse.ProtoReflect.Descriptor instead.
func (*ListDroidsResponse) GetDroids ¶
func (x *ListDroidsResponse) GetDroids() []*Character
func (*ListDroidsResponse) ProtoMessage ¶
func (*ListDroidsResponse) ProtoMessage()
func (*ListDroidsResponse) ProtoReflect ¶
func (x *ListDroidsResponse) ProtoReflect() protoreflect.Message
func (*ListDroidsResponse) Reset ¶
func (x *ListDroidsResponse) Reset()
func (*ListDroidsResponse) String ¶
func (x *ListDroidsResponse) String() string
type ListEmptyRequest ¶
type ListEmptyRequest struct {
// contains filtered or unexported fields
}
func (*ListEmptyRequest) Descriptor
deprecated
func (*ListEmptyRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListEmptyRequest.ProtoReflect.Descriptor instead.
func (*ListEmptyRequest) ProtoMessage ¶
func (*ListEmptyRequest) ProtoMessage()
func (*ListEmptyRequest) ProtoReflect ¶
func (x *ListEmptyRequest) ProtoReflect() protoreflect.Message
func (*ListEmptyRequest) Reset ¶
func (x *ListEmptyRequest) Reset()
func (*ListEmptyRequest) String ¶
func (x *ListEmptyRequest) String() string
type ListHumansResponse ¶
type ListHumansResponse struct { Humans []*Character `protobuf:"bytes,1,rep,name=humans,proto3" json:"humans,omitempty"` // contains filtered or unexported fields }
func (*ListHumansResponse) Descriptor
deprecated
func (*ListHumansResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListHumansResponse.ProtoReflect.Descriptor instead.
func (*ListHumansResponse) GetHumans ¶
func (x *ListHumansResponse) GetHumans() []*Character
func (*ListHumansResponse) ProtoMessage ¶
func (*ListHumansResponse) ProtoMessage()
func (*ListHumansResponse) ProtoReflect ¶
func (x *ListHumansResponse) ProtoReflect() protoreflect.Message
func (*ListHumansResponse) Reset ¶
func (x *ListHumansResponse) Reset()
func (*ListHumansResponse) String ¶
func (x *ListHumansResponse) String() string
type StarwarsServiceClient ¶
type StarwarsServiceClient interface { GetHero(ctx context.Context, in *GetHeroRequest, opts ...grpc.CallOption) (*Character, error) GetHuman(ctx context.Context, in *GetHumanRequest, opts ...grpc.CallOption) (*Character, error) GetDroid(ctx context.Context, in *GetDroidRequest, opts ...grpc.CallOption) (*Character, error) ListHumans(ctx context.Context, in *ListEmptyRequest, opts ...grpc.CallOption) (*ListHumansResponse, error) ListDroids(ctx context.Context, in *ListEmptyRequest, opts ...grpc.CallOption) (*ListDroidsResponse, error) }
StarwarsServiceClient is the client API for StarwarsService 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.
func NewStarwarsServiceClient ¶
func NewStarwarsServiceClient(cc grpc.ClientConnInterface) StarwarsServiceClient
type StarwarsServiceServer ¶
type StarwarsServiceServer interface { GetHero(context.Context, *GetHeroRequest) (*Character, error) GetHuman(context.Context, *GetHumanRequest) (*Character, error) GetDroid(context.Context, *GetDroidRequest) (*Character, error) ListHumans(context.Context, *ListEmptyRequest) (*ListHumansResponse, error) ListDroids(context.Context, *ListEmptyRequest) (*ListDroidsResponse, error) // contains filtered or unexported methods }
StarwarsServiceServer is the server API for StarwarsService service. All implementations must embed UnimplementedStarwarsServiceServer for forward compatibility
type Type ¶
type Type int32
func (Type) Descriptor ¶
func (Type) Descriptor() protoreflect.EnumDescriptor
func (Type) EnumDescriptor
deprecated
func (Type) Number ¶
func (x Type) Number() protoreflect.EnumNumber
func (Type) Type ¶
func (Type) Type() protoreflect.EnumType
type UnimplementedStarwarsServiceServer ¶
type UnimplementedStarwarsServiceServer struct { }
UnimplementedStarwarsServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedStarwarsServiceServer) GetDroid ¶
func (UnimplementedStarwarsServiceServer) GetDroid(context.Context, *GetDroidRequest) (*Character, error)
func (UnimplementedStarwarsServiceServer) GetHero ¶
func (UnimplementedStarwarsServiceServer) GetHero(context.Context, *GetHeroRequest) (*Character, error)
func (UnimplementedStarwarsServiceServer) GetHuman ¶
func (UnimplementedStarwarsServiceServer) GetHuman(context.Context, *GetHumanRequest) (*Character, error)
func (UnimplementedStarwarsServiceServer) ListDroids ¶
func (UnimplementedStarwarsServiceServer) ListDroids(context.Context, *ListEmptyRequest) (*ListDroidsResponse, error)
func (UnimplementedStarwarsServiceServer) ListHumans ¶
func (UnimplementedStarwarsServiceServer) ListHumans(context.Context, *ListEmptyRequest) (*ListHumansResponse, error)
type UnsafeStarwarsServiceServer ¶
type UnsafeStarwarsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeStarwarsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StarwarsServiceServer will result in compilation errors.