Documentation ¶
Index ¶
- 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_ListEmptyRequest() *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_ListEmptyRequest() *graphql.Object
- func Gql__type_ListHumansResponse() *graphql.Object
- func RegisterStartwarsServiceGraphql(mux *runtime.ServeMux, host string, opts ...grpc.DialOption) error
- func RegisterStartwarsServiceGraphqlHandler(mux *runtime.ServeMux, conn *grpc.ClientConn, host string, ...) error
- func RegisterStartwarsServiceServer(s grpc.ServiceRegistrar, 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)
- type UnsafeStartwarsServiceServer
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
var StartwarsService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "startwars.StartwarsService", HandlerType: (*StartwarsServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetHero", Handler: _StartwarsService_GetHero_Handler, }, { MethodName: "GetHuman", Handler: _StartwarsService_GetHuman_Handler, }, { MethodName: "GetDroid", Handler: _StartwarsService_GetDroid_Handler, }, { MethodName: "ListHumans", Handler: _StartwarsService_ListHumans_Handler, }, { MethodName: "ListDroids", Handler: _StartwarsService_ListDroids_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "starwars/starwars.proto", }
StartwarsService_ServiceDesc is the grpc.ServiceDesc for StartwarsService 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_ListEmptyRequest ¶ added in v0.2.0
func Gql__input_ListEmptyRequest() *graphql.InputObject
func Gql__input_ListHumansResponse ¶
func Gql__input_ListHumansResponse() *graphql.InputObject
func Gql__type_Character ¶
func Gql__type_ListEmptyRequest ¶ added in v0.2.0
func RegisterStartwarsServiceGraphql ¶
func RegisterStartwarsServiceGraphql(mux *runtime.ServeMux, host string, opts ...grpc.DialOption) error
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, host string, opts ...grpc.DialOption) 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 manually when application will terminate.
func RegisterStartwarsServiceServer ¶
func RegisterStartwarsServiceServer(s grpc.ServiceRegistrar, 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=appearances,proto3,enum=startwars.Episode" json:"appears_in,omitempty"` HomePlanet string `protobuf:"bytes,5,opt,name=home_planet,json=home,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,json=droidID,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,json=humanID,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://pkg.go.dev/google.golang.org/grpc/?tab=doc#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) // contains filtered or unexported methods }
StartwarsServiceServer is the server API for StartwarsService service. All implementations must embed UnimplementedStartwarsServiceServer 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 UnimplementedStartwarsServiceServer ¶
type UnimplementedStartwarsServiceServer struct { }
UnimplementedStartwarsServiceServer must 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)
type UnsafeStartwarsServiceServer ¶
type UnsafeStartwarsServiceServer interface {
// contains filtered or unexported methods
}
UnsafeStartwarsServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StartwarsServiceServer will result in compilation errors.