pb

package module
v0.0.0-...-4bfbfd8 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResponseCode_name = map[int32]string{
		0: "UNKNOWN",
		1: "OK",
		2: "BAD_REQUEST",
	}
	ResponseCode_value = map[string]int32{
		"UNKNOWN":     0,
		"OK":          1,
		"BAD_REQUEST": 2,
	}
)

Enum value maps for ResponseCode.

View Source
var File_gameoflife_proto protoreflect.FileDescriptor
View Source
var GameOfLife_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gameoflifepb.GameOfLife",
	HandlerType: (*GameOfLifeServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RunGame",
			Handler:    _GameOfLife_RunGame_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "gameoflife.proto",
}

GameOfLife_ServiceDesc is the grpc.ServiceDesc for GameOfLife service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGameOfLifeServer

func RegisterGameOfLifeServer(s grpc.ServiceRegistrar, srv GameOfLifeServer)

Types

type GameOfLifeClient

type GameOfLifeClient interface {
	RunGame(ctx context.Context, in *GameRequest, opts ...grpc.CallOption) (*GameResponse, error)
}

GameOfLifeClient is the client API for GameOfLife 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 NewGameOfLifeClient

func NewGameOfLifeClient(cc grpc.ClientConnInterface) GameOfLifeClient

type GameOfLifeServer

type GameOfLifeServer interface {
	RunGame(context.Context, *GameRequest) (*GameResponse, error)
	// contains filtered or unexported methods
}

GameOfLifeServer is the server API for GameOfLife service. All implementations must embed UnimplementedGameOfLifeServer for forward compatibility

type GameRequest

type GameRequest struct {
	Board   string `protobuf:"bytes,1,opt,name=board,proto3" json:"board,omitempty"`
	NumGens int32  `protobuf:"varint,2,opt,name=num_gens,json=numGens,proto3" json:"num_gens,omitempty"`
	// contains filtered or unexported fields
}

func (*GameRequest) Descriptor deprecated

func (*GameRequest) Descriptor() ([]byte, []int)

Deprecated: Use GameRequest.ProtoReflect.Descriptor instead.

func (*GameRequest) GetBoard

func (x *GameRequest) GetBoard() string

func (*GameRequest) GetNumGens

func (x *GameRequest) GetNumGens() int32

func (*GameRequest) ProtoMessage

func (*GameRequest) ProtoMessage()

func (*GameRequest) ProtoReflect

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

func (*GameRequest) Reset

func (x *GameRequest) Reset()

func (*GameRequest) String

func (x *GameRequest) String() string

type GameResponse

type GameResponse struct {
	Code         ResponseCode `protobuf:"varint,1,opt,name=code,proto3,enum=gameoflifepb.ResponseCode" json:"code,omitempty"`
	ErrorMessage string       `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"`
	Board        string       `protobuf:"bytes,3,opt,name=board,proto3" json:"board,omitempty"`
	// contains filtered or unexported fields
}

func (*GameResponse) Descriptor deprecated

func (*GameResponse) Descriptor() ([]byte, []int)

Deprecated: Use GameResponse.ProtoReflect.Descriptor instead.

func (*GameResponse) GetBoard

func (x *GameResponse) GetBoard() string

func (*GameResponse) GetCode

func (x *GameResponse) GetCode() ResponseCode

func (*GameResponse) GetErrorMessage

func (x *GameResponse) GetErrorMessage() string

func (*GameResponse) ProtoMessage

func (*GameResponse) ProtoMessage()

func (*GameResponse) ProtoReflect

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

func (*GameResponse) Reset

func (x *GameResponse) Reset()

func (*GameResponse) String

func (x *GameResponse) String() string

type ResponseCode

type ResponseCode int32
const (
	ResponseCode_UNKNOWN     ResponseCode = 0
	ResponseCode_OK          ResponseCode = 1
	ResponseCode_BAD_REQUEST ResponseCode = 2
)

func (ResponseCode) Descriptor

func (ResponseCode) Enum

func (x ResponseCode) Enum() *ResponseCode

func (ResponseCode) EnumDescriptor deprecated

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

Deprecated: Use ResponseCode.Descriptor instead.

func (ResponseCode) Number

func (ResponseCode) String

func (x ResponseCode) String() string

func (ResponseCode) Type

type UnimplementedGameOfLifeServer

type UnimplementedGameOfLifeServer struct {
}

UnimplementedGameOfLifeServer must be embedded to have forward compatible implementations.

func (UnimplementedGameOfLifeServer) RunGame

type UnsafeGameOfLifeServer

type UnsafeGameOfLifeServer interface {
	// contains filtered or unexported methods
}

UnsafeGameOfLifeServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GameOfLifeServer will result in compilation errors.

Jump to

Keyboard shortcuts

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