v1

package
v0.0.0-...-6346ec2 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_listing_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Game.ProtoReflect.Descriptor instead.

func (*Game) GetAuthor

func (x *Game) GetAuthor() string

func (*Game) GetCategory

func (x *Game) GetCategory() string

func (*Game) GetDescription

func (x *Game) GetDescription() string

func (*Game) GetDuration

func (x *Game) GetDuration() float64

func (*Game) GetId

func (x *Game) GetId() string

func (*Game) GetImages

func (x *Game) GetImages() []*Images

func (*Game) GetIsDownloadable

func (x *Game) GetIsDownloadable() bool

func (*Game) GetIsStreamable

func (x *Game) GetIsStreamable() bool

func (*Game) GetReplayBundleUrlJson

func (x *Game) GetReplayBundleUrlJson() string

func (*Game) GetSubtitle

func (x *Game) GetSubtitle() string

func (*Game) GetTags

func (x *Game) GetTags() []string

func (*Game) GetTitle

func (x *Game) GetTitle() string

func (*Game) GetType

func (x *Game) GetType() int32

func (*Game) GetVersion

func (x *Game) GetVersion() string

func (*Game) ProtoMessage

func (*Game) ProtoMessage()

func (*Game) ProtoReflect

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

func (*Game) Reset

func (x *Game) Reset()

func (*Game) String

func (x *Game) String() string

func (*Game) Validate

func (m *Game) Validate() error

Validate checks the field values on Game with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

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) Descriptor() ([]byte, []int)

Deprecated: Use Games.ProtoReflect.Descriptor instead.

func (*Games) GetListings

func (x *Games) GetListings() []*Game

func (*Games) ProtoMessage

func (*Games) ProtoMessage()

func (*Games) ProtoReflect

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

func (*Games) Reset

func (x *Games) Reset()

func (*Games) String

func (x *Games) String() string

func (*Games) Validate

func (m *Games) Validate() error

Validate checks the field values on Games with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

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.

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) Descriptor() ([]byte, []int)

Deprecated: Use ID.ProtoReflect.Descriptor instead.

func (*ID) GetId

func (x *ID) GetId() string

func (*ID) ProtoMessage

func (*ID) ProtoMessage()

func (*ID) ProtoReflect

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

func (*ID) Reset

func (x *ID) Reset()

func (*ID) String

func (x *ID) String() string

func (*ID) Validate

func (m *ID) Validate() error

Validate checks the field values on ID with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

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) Descriptor() ([]byte, []int)

Deprecated: Use Images.ProtoReflect.Descriptor instead.

func (*Images) GetId

func (x *Images) GetId() string

func (*Images) GetType

func (x *Images) GetType() int32

func (*Images) GetUrl

func (x *Images) GetUrl() string

func (*Images) ProtoMessage

func (*Images) ProtoMessage()

func (*Images) ProtoReflect

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

func (*Images) Reset

func (x *Images) Reset()

func (*Images) String

func (x *Images) String() string

func (*Images) Validate

func (m *Images) Validate() error

Validate checks the field values on Images with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

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

Cause function returns cause value.

func (StreamGamesValidationError) Error

Error satisfies the builtin error interface

func (StreamGamesValidationError) ErrorName

func (e StreamGamesValidationError) ErrorName() string

ErrorName returns error name.

func (StreamGamesValidationError) Field

Field function returns field value.

func (StreamGamesValidationError) Key

Key function returns key value.

func (StreamGamesValidationError) Reason

Reason function returns reason value.

type UnimplementedGamesServiceServer

type UnimplementedGamesServiceServer struct {
}

UnimplementedGamesServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedGamesServiceServer) GetGames

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) Descriptor() ([]byte, []int)

Deprecated: Use UpdateReq.ProtoReflect.Descriptor instead.

func (*UpdateReq) GetGame

func (x *UpdateReq) GetGame() *Game

func (*UpdateReq) GetId

func (x *UpdateReq) GetId() string

func (*UpdateReq) ProtoMessage

func (*UpdateReq) ProtoMessage()

func (*UpdateReq) ProtoReflect

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

func (*UpdateReq) Reset

func (x *UpdateReq) Reset()

func (*UpdateReq) String

func (x *UpdateReq) String() string

func (*UpdateReq) Validate

func (m *UpdateReq) Validate() error

Validate checks the field values on UpdateReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

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

Key function returns key value.

func (UpdateReqValidationError) Reason

func (e UpdateReqValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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