Documentation ¶
Overview ¶
Code generated by proroc-gen-graphql, DO NOT EDIT.
Index ¶
- Variables
- func Gql__enum_Episode() *graphql.Enum
- func Gql__enum_Type() *graphql.Enum
- 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 RegisterStartwarsServiceGraphql(mux *runtime.ServeMux) error
- func RegisterStartwarsServiceGraphqlHandler(mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterStartwarsServiceServer(s *grpc.Server, srv StartwarsServiceServer)
- 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 StartwarsServiceClient
- type StartwarsServiceServer
- type Type
- type UnimplementedStartwarsServiceServer
- func (*UnimplementedStartwarsServiceServer) GetDroid(context.Context, *GetDroidRequest) (*Character, error)
- func (*UnimplementedStartwarsServiceServer) GetHero(context.Context, *GetHeroRequest) (*Character, error)
- func (*UnimplementedStartwarsServiceServer) GetHuman(context.Context, *GetHumanRequest) (*Character, error)
- func (*UnimplementedStartwarsServiceServer) ListDroids(context.Context, *ListEmptyRequest) (*ListDroidsResponse, error)
- func (*UnimplementedStartwarsServiceServer) ListHumans(context.Context, *ListEmptyRequest) (*ListHumansResponse, error)
Constants ¶
This section is empty.
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
Functions ¶
func Gql__enum_Episode ¶
func Gql__enum_Type ¶
func Gql__type_Character ¶
func RegisterStartwarsServiceGraphql ¶
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 RegisterStartwarsServiceGraphqlHandler with *grpc.ClientConn manually.
func RegisterStartwarsServiceGraphqlHandler ¶
func RegisterStartwarsServiceGraphqlHandler(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 StartwarsService { option (graphql.service) = { host: "host:port" insecure: true or false }; ...with RPC definitions }
func RegisterStartwarsServiceServer ¶
func RegisterStartwarsServiceServer(s *grpc.Server, srv StartwarsServiceServer)
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=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"` // 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=startwars.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 StartwarsServiceClient ¶
type StartwarsServiceClient 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) }
StartwarsServiceClient is the client API for StartwarsService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewStartwarsServiceClient ¶
func NewStartwarsServiceClient(cc grpc.ClientConnInterface) StartwarsServiceClient
type StartwarsServiceServer ¶
type StartwarsServiceServer 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) }
StartwarsServiceServer is the server API for StartwarsService service.
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 UnimplementedStartwarsServiceServer ¶
type UnimplementedStartwarsServiceServer struct { }
UnimplementedStartwarsServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedStartwarsServiceServer) GetDroid ¶
func (*UnimplementedStartwarsServiceServer) GetDroid(context.Context, *GetDroidRequest) (*Character, error)
func (*UnimplementedStartwarsServiceServer) GetHero ¶
func (*UnimplementedStartwarsServiceServer) GetHero(context.Context, *GetHeroRequest) (*Character, error)
func (*UnimplementedStartwarsServiceServer) GetHuman ¶
func (*UnimplementedStartwarsServiceServer) GetHuman(context.Context, *GetHumanRequest) (*Character, error)
func (*UnimplementedStartwarsServiceServer) ListDroids ¶
func (*UnimplementedStartwarsServiceServer) ListDroids(context.Context, *ListEmptyRequest) (*ListDroidsResponse, error)
func (*UnimplementedStartwarsServiceServer) ListHumans ¶
func (*UnimplementedStartwarsServiceServer) ListHumans(context.Context, *ListEmptyRequest) (*ListHumansResponse, error)