Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterGamesServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGamesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GamesServiceClient) error
- func RegisterGamesServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGamesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GamesServiceServer) error
- func RegisterGamesServiceServer(s grpc.ServiceRegistrar, srv GamesServiceServer)
- type Game
- func (*Game) Descriptor() ([]byte, []int)deprecated
- func (x *Game) GetAuthor() string
- func (x *Game) GetCategory() string
- func (x *Game) GetDescription() string
- func (x *Game) GetDuration() float64
- func (x *Game) GetId() string
- func (x *Game) GetImages() []*Images
- func (x *Game) GetIsDownloadable() bool
- func (x *Game) GetIsStreamable() bool
- func (x *Game) GetReplayBundleUrlJson() string
- func (x *Game) GetSubtitle() string
- func (x *Game) GetTags() []string
- func (x *Game) GetTitle() string
- func (x *Game) GetType() int32
- func (x *Game) GetVersion() string
- func (*Game) ProtoMessage()
- func (x *Game) ProtoReflect() protoreflect.Message
- func (x *Game) Reset()
- func (x *Game) String() string
- func (m *Game) Validate() error
- type GameValidationError
- type Games
- type GamesServiceClient
- type GamesServiceServer
- type GamesValidationError
- type ID
- type IDValidationError
- type Images
- func (*Images) Descriptor() ([]byte, []int)deprecated
- func (x *Images) GetId() string
- func (x *Images) GetType() int32
- func (x *Images) GetUrl() string
- func (*Images) ProtoMessage()
- func (x *Images) ProtoReflect() protoreflect.Message
- func (x *Images) Reset()
- func (x *Images) String() string
- func (m *Images) Validate() error
- type ImagesValidationError
- type StreamGames
- func (*StreamGames) Descriptor() ([]byte, []int)deprecated
- func (x *StreamGames) GetListings() *Game
- func (*StreamGames) ProtoMessage()
- func (x *StreamGames) ProtoReflect() protoreflect.Message
- func (x *StreamGames) Reset()
- func (x *StreamGames) String() string
- func (m *StreamGames) Validate() error
- type StreamGamesValidationError
- func (e StreamGamesValidationError) Cause() error
- func (e StreamGamesValidationError) Error() string
- func (e StreamGamesValidationError) ErrorName() string
- func (e StreamGamesValidationError) Field() string
- func (e StreamGamesValidationError) Key() bool
- func (e StreamGamesValidationError) Reason() string
- type UnimplementedGamesServiceServer
- type UnsafeGamesServiceServer
- type UpdateReq
- func (*UpdateReq) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateReq) GetGame() *Game
- func (x *UpdateReq) GetId() string
- func (*UpdateReq) ProtoMessage()
- func (x *UpdateReq) ProtoReflect() protoreflect.Message
- func (x *UpdateReq) Reset()
- func (x *UpdateReq) String() string
- func (m *UpdateReq) Validate() error
- type UpdateReqValidationError
Constants ¶
This section is empty.
Variables ¶
var File_listing_proto protoreflect.FileDescriptor
var GamesService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "listing.v1.GamesService", HandlerType: (*GamesServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetGames", Handler: _GamesService_GetGames_Handler, }, { MethodName: "RegisterGame", Handler: _GamesService_RegisterGame_Handler, }, { MethodName: "RegisterGames", Handler: _GamesService_RegisterGames_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "listing.proto", }
GamesService_ServiceDesc is the grpc.ServiceDesc for GamesService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGamesServiceHandler ¶
func RegisterGamesServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterGamesServiceHandler registers the http handlers for service GamesService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGamesServiceHandlerClient ¶
func RegisterGamesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GamesServiceClient) error
RegisterGamesServiceHandlerClient registers the http handlers for service GamesService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GamesServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GamesServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GamesServiceClient" to call the correct interceptors.
func RegisterGamesServiceHandlerFromEndpoint ¶
func RegisterGamesServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGamesServiceHandlerFromEndpoint is same as RegisterGamesServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGamesServiceHandlerServer ¶
func RegisterGamesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GamesServiceServer) error
RegisterGamesServiceHandlerServer registers the http handlers for service GamesService to "mux". UnaryRPC :call GamesServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterGamesServiceHandlerFromEndpoint instead.
func RegisterGamesServiceServer ¶
func RegisterGamesServiceServer(s grpc.ServiceRegistrar, srv GamesServiceServer)
Types ¶
type Game ¶
type Game struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Category string `protobuf:"bytes,2,opt,name=category,proto3" json:"category,omitempty"` Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Subtitle string `protobuf:"bytes,4,opt,name=subtitle,proto3" json:"subtitle,omitempty"` Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` Images []*Images `protobuf:"bytes,6,rep,name=images,proto3" json:"images,omitempty"` Type int32 `protobuf:"varint,7,opt,name=type,proto3" json:"type,omitempty"` Tags []string `protobuf:"bytes,8,rep,name=tags,proto3" json:"tags,omitempty"` Author string `protobuf:"bytes,9,opt,name=author,proto3" json:"author,omitempty"` ReplayBundleUrlJson string `protobuf:"bytes,10,opt,name=replayBundleUrlJson,proto3" json:"replayBundleUrlJson,omitempty"` Duration float64 `protobuf:"fixed64,11,opt,name=duration,proto3" json:"duration,omitempty"` IsDownloadable bool `protobuf:"varint,12,opt,name=isDownloadable,proto3" json:"isDownloadable,omitempty"` IsStreamable bool `protobuf:"varint,13,opt,name=isStreamable,proto3" json:"isStreamable,omitempty"` Version string `protobuf:"bytes,14,opt,name=version,proto3" json:"version,omitempty"` // contains filtered or unexported fields }
func (*Game) Descriptor
deprecated
func (*Game) GetCategory ¶
func (*Game) GetDescription ¶
func (*Game) GetDuration ¶
func (*Game) GetIsDownloadable ¶
func (*Game) GetIsStreamable ¶
func (*Game) GetReplayBundleUrlJson ¶
func (*Game) GetSubtitle ¶
func (*Game) GetVersion ¶
func (*Game) ProtoMessage ¶
func (*Game) ProtoMessage()
func (*Game) ProtoReflect ¶
func (x *Game) ProtoReflect() protoreflect.Message
type GameValidationError ¶
type GameValidationError struct {
// contains filtered or unexported fields
}
GameValidationError is the validation error returned by Game.Validate if the designated constraints aren't met.
func (GameValidationError) Cause ¶
func (e GameValidationError) Cause() error
Cause function returns cause value.
func (GameValidationError) Error ¶
func (e GameValidationError) Error() string
Error satisfies the builtin error interface
func (GameValidationError) ErrorName ¶
func (e GameValidationError) ErrorName() string
ErrorName returns error name.
func (GameValidationError) Field ¶
func (e GameValidationError) Field() string
Field function returns field value.
func (GameValidationError) Key ¶
func (e GameValidationError) Key() bool
Key function returns key value.
func (GameValidationError) Reason ¶
func (e GameValidationError) Reason() string
Reason function returns reason value.
type Games ¶
type Games struct { Listings []*Game `protobuf:"bytes,1,rep,name=listings,proto3" json:"listings,omitempty"` // contains filtered or unexported fields }
func (*Games) Descriptor
deprecated
func (*Games) GetListings ¶
func (*Games) ProtoMessage ¶
func (*Games) ProtoMessage()
func (*Games) ProtoReflect ¶
func (x *Games) ProtoReflect() protoreflect.Message
type GamesServiceClient ¶
type GamesServiceClient interface { // list all registered Games GetGames(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Games, error) // Register a new Game RegisterGame(ctx context.Context, in *Game, opts ...grpc.CallOption) (*Game, error) // Register a list of new Game RegisterGames(ctx context.Context, in *Games, opts ...grpc.CallOption) (*Games, error) }
GamesServiceClient is the client API for GamesService 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 NewGamesServiceClient ¶
func NewGamesServiceClient(cc grpc.ClientConnInterface) GamesServiceClient
type GamesServiceServer ¶
type GamesServiceServer interface { // list all registered Games GetGames(context.Context, *emptypb.Empty) (*Games, error) // Register a new Game RegisterGame(context.Context, *Game) (*Game, error) // Register a list of new Game RegisterGames(context.Context, *Games) (*Games, error) // contains filtered or unexported methods }
GamesServiceServer is the server API for GamesService service. All implementations must embed UnimplementedGamesServiceServer for forward compatibility
type GamesValidationError ¶
type GamesValidationError struct {
// contains filtered or unexported fields
}
GamesValidationError is the validation error returned by Games.Validate if the designated constraints aren't met.
func (GamesValidationError) Cause ¶
func (e GamesValidationError) Cause() error
Cause function returns cause value.
func (GamesValidationError) Error ¶
func (e GamesValidationError) Error() string
Error satisfies the builtin error interface
func (GamesValidationError) ErrorName ¶
func (e GamesValidationError) ErrorName() string
ErrorName returns error name.
func (GamesValidationError) Field ¶
func (e GamesValidationError) Field() string
Field function returns field value.
func (GamesValidationError) Key ¶
func (e GamesValidationError) Key() bool
Key function returns key value.
func (GamesValidationError) Reason ¶
func (e GamesValidationError) Reason() string
Reason function returns reason value.
type ID ¶
type ID struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ID) Descriptor
deprecated
func (*ID) ProtoMessage ¶
func (*ID) ProtoMessage()
func (*ID) ProtoReflect ¶
func (x *ID) ProtoReflect() protoreflect.Message
type IDValidationError ¶
type IDValidationError struct {
// contains filtered or unexported fields
}
IDValidationError is the validation error returned by ID.Validate if the designated constraints aren't met.
func (IDValidationError) Cause ¶
func (e IDValidationError) Cause() error
Cause function returns cause value.
func (IDValidationError) Error ¶
func (e IDValidationError) Error() string
Error satisfies the builtin error interface
func (IDValidationError) ErrorName ¶
func (e IDValidationError) ErrorName() string
ErrorName returns error name.
func (IDValidationError) Field ¶
func (e IDValidationError) Field() string
Field function returns field value.
func (IDValidationError) Key ¶
func (e IDValidationError) Key() bool
Key function returns key value.
func (IDValidationError) Reason ¶
func (e IDValidationError) Reason() string
Reason function returns reason value.
type Images ¶
type Images struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` Type int32 `protobuf:"varint,3,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Images) Descriptor
deprecated
func (*Images) ProtoMessage ¶
func (*Images) ProtoMessage()
func (*Images) ProtoReflect ¶
func (x *Images) ProtoReflect() protoreflect.Message
type ImagesValidationError ¶
type ImagesValidationError struct {
// contains filtered or unexported fields
}
ImagesValidationError is the validation error returned by Images.Validate if the designated constraints aren't met.
func (ImagesValidationError) Cause ¶
func (e ImagesValidationError) Cause() error
Cause function returns cause value.
func (ImagesValidationError) Error ¶
func (e ImagesValidationError) Error() string
Error satisfies the builtin error interface
func (ImagesValidationError) ErrorName ¶
func (e ImagesValidationError) ErrorName() string
ErrorName returns error name.
func (ImagesValidationError) Field ¶
func (e ImagesValidationError) Field() string
Field function returns field value.
func (ImagesValidationError) Key ¶
func (e ImagesValidationError) Key() bool
Key function returns key value.
func (ImagesValidationError) Reason ¶
func (e ImagesValidationError) Reason() string
Reason function returns reason value.
type StreamGames ¶
type StreamGames struct { Listings *Game `protobuf:"bytes,1,opt,name=listings,proto3" json:"listings,omitempty"` // contains filtered or unexported fields }
func (*StreamGames) Descriptor
deprecated
func (*StreamGames) Descriptor() ([]byte, []int)
Deprecated: Use StreamGames.ProtoReflect.Descriptor instead.
func (*StreamGames) GetListings ¶
func (x *StreamGames) GetListings() *Game
func (*StreamGames) ProtoMessage ¶
func (*StreamGames) ProtoMessage()
func (*StreamGames) ProtoReflect ¶
func (x *StreamGames) ProtoReflect() protoreflect.Message
func (*StreamGames) Reset ¶
func (x *StreamGames) Reset()
func (*StreamGames) String ¶
func (x *StreamGames) String() string
func (*StreamGames) Validate ¶
func (m *StreamGames) Validate() error
Validate checks the field values on StreamGames with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type StreamGamesValidationError ¶
type StreamGamesValidationError struct {
// contains filtered or unexported fields
}
StreamGamesValidationError is the validation error returned by StreamGames.Validate if the designated constraints aren't met.
func (StreamGamesValidationError) Cause ¶
func (e StreamGamesValidationError) Cause() error
Cause function returns cause value.
func (StreamGamesValidationError) Error ¶
func (e StreamGamesValidationError) Error() string
Error satisfies the builtin error interface
func (StreamGamesValidationError) ErrorName ¶
func (e StreamGamesValidationError) ErrorName() string
ErrorName returns error name.
func (StreamGamesValidationError) Field ¶
func (e StreamGamesValidationError) Field() string
Field function returns field value.
func (StreamGamesValidationError) Key ¶
func (e StreamGamesValidationError) Key() bool
Key function returns key value.
func (StreamGamesValidationError) Reason ¶
func (e StreamGamesValidationError) Reason() string
Reason function returns reason value.
type UnimplementedGamesServiceServer ¶
type UnimplementedGamesServiceServer struct { }
UnimplementedGamesServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedGamesServiceServer) RegisterGame ¶
func (UnimplementedGamesServiceServer) RegisterGames ¶
type UnsafeGamesServiceServer ¶
type UnsafeGamesServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGamesServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GamesServiceServer will result in compilation errors.
type UpdateReq ¶
type UpdateReq struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Game *Game `protobuf:"bytes,2,opt,name=game,proto3" json:"game,omitempty"` // contains filtered or unexported fields }
func (*UpdateReq) Descriptor
deprecated
func (*UpdateReq) ProtoMessage ¶
func (*UpdateReq) ProtoMessage()
func (*UpdateReq) ProtoReflect ¶
func (x *UpdateReq) ProtoReflect() protoreflect.Message
type UpdateReqValidationError ¶
type UpdateReqValidationError struct {
// contains filtered or unexported fields
}
UpdateReqValidationError is the validation error returned by UpdateReq.Validate if the designated constraints aren't met.
func (UpdateReqValidationError) Cause ¶
func (e UpdateReqValidationError) Cause() error
Cause function returns cause value.
func (UpdateReqValidationError) Error ¶
func (e UpdateReqValidationError) Error() string
Error satisfies the builtin error interface
func (UpdateReqValidationError) ErrorName ¶
func (e UpdateReqValidationError) ErrorName() string
ErrorName returns error name.
func (UpdateReqValidationError) Field ¶
func (e UpdateReqValidationError) Field() string
Field function returns field value.
func (UpdateReqValidationError) Key ¶
func (e UpdateReqValidationError) Key() bool
Key function returns key value.
func (UpdateReqValidationError) Reason ¶
func (e UpdateReqValidationError) Reason() string
Reason function returns reason value.