Documentation ¶
Overview ¶
Package pb is a generated protocol buffer package.
It is generated from these files:
controller.proto
It has these top-level messages:
ValidateSnakeRequest ValidateSnakeResponse SnakeResponseStatus Score PopRequest PopResponse StatusRequest StatusResponse StartRequest StartResponse CreateRequest CreateResponse AddGameFrameRequest AddGameFrameResponse ListGameFramesRequest ListGameFramesResponse EndGameRequest EndGameResponse PingRequest PingResponse SnakeOptions Game GameFrame Point Snake Death
Index ¶
- Constants
- func ContextGetLockToken(ctx context.Context) string
- func ContextWithLockToken(ctx context.Context, token string) context.Context
- func RegisterControllerServer(s *grpc.Server, srv ControllerServer)
- type AddGameFrameRequest
- func (*AddGameFrameRequest) Descriptor() ([]byte, []int)
- func (this *AddGameFrameRequest) Equal(that interface{}) bool
- func (m *AddGameFrameRequest) GetGameFrame() *GameFrame
- func (m *AddGameFrameRequest) GetID() string
- func (*AddGameFrameRequest) ProtoMessage()
- func (m *AddGameFrameRequest) Reset()
- func (m *AddGameFrameRequest) String() string
- type AddGameFrameResponse
- type ControllerClient
- type ControllerServer
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)
- func (this *CreateRequest) Equal(that interface{}) bool
- func (m *CreateRequest) GetFood() int32
- func (m *CreateRequest) GetHeight() int32
- func (m *CreateRequest) GetMaxTurnsToNextFoodSpawn() int32
- func (m *CreateRequest) GetSnakeTimeout() int32
- func (m *CreateRequest) GetSnakes() []*SnakeOptions
- func (m *CreateRequest) GetWidth() int32
- func (*CreateRequest) ProtoMessage()
- func (m *CreateRequest) Reset()
- func (m *CreateRequest) String() string
- type CreateResponse
- type Death
- type EndGameRequest
- type EndGameResponse
- type Game
- func (*Game) Descriptor() ([]byte, []int)
- func (this *Game) Equal(that interface{}) bool
- func (m *Game) GetHeight() int32
- func (m *Game) GetID() string
- func (m *Game) GetMaxTurnsToNextFoodSpawn() int32
- func (m *Game) GetMode() string
- func (m *Game) GetSnakeTimeout() int32
- func (m *Game) GetStatus() string
- func (m *Game) GetTurnsSinceLastFoodSpawn() int32
- func (m *Game) GetWidth() int32
- func (*Game) ProtoMessage()
- func (m *Game) Reset()
- func (m *Game) String() string
- type GameFrame
- func (gt *GameFrame) AliveSnakes() []*Snake
- func (gt *GameFrame) DeadSnakes() []*Snake
- func (*GameFrame) Descriptor() ([]byte, []int)
- func (this *GameFrame) Equal(that interface{}) bool
- func (m *GameFrame) GetFood() []*Point
- func (m *GameFrame) GetSnakes() []*Snake
- func (m *GameFrame) GetTurn() int32
- func (*GameFrame) ProtoMessage()
- func (m *GameFrame) Reset()
- func (m *GameFrame) String() string
- type ListGameFramesRequest
- func (*ListGameFramesRequest) Descriptor() ([]byte, []int)
- func (this *ListGameFramesRequest) Equal(that interface{}) bool
- func (m *ListGameFramesRequest) GetID() string
- func (m *ListGameFramesRequest) GetLimit() int32
- func (m *ListGameFramesRequest) GetOffset() int32
- func (*ListGameFramesRequest) ProtoMessage()
- func (m *ListGameFramesRequest) Reset()
- func (m *ListGameFramesRequest) String() string
- type ListGameFramesResponse
- func (*ListGameFramesResponse) Descriptor() ([]byte, []int)
- func (this *ListGameFramesResponse) Equal(that interface{}) bool
- func (m *ListGameFramesResponse) GetCount() int32
- func (m *ListGameFramesResponse) GetFrames() []*GameFrame
- func (*ListGameFramesResponse) ProtoMessage()
- func (m *ListGameFramesResponse) Reset()
- func (m *ListGameFramesResponse) String() string
- type PingRequest
- type PingResponse
- type Point
- type PopRequest
- type PopResponse
- type Score
- type Snake
- func (s *Snake) DefaultMove()
- func (*Snake) Descriptor() ([]byte, []int)
- func (this *Snake) Equal(that interface{}) bool
- func (m *Snake) GetBody() []*Point
- func (m *Snake) GetColor() string
- func (m *Snake) GetDeath() *Death
- func (m *Snake) GetHeadType() string
- func (m *Snake) GetHealth() int32
- func (m *Snake) GetID() string
- func (m *Snake) GetName() string
- func (m *Snake) GetTailType() string
- func (m *Snake) GetURL() string
- func (s *Snake) Head() *Point
- func (s *Snake) Move(direction string)
- func (*Snake) ProtoMessage()
- func (m *Snake) Reset()
- func (m *Snake) String() string
- func (s *Snake) Tail() *Point
- type SnakeOptions
- func (*SnakeOptions) Descriptor() ([]byte, []int)
- func (this *SnakeOptions) Equal(that interface{}) bool
- func (m *SnakeOptions) GetHeadType() string
- func (m *SnakeOptions) GetID() string
- func (m *SnakeOptions) GetName() string
- func (m *SnakeOptions) GetTailType() string
- func (m *SnakeOptions) GetURL() string
- func (*SnakeOptions) ProtoMessage()
- func (m *SnakeOptions) Reset()
- func (m *SnakeOptions) String() string
- type SnakeResponseStatus
- func (*SnakeResponseStatus) Descriptor() ([]byte, []int)
- func (this *SnakeResponseStatus) Equal(that interface{}) bool
- func (m *SnakeResponseStatus) GetErrors() []string
- func (m *SnakeResponseStatus) GetMessage() string
- func (m *SnakeResponseStatus) GetRaw() string
- func (m *SnakeResponseStatus) GetScore() *Score
- func (m *SnakeResponseStatus) GetStatusCode() int32
- func (m *SnakeResponseStatus) GetTime() int32
- func (*SnakeResponseStatus) ProtoMessage()
- func (m *SnakeResponseStatus) Reset()
- func (m *SnakeResponseStatus) String() string
- type StartRequest
- type StartResponse
- type StatusRequest
- type StatusResponse
- func (*StatusResponse) Descriptor() ([]byte, []int)
- func (this *StatusResponse) Equal(that interface{}) bool
- func (m *StatusResponse) GetGame() *Game
- func (m *StatusResponse) GetLastFrame() *GameFrame
- func (*StatusResponse) ProtoMessage()
- func (m *StatusResponse) Reset()
- func (m *StatusResponse) String() string
- type ValidateSnakeRequest
- type ValidateSnakeResponse
- func (*ValidateSnakeResponse) Descriptor() ([]byte, []int)
- func (this *ValidateSnakeResponse) Equal(that interface{}) bool
- func (m *ValidateSnakeResponse) GetEndStatus() *SnakeResponseStatus
- func (m *ValidateSnakeResponse) GetMoveStatus() *SnakeResponseStatus
- func (m *ValidateSnakeResponse) GetPingStatus() *SnakeResponseStatus
- func (m *ValidateSnakeResponse) GetStartStatus() *SnakeResponseStatus
- func (*ValidateSnakeResponse) ProtoMessage()
- func (m *ValidateSnakeResponse) Reset()
- func (m *ValidateSnakeResponse) String() string
Constants ¶
const TokenKey = "x-lock-token"
TokenKey is the header key used to transport the lock token.
Variables ¶
This section is empty.
Functions ¶
func ContextGetLockToken ¶
ContextGetLockToken is used to retrieve the lock token from the context.
func ContextWithLockToken ¶
ContextWithLockToken uses grpc metadata to return a new context with a lock token.
func RegisterControllerServer ¶
func RegisterControllerServer(s *grpc.Server, srv ControllerServer)
Types ¶
type AddGameFrameRequest ¶
type AddGameFrameRequest struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` GameFrame *GameFrame `protobuf:"bytes,2,opt,name=GameFrame" json:"GameFrame,omitempty"` }
func NewPopulatedAddGameFrameRequest ¶
func NewPopulatedAddGameFrameRequest(r randyController, easy bool) *AddGameFrameRequest
func (*AddGameFrameRequest) Descriptor ¶
func (*AddGameFrameRequest) Descriptor() ([]byte, []int)
func (*AddGameFrameRequest) Equal ¶
func (this *AddGameFrameRequest) Equal(that interface{}) bool
func (*AddGameFrameRequest) GetGameFrame ¶
func (m *AddGameFrameRequest) GetGameFrame() *GameFrame
func (*AddGameFrameRequest) GetID ¶
func (m *AddGameFrameRequest) GetID() string
func (*AddGameFrameRequest) ProtoMessage ¶
func (*AddGameFrameRequest) ProtoMessage()
func (*AddGameFrameRequest) Reset ¶
func (m *AddGameFrameRequest) Reset()
func (*AddGameFrameRequest) String ¶
func (m *AddGameFrameRequest) String() string
type AddGameFrameResponse ¶
type AddGameFrameResponse struct {
Game *Game `protobuf:"bytes,1,opt,name=game" json:"game,omitempty"`
}
func NewPopulatedAddGameFrameResponse ¶
func NewPopulatedAddGameFrameResponse(r randyController, easy bool) *AddGameFrameResponse
func (*AddGameFrameResponse) Descriptor ¶
func (*AddGameFrameResponse) Descriptor() ([]byte, []int)
func (*AddGameFrameResponse) Equal ¶
func (this *AddGameFrameResponse) Equal(that interface{}) bool
func (*AddGameFrameResponse) GetGame ¶
func (m *AddGameFrameResponse) GetGame() *Game
func (*AddGameFrameResponse) ProtoMessage ¶
func (*AddGameFrameResponse) ProtoMessage()
func (*AddGameFrameResponse) Reset ¶
func (m *AddGameFrameResponse) Reset()
func (*AddGameFrameResponse) String ¶
func (m *AddGameFrameResponse) String() string
type ControllerClient ¶
type ControllerClient interface { // Pop should pop a game that is unlocked and unfinished from the queue, lock // the game and return it to the worker to begin processing. This call will // be polled by the workers. Pop(ctx context.Context, in *PopRequest, opts ...grpc.CallOption) (*PopResponse, error) // Status retrieves the game state including the last processed game frame. Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) // Start starts the game running, and will make it ready to be picked up by a // worker. Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*StartResponse, error) // Create creates a new game, but doesn't start running frames. Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) // AddGameFrame adds a new game frame to the game. A lock must be held for this // call to succeed. AddGameFrame(ctx context.Context, in *AddGameFrameRequest, opts ...grpc.CallOption) (*AddGameFrameResponse, error) // ListGameFrames will list all game frames given a limit and offset. ListGameFrames(ctx context.Context, in *ListGameFramesRequest, opts ...grpc.CallOption) (*ListGameFramesResponse, error) // EndGame sets the game status to complete. A lock must be held for this call // to succeed. EndGame(ctx context.Context, in *EndGameRequest, opts ...grpc.CallOption) (*EndGameResponse, error) // ping will ping the controller. Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) // ValidateSnake will call a snake URL and return stats about it's validity. ValidateSnake(ctx context.Context, in *ValidateSnakeRequest, opts ...grpc.CallOption) (*ValidateSnakeResponse, error) }
func Dial ¶
func Dial(address string, opts ...grpc.DialOption) (ControllerClient, error)
Dial will dial the controller client.
func NewControllerClient ¶
func NewControllerClient(cc *grpc.ClientConn) ControllerClient
type ControllerServer ¶
type ControllerServer interface { // Pop should pop a game that is unlocked and unfinished from the queue, lock // the game and return it to the worker to begin processing. This call will // be polled by the workers. Pop(context.Context, *PopRequest) (*PopResponse, error) // Status retrieves the game state including the last processed game frame. Status(context.Context, *StatusRequest) (*StatusResponse, error) // Start starts the game running, and will make it ready to be picked up by a // worker. Start(context.Context, *StartRequest) (*StartResponse, error) // Create creates a new game, but doesn't start running frames. Create(context.Context, *CreateRequest) (*CreateResponse, error) // AddGameFrame adds a new game frame to the game. A lock must be held for this // call to succeed. AddGameFrame(context.Context, *AddGameFrameRequest) (*AddGameFrameResponse, error) // ListGameFrames will list all game frames given a limit and offset. ListGameFrames(context.Context, *ListGameFramesRequest) (*ListGameFramesResponse, error) // EndGame sets the game status to complete. A lock must be held for this call // to succeed. EndGame(context.Context, *EndGameRequest) (*EndGameResponse, error) // ping will ping the controller. Ping(context.Context, *PingRequest) (*PingResponse, error) // ValidateSnake will call a snake URL and return stats about it's validity. ValidateSnake(context.Context, *ValidateSnakeRequest) (*ValidateSnakeResponse, error) }
type CreateRequest ¶
type CreateRequest struct { Width int32 `protobuf:"varint,1,opt,name=Width,proto3" json:"Width,omitempty"` Height int32 `protobuf:"varint,2,opt,name=Height,proto3" json:"Height,omitempty"` Food int32 `protobuf:"varint,3,opt,name=Food,proto3" json:"Food,omitempty"` Snakes []*SnakeOptions `protobuf:"bytes,4,rep,name=Snakes" json:"Snakes,omitempty"` MaxTurnsToNextFoodSpawn int32 `protobuf:"varint,5,opt,name=MaxTurnsToNextFoodSpawn,proto3" json:"MaxTurnsToNextFoodSpawn,omitempty"` SnakeTimeout int32 `protobuf:"varint,6,opt,name=SnakeTimeout,proto3" json:"SnakeTimeout,omitempty"` }
func NewPopulatedCreateRequest ¶
func NewPopulatedCreateRequest(r randyController, easy bool) *CreateRequest
func (*CreateRequest) Descriptor ¶
func (*CreateRequest) Descriptor() ([]byte, []int)
func (*CreateRequest) Equal ¶
func (this *CreateRequest) Equal(that interface{}) bool
func (*CreateRequest) GetFood ¶
func (m *CreateRequest) GetFood() int32
func (*CreateRequest) GetHeight ¶
func (m *CreateRequest) GetHeight() int32
func (*CreateRequest) GetMaxTurnsToNextFoodSpawn ¶ added in v0.2.9
func (m *CreateRequest) GetMaxTurnsToNextFoodSpawn() int32
func (*CreateRequest) GetSnakeTimeout ¶ added in v0.2.11
func (m *CreateRequest) GetSnakeTimeout() int32
func (*CreateRequest) GetSnakes ¶
func (m *CreateRequest) GetSnakes() []*SnakeOptions
func (*CreateRequest) GetWidth ¶
func (m *CreateRequest) GetWidth() int32
func (*CreateRequest) ProtoMessage ¶
func (*CreateRequest) ProtoMessage()
func (*CreateRequest) Reset ¶
func (m *CreateRequest) Reset()
func (*CreateRequest) String ¶
func (m *CreateRequest) String() string
type CreateResponse ¶
type CreateResponse struct {
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
}
func NewPopulatedCreateResponse ¶
func NewPopulatedCreateResponse(r randyController, easy bool) *CreateResponse
func (*CreateResponse) Descriptor ¶
func (*CreateResponse) Descriptor() ([]byte, []int)
func (*CreateResponse) Equal ¶
func (this *CreateResponse) Equal(that interface{}) bool
func (*CreateResponse) GetID ¶
func (m *CreateResponse) GetID() string
func (*CreateResponse) ProtoMessage ¶
func (*CreateResponse) ProtoMessage()
func (*CreateResponse) Reset ¶
func (m *CreateResponse) Reset()
func (*CreateResponse) String ¶
func (m *CreateResponse) String() string
type Death ¶
type Death struct { Cause string `protobuf:"bytes,1,opt,name=Cause,proto3" json:"Cause,omitempty"` Turn int32 `protobuf:"varint,2,opt,name=Turn,proto3" json:"Turn,omitempty"` }
func NewPopulatedDeath ¶
func (*Death) Descriptor ¶
func (*Death) ProtoMessage ¶
func (*Death) ProtoMessage()
type EndGameRequest ¶
type EndGameRequest struct {
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
}
func NewPopulatedEndGameRequest ¶
func NewPopulatedEndGameRequest(r randyController, easy bool) *EndGameRequest
func (*EndGameRequest) Descriptor ¶
func (*EndGameRequest) Descriptor() ([]byte, []int)
func (*EndGameRequest) Equal ¶
func (this *EndGameRequest) Equal(that interface{}) bool
func (*EndGameRequest) GetID ¶
func (m *EndGameRequest) GetID() string
func (*EndGameRequest) ProtoMessage ¶
func (*EndGameRequest) ProtoMessage()
func (*EndGameRequest) Reset ¶
func (m *EndGameRequest) Reset()
func (*EndGameRequest) String ¶
func (m *EndGameRequest) String() string
type EndGameResponse ¶
type EndGameResponse struct { }
func NewPopulatedEndGameResponse ¶
func NewPopulatedEndGameResponse(r randyController, easy bool) *EndGameResponse
func (*EndGameResponse) Descriptor ¶
func (*EndGameResponse) Descriptor() ([]byte, []int)
func (*EndGameResponse) Equal ¶
func (this *EndGameResponse) Equal(that interface{}) bool
func (*EndGameResponse) ProtoMessage ¶
func (*EndGameResponse) ProtoMessage()
func (*EndGameResponse) Reset ¶
func (m *EndGameResponse) Reset()
func (*EndGameResponse) String ¶
func (m *EndGameResponse) String() string
type Game ¶
type Game struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` Status string `protobuf:"bytes,2,opt,name=Status,proto3" json:"Status,omitempty"` Width int32 `protobuf:"varint,3,opt,name=Width,proto3" json:"Width,omitempty"` Height int32 `protobuf:"varint,4,opt,name=Height,proto3" json:"Height,omitempty"` SnakeTimeout int32 `protobuf:"varint,6,opt,name=SnakeTimeout,proto3" json:"SnakeTimeout,omitempty"` Mode string `protobuf:"bytes,8,opt,name=Mode,proto3" json:"Mode,omitempty"` MaxTurnsToNextFoodSpawn int32 `protobuf:"varint,9,opt,name=MaxTurnsToNextFoodSpawn,proto3" json:"MaxTurnsToNextFoodSpawn,omitempty"` TurnsSinceLastFoodSpawn int32 `protobuf:"varint,10,opt,name=TurnsSinceLastFoodSpawn,proto3" json:"TurnsSinceLastFoodSpawn,omitempty"` }
func NewPopulatedGame ¶
func (*Game) Descriptor ¶
func (*Game) GetMaxTurnsToNextFoodSpawn ¶ added in v0.2.9
func (*Game) GetSnakeTimeout ¶
func (*Game) GetTurnsSinceLastFoodSpawn ¶ added in v0.2.9
func (*Game) ProtoMessage ¶
func (*Game) ProtoMessage()
type GameFrame ¶
type GameFrame struct { Turn int32 `protobuf:"varint,1,opt,name=Turn,proto3" json:"Turn,omitempty"` Food []*Point `protobuf:"bytes,2,rep,name=Food" json:"Food,omitempty"` Snakes []*Snake `protobuf:"bytes,3,rep,name=Snakes" json:"Snakes,omitempty"` }
func NewPopulatedGameFrame ¶
func (*GameFrame) AliveSnakes ¶
AliveSnakes returns all the alive snakes
func (*GameFrame) DeadSnakes ¶
DeadSnakes returns all the dead snakes
func (*GameFrame) Descriptor ¶
func (*GameFrame) ProtoMessage ¶
func (*GameFrame) ProtoMessage()
type ListGameFramesRequest ¶
type ListGameFramesRequest struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` Limit int32 `protobuf:"varint,2,opt,name=Limit,proto3" json:"Limit,omitempty"` Offset int32 `protobuf:"varint,3,opt,name=Offset,proto3" json:"Offset,omitempty"` }
func NewPopulatedListGameFramesRequest ¶
func NewPopulatedListGameFramesRequest(r randyController, easy bool) *ListGameFramesRequest
func (*ListGameFramesRequest) Descriptor ¶
func (*ListGameFramesRequest) Descriptor() ([]byte, []int)
func (*ListGameFramesRequest) Equal ¶
func (this *ListGameFramesRequest) Equal(that interface{}) bool
func (*ListGameFramesRequest) GetID ¶
func (m *ListGameFramesRequest) GetID() string
func (*ListGameFramesRequest) GetLimit ¶
func (m *ListGameFramesRequest) GetLimit() int32
func (*ListGameFramesRequest) GetOffset ¶
func (m *ListGameFramesRequest) GetOffset() int32
func (*ListGameFramesRequest) ProtoMessage ¶
func (*ListGameFramesRequest) ProtoMessage()
func (*ListGameFramesRequest) Reset ¶
func (m *ListGameFramesRequest) Reset()
func (*ListGameFramesRequest) String ¶
func (m *ListGameFramesRequest) String() string
type ListGameFramesResponse ¶
type ListGameFramesResponse struct { Frames []*GameFrame `protobuf:"bytes,1,rep,name=Frames" json:"Frames,omitempty"` Count int32 `protobuf:"varint,2,opt,name=Count,proto3" json:"Count,omitempty"` }
func NewPopulatedListGameFramesResponse ¶
func NewPopulatedListGameFramesResponse(r randyController, easy bool) *ListGameFramesResponse
func (*ListGameFramesResponse) Descriptor ¶
func (*ListGameFramesResponse) Descriptor() ([]byte, []int)
func (*ListGameFramesResponse) Equal ¶
func (this *ListGameFramesResponse) Equal(that interface{}) bool
func (*ListGameFramesResponse) GetCount ¶
func (m *ListGameFramesResponse) GetCount() int32
func (*ListGameFramesResponse) GetFrames ¶
func (m *ListGameFramesResponse) GetFrames() []*GameFrame
func (*ListGameFramesResponse) ProtoMessage ¶
func (*ListGameFramesResponse) ProtoMessage()
func (*ListGameFramesResponse) Reset ¶
func (m *ListGameFramesResponse) Reset()
func (*ListGameFramesResponse) String ¶
func (m *ListGameFramesResponse) String() string
type PingRequest ¶
type PingRequest struct { }
func NewPopulatedPingRequest ¶
func NewPopulatedPingRequest(r randyController, easy bool) *PingRequest
func (*PingRequest) Descriptor ¶
func (*PingRequest) Descriptor() ([]byte, []int)
func (*PingRequest) Equal ¶
func (this *PingRequest) Equal(that interface{}) bool
func (*PingRequest) ProtoMessage ¶
func (*PingRequest) ProtoMessage()
func (*PingRequest) Reset ¶
func (m *PingRequest) Reset()
func (*PingRequest) String ¶
func (m *PingRequest) String() string
type PingResponse ¶
type PingResponse struct {
Version string `protobuf:"bytes,1,opt,name=Version,proto3" json:"Version,omitempty"`
}
func NewPopulatedPingResponse ¶
func NewPopulatedPingResponse(r randyController, easy bool) *PingResponse
func (*PingResponse) Descriptor ¶
func (*PingResponse) Descriptor() ([]byte, []int)
func (*PingResponse) Equal ¶
func (this *PingResponse) Equal(that interface{}) bool
func (*PingResponse) GetVersion ¶
func (m *PingResponse) GetVersion() string
func (*PingResponse) ProtoMessage ¶
func (*PingResponse) ProtoMessage()
func (*PingResponse) Reset ¶
func (m *PingResponse) Reset()
func (*PingResponse) String ¶
func (m *PingResponse) String() string
type Point ¶
type Point struct { X int32 `protobuf:"varint,1,opt,name=X,proto3" json:"X,omitempty"` Y int32 `protobuf:"varint,2,opt,name=Y,proto3" json:"Y,omitempty"` }
func NewPopulatedPoint ¶
func (*Point) Descriptor ¶
func (*Point) ProtoMessage ¶
func (*Point) ProtoMessage()
type PopRequest ¶
type PopRequest struct { }
func NewPopulatedPopRequest ¶
func NewPopulatedPopRequest(r randyController, easy bool) *PopRequest
func (*PopRequest) Descriptor ¶
func (*PopRequest) Descriptor() ([]byte, []int)
func (*PopRequest) Equal ¶
func (this *PopRequest) Equal(that interface{}) bool
func (*PopRequest) ProtoMessage ¶
func (*PopRequest) ProtoMessage()
func (*PopRequest) Reset ¶
func (m *PopRequest) Reset()
func (*PopRequest) String ¶
func (m *PopRequest) String() string
type PopResponse ¶
type PopResponse struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` Token string `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,omitempty"` }
func NewPopulatedPopResponse ¶
func NewPopulatedPopResponse(r randyController, easy bool) *PopResponse
func (*PopResponse) Descriptor ¶
func (*PopResponse) Descriptor() ([]byte, []int)
func (*PopResponse) Equal ¶
func (this *PopResponse) Equal(that interface{}) bool
func (*PopResponse) GetID ¶
func (m *PopResponse) GetID() string
func (*PopResponse) GetToken ¶
func (m *PopResponse) GetToken() string
func (*PopResponse) ProtoMessage ¶
func (*PopResponse) ProtoMessage()
func (*PopResponse) Reset ¶
func (m *PopResponse) Reset()
func (*PopResponse) String ¶
func (m *PopResponse) String() string
type Score ¶ added in v0.1.6
type Score struct { ChecksPassed int32 `protobuf:"varint,1,opt,name=checksPassed,proto3" json:"checksPassed,omitempty"` ChecksFailed int32 `protobuf:"varint,2,opt,name=checksFailed,proto3" json:"checksFailed,omitempty"` }
func NewPopulatedScore ¶ added in v0.1.6
func (*Score) Descriptor ¶ added in v0.1.6
func (*Score) GetChecksFailed ¶ added in v0.1.6
func (*Score) GetChecksPassed ¶ added in v0.1.6
func (*Score) ProtoMessage ¶ added in v0.1.6
func (*Score) ProtoMessage()
type Snake ¶
type Snake struct { ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` URL string `protobuf:"bytes,3,opt,name=URL,proto3" json:"URL,omitempty"` Body []*Point `protobuf:"bytes,4,rep,name=Body" json:"Body,omitempty"` Health int32 `protobuf:"varint,5,opt,name=Health,proto3" json:"Health,omitempty"` Death *Death `protobuf:"bytes,6,opt,name=Death" json:"Death,omitempty"` Color string `protobuf:"bytes,7,opt,name=Color,proto3" json:"Color,omitempty"` HeadType string `protobuf:"bytes,8,opt,name=HeadType,proto3" json:"HeadType,omitempty"` TailType string `protobuf:"bytes,9,opt,name=TailType,proto3" json:"TailType,omitempty"` }
func NewPopulatedSnake ¶
func (*Snake) DefaultMove ¶
func (s *Snake) DefaultMove()
DefaultMove the snake will move 1 space in the direction it was already heading
func (*Snake) Descriptor ¶
func (*Snake) GetHeadType ¶ added in v0.2.12
func (*Snake) GetTailType ¶ added in v0.2.12
func (*Snake) Move ¶
Move the snake 1 space in the specified direction, move does not remove the end point of the snake, that will be done after snakes have eaten
func (*Snake) ProtoMessage ¶
func (*Snake) ProtoMessage()
type SnakeOptions ¶
type SnakeOptions struct { Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` URL string `protobuf:"bytes,2,opt,name=URL,proto3" json:"URL,omitempty"` ID string `protobuf:"bytes,3,opt,name=ID,proto3" json:"ID,omitempty"` HeadType string `protobuf:"bytes,4,opt,name=HeadType,proto3" json:"HeadType,omitempty"` TailType string `protobuf:"bytes,5,opt,name=TailType,proto3" json:"TailType,omitempty"` }
func NewPopulatedSnakeOptions ¶
func NewPopulatedSnakeOptions(r randyController, easy bool) *SnakeOptions
func (*SnakeOptions) Descriptor ¶
func (*SnakeOptions) Descriptor() ([]byte, []int)
func (*SnakeOptions) Equal ¶
func (this *SnakeOptions) Equal(that interface{}) bool
func (*SnakeOptions) GetHeadType ¶ added in v0.2.12
func (m *SnakeOptions) GetHeadType() string
func (*SnakeOptions) GetID ¶
func (m *SnakeOptions) GetID() string
func (*SnakeOptions) GetName ¶
func (m *SnakeOptions) GetName() string
func (*SnakeOptions) GetTailType ¶ added in v0.2.12
func (m *SnakeOptions) GetTailType() string
func (*SnakeOptions) GetURL ¶
func (m *SnakeOptions) GetURL() string
func (*SnakeOptions) ProtoMessage ¶
func (*SnakeOptions) ProtoMessage()
func (*SnakeOptions) Reset ¶
func (m *SnakeOptions) Reset()
func (*SnakeOptions) String ¶
func (m *SnakeOptions) String() string
type SnakeResponseStatus ¶ added in v0.1.6
type SnakeResponseStatus struct { Message string `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"` Errors []string `protobuf:"bytes,2,rep,name=Errors" json:"Errors,omitempty"` Time int32 `protobuf:"varint,3,opt,name=time,proto3" json:"time,omitempty"` Raw string `protobuf:"bytes,4,opt,name=raw,proto3" json:"raw,omitempty"` StatusCode int32 `protobuf:"varint,5,opt,name=statusCode,proto3" json:"statusCode,omitempty"` Score *Score `protobuf:"bytes,6,opt,name=score" json:"score,omitempty"` }
func NewPopulatedSnakeResponseStatus ¶ added in v0.1.6
func NewPopulatedSnakeResponseStatus(r randyController, easy bool) *SnakeResponseStatus
func (*SnakeResponseStatus) Descriptor ¶ added in v0.1.6
func (*SnakeResponseStatus) Descriptor() ([]byte, []int)
func (*SnakeResponseStatus) Equal ¶ added in v0.1.6
func (this *SnakeResponseStatus) Equal(that interface{}) bool
func (*SnakeResponseStatus) GetErrors ¶ added in v0.1.6
func (m *SnakeResponseStatus) GetErrors() []string
func (*SnakeResponseStatus) GetMessage ¶ added in v0.1.6
func (m *SnakeResponseStatus) GetMessage() string
func (*SnakeResponseStatus) GetRaw ¶ added in v0.1.6
func (m *SnakeResponseStatus) GetRaw() string
func (*SnakeResponseStatus) GetScore ¶ added in v0.1.6
func (m *SnakeResponseStatus) GetScore() *Score
func (*SnakeResponseStatus) GetStatusCode ¶ added in v0.1.6
func (m *SnakeResponseStatus) GetStatusCode() int32
func (*SnakeResponseStatus) GetTime ¶ added in v0.1.6
func (m *SnakeResponseStatus) GetTime() int32
func (*SnakeResponseStatus) ProtoMessage ¶ added in v0.1.6
func (*SnakeResponseStatus) ProtoMessage()
func (*SnakeResponseStatus) Reset ¶ added in v0.1.6
func (m *SnakeResponseStatus) Reset()
func (*SnakeResponseStatus) String ¶ added in v0.1.6
func (m *SnakeResponseStatus) String() string
type StartRequest ¶
type StartRequest struct {
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
}
func NewPopulatedStartRequest ¶
func NewPopulatedStartRequest(r randyController, easy bool) *StartRequest
func (*StartRequest) Descriptor ¶
func (*StartRequest) Descriptor() ([]byte, []int)
func (*StartRequest) Equal ¶
func (this *StartRequest) Equal(that interface{}) bool
func (*StartRequest) GetID ¶
func (m *StartRequest) GetID() string
func (*StartRequest) ProtoMessage ¶
func (*StartRequest) ProtoMessage()
func (*StartRequest) Reset ¶
func (m *StartRequest) Reset()
func (*StartRequest) String ¶
func (m *StartRequest) String() string
type StartResponse ¶
type StartResponse struct { }
func NewPopulatedStartResponse ¶
func NewPopulatedStartResponse(r randyController, easy bool) *StartResponse
func (*StartResponse) Descriptor ¶
func (*StartResponse) Descriptor() ([]byte, []int)
func (*StartResponse) Equal ¶
func (this *StartResponse) Equal(that interface{}) bool
func (*StartResponse) ProtoMessage ¶
func (*StartResponse) ProtoMessage()
func (*StartResponse) Reset ¶
func (m *StartResponse) Reset()
func (*StartResponse) String ¶
func (m *StartResponse) String() string
type StatusRequest ¶
type StatusRequest struct {
ID string `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
}
func NewPopulatedStatusRequest ¶
func NewPopulatedStatusRequest(r randyController, easy bool) *StatusRequest
func (*StatusRequest) Descriptor ¶
func (*StatusRequest) Descriptor() ([]byte, []int)
func (*StatusRequest) Equal ¶
func (this *StatusRequest) Equal(that interface{}) bool
func (*StatusRequest) GetID ¶
func (m *StatusRequest) GetID() string
func (*StatusRequest) ProtoMessage ¶
func (*StatusRequest) ProtoMessage()
func (*StatusRequest) Reset ¶
func (m *StatusRequest) Reset()
func (*StatusRequest) String ¶
func (m *StatusRequest) String() string
type StatusResponse ¶
type StatusResponse struct { Game *Game `protobuf:"bytes,1,opt,name=Game" json:"Game,omitempty"` LastFrame *GameFrame `protobuf:"bytes,2,opt,name=LastFrame" json:"LastFrame,omitempty"` }
func NewPopulatedStatusResponse ¶
func NewPopulatedStatusResponse(r randyController, easy bool) *StatusResponse
func (*StatusResponse) Descriptor ¶
func (*StatusResponse) Descriptor() ([]byte, []int)
func (*StatusResponse) Equal ¶
func (this *StatusResponse) Equal(that interface{}) bool
func (*StatusResponse) GetGame ¶
func (m *StatusResponse) GetGame() *Game
func (*StatusResponse) GetLastFrame ¶
func (m *StatusResponse) GetLastFrame() *GameFrame
func (*StatusResponse) ProtoMessage ¶
func (*StatusResponse) ProtoMessage()
func (*StatusResponse) Reset ¶
func (m *StatusResponse) Reset()
func (*StatusResponse) String ¶
func (m *StatusResponse) String() string
type ValidateSnakeRequest ¶ added in v0.1.6
type ValidateSnakeRequest struct {
URL string `protobuf:"bytes,1,opt,name=URL,proto3" json:"URL,omitempty"`
}
func NewPopulatedValidateSnakeRequest ¶ added in v0.1.6
func NewPopulatedValidateSnakeRequest(r randyController, easy bool) *ValidateSnakeRequest
func (*ValidateSnakeRequest) Descriptor ¶ added in v0.1.6
func (*ValidateSnakeRequest) Descriptor() ([]byte, []int)
func (*ValidateSnakeRequest) Equal ¶ added in v0.1.6
func (this *ValidateSnakeRequest) Equal(that interface{}) bool
func (*ValidateSnakeRequest) GetURL ¶ added in v0.1.6
func (m *ValidateSnakeRequest) GetURL() string
func (*ValidateSnakeRequest) ProtoMessage ¶ added in v0.1.6
func (*ValidateSnakeRequest) ProtoMessage()
func (*ValidateSnakeRequest) Reset ¶ added in v0.1.6
func (m *ValidateSnakeRequest) Reset()
func (*ValidateSnakeRequest) String ¶ added in v0.1.6
func (m *ValidateSnakeRequest) String() string
type ValidateSnakeResponse ¶ added in v0.1.6
type ValidateSnakeResponse struct { StartStatus *SnakeResponseStatus `protobuf:"bytes,1,opt,name=StartStatus" json:"StartStatus,omitempty"` MoveStatus *SnakeResponseStatus `protobuf:"bytes,2,opt,name=MoveStatus" json:"MoveStatus,omitempty"` EndStatus *SnakeResponseStatus `protobuf:"bytes,3,opt,name=EndStatus" json:"EndStatus,omitempty"` PingStatus *SnakeResponseStatus `protobuf:"bytes,4,opt,name=PingStatus" json:"PingStatus,omitempty"` }
func NewPopulatedValidateSnakeResponse ¶ added in v0.1.6
func NewPopulatedValidateSnakeResponse(r randyController, easy bool) *ValidateSnakeResponse
func (*ValidateSnakeResponse) Descriptor ¶ added in v0.1.6
func (*ValidateSnakeResponse) Descriptor() ([]byte, []int)
func (*ValidateSnakeResponse) Equal ¶ added in v0.1.6
func (this *ValidateSnakeResponse) Equal(that interface{}) bool
func (*ValidateSnakeResponse) GetEndStatus ¶ added in v0.1.6
func (m *ValidateSnakeResponse) GetEndStatus() *SnakeResponseStatus
func (*ValidateSnakeResponse) GetMoveStatus ¶ added in v0.1.6
func (m *ValidateSnakeResponse) GetMoveStatus() *SnakeResponseStatus
func (*ValidateSnakeResponse) GetPingStatus ¶ added in v0.2.2
func (m *ValidateSnakeResponse) GetPingStatus() *SnakeResponseStatus
func (*ValidateSnakeResponse) GetStartStatus ¶ added in v0.1.6
func (m *ValidateSnakeResponse) GetStartStatus() *SnakeResponseStatus
func (*ValidateSnakeResponse) ProtoMessage ¶ added in v0.1.6
func (*ValidateSnakeResponse) ProtoMessage()
func (*ValidateSnakeResponse) Reset ¶ added in v0.1.6
func (m *ValidateSnakeResponse) Reset()
func (*ValidateSnakeResponse) String ¶ added in v0.1.6
func (m *ValidateSnakeResponse) String() string