starwars

package
v0.18.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Code generated by proroc-gen-graphql, DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	Type_name = map[int32]string{
		0: "HUMAN",
		1: "DROID",
	}
	Type_value = map[string]int32{
		"HUMAN": 0,
		"DROID": 1,
	}
)

Enum value maps for Type.

View Source
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.

View Source
var File_starwars_starwars_proto protoreflect.FileDescriptor

Functions

func Gql__enum_Episode

func Gql__enum_Episode() *graphql.Enum

func Gql__enum_Type

func Gql__enum_Type() *graphql.Enum

func Gql__interface_Character

func Gql__interface_Character() *graphql.Interface

func Gql__type_Character

func Gql__type_Character() *graphql.Object

func Gql__type_GetDroidRequest

func Gql__type_GetDroidRequest() *graphql.Object

func Gql__type_GetHeroRequest

func Gql__type_GetHeroRequest() *graphql.Object

func Gql__type_GetHumanRequest

func Gql__type_GetHumanRequest() *graphql.Object

func Gql__type_ListDroidsResponse

func Gql__type_ListDroidsResponse() *graphql.Object

func Gql__type_ListHumansResponse

func Gql__type_ListHumansResponse() *graphql.Object

func RegisterStartwarsServiceGraphql

func RegisterStartwarsServiceGraphql(mux *runtime.ServeMux) 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) 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) Descriptor() ([]byte, []int)

Deprecated: Use Character.ProtoReflect.Descriptor instead.

func (*Character) GetAppearsIn

func (x *Character) GetAppearsIn() []Episode

func (*Character) GetFriends

func (x *Character) GetFriends() []*Character

func (*Character) GetHomePlanet

func (x *Character) GetHomePlanet() string

func (*Character) GetId

func (x *Character) GetId() int64

func (*Character) GetName

func (x *Character) GetName() string

func (*Character) GetPrimaryFunction

func (x *Character) GetPrimaryFunction() string

func (*Character) GetType

func (x *Character) GetType() Type

func (*Character) ProtoMessage

func (*Character) ProtoMessage()

func (*Character) ProtoReflect

func (x *Character) ProtoReflect() protoreflect.Message

func (*Character) Reset

func (x *Character) Reset()

func (*Character) String

func (x *Character) String() string

type Episode

type Episode int32
const (
	Episode__       Episode = 0
	Episode_NEWHOPE Episode = 1
	Episode_EMPIRE  Episode = 2
	Episode_JEDI    Episode = 3
)

func (Episode) Descriptor

func (Episode) Descriptor() protoreflect.EnumDescriptor

func (Episode) Enum

func (x Episode) Enum() *Episode

func (Episode) EnumDescriptor deprecated

func (Episode) EnumDescriptor() ([]byte, []int)

Deprecated: Use Episode.Descriptor instead.

func (Episode) Number

func (x Episode) Number() protoreflect.EnumNumber

func (Episode) String

func (x Episode) String() string

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.

type StartwarsServiceServer

StartwarsServiceServer is the server API for StartwarsService service.

type Type

type Type int32
const (
	Type_HUMAN Type = 0
	Type_DROID Type = 1
)

func (Type) Descriptor

func (Type) Descriptor() protoreflect.EnumDescriptor

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor deprecated

func (Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Type.Descriptor instead.

func (Type) Number

func (x Type) Number() protoreflect.EnumNumber

func (Type) String

func (x Type) String() string

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) GetHero

func (*UnimplementedStartwarsServiceServer) GetHuman

func (*UnimplementedStartwarsServiceServer) ListDroids

func (*UnimplementedStartwarsServiceServer) ListHumans

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL