Documentation
¶
Overview ¶
Package v1alpha1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterPokerAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPokerAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PokerAPIClient) error
- func RegisterPokerAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPokerAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PokerAPIServer) error
- func RegisterPokerAPIServer(s *grpc.Server, srv PokerAPIServer)
- type Card
- type Deal
- type GetGameRequest
- type GetGameResponse
- type Hand
- type HandResult
- func (*HandResult) Descriptor() ([]byte, []int)deprecated
- func (x *HandResult) GetPlayer() *Player
- func (x *HandResult) GetRelativeHandRank() int32
- func (*HandResult) ProtoMessage()
- func (x *HandResult) ProtoReflect() protoreflect.Message
- func (x *HandResult) Reset()
- func (x *HandResult) String() string
- type Player
- func (*Player) Descriptor() ([]byte, []int)deprecated
- func (x *Player) GetBestFive() []*Card
- func (x *Player) GetHandName() string
- func (x *Player) GetNumber() int32
- func (*Player) ProtoMessage()
- func (x *Player) ProtoReflect() protoreflect.Message
- func (x *Player) Reset()
- func (x *Player) String() string
- type PokerAPIClient
- type PokerAPIServer
- type UnimplementedPokerAPIServer
Constants ¶
This section is empty.
Variables ¶
var File_backend_api_v1alpha1_poker_proto protoreflect.FileDescriptor
Functions ¶
func RegisterPokerAPIHandler ¶
func RegisterPokerAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterPokerAPIHandler registers the http handlers for service PokerAPI to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPokerAPIHandlerClient ¶
func RegisterPokerAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PokerAPIClient) error
RegisterPokerAPIHandlerClient registers the http handlers for service PokerAPI to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PokerAPIClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PokerAPIClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PokerAPIClient" to call the correct interceptors.
func RegisterPokerAPIHandlerFromEndpoint ¶
func RegisterPokerAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPokerAPIHandlerFromEndpoint is same as RegisterPokerAPIHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPokerAPIHandlerServer ¶
func RegisterPokerAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PokerAPIServer) error
RegisterPokerAPIHandlerServer registers the http handlers for service PokerAPI to "mux". UnaryRPC :call PokerAPIServer 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 RegisterPokerAPIHandlerFromEndpoint instead.
func RegisterPokerAPIServer ¶
func RegisterPokerAPIServer(s *grpc.Server, srv PokerAPIServer)
Types ¶
type Card ¶
type Card struct { Suit string `protobuf:"bytes,1,opt,name=suit,proto3" json:"suit,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*Card) Descriptor
deprecated
func (*Card) ProtoMessage ¶
func (*Card) ProtoMessage()
func (*Card) ProtoReflect ¶
func (x *Card) ProtoReflect() protoreflect.Message
type Deal ¶
type Deal struct { Hands []*Hand `protobuf:"bytes,1,rep,name=hands,proto3" json:"hands,omitempty"` Board []*Card `protobuf:"bytes,2,rep,name=board,proto3" json:"board,omitempty"` HandResult []*HandResult `protobuf:"bytes,3,rep,name=hand_result,json=handResult,proto3" json:"hand_result,omitempty"` // contains filtered or unexported fields }
func (*Deal) Descriptor
deprecated
func (*Deal) GetHandResult ¶
func (x *Deal) GetHandResult() []*HandResult
func (*Deal) ProtoMessage ¶
func (*Deal) ProtoMessage()
func (*Deal) ProtoReflect ¶
func (x *Deal) ProtoReflect() protoreflect.Message
type GetGameRequest ¶
type GetGameRequest struct { Hands int32 `protobuf:"varint,1,opt,name=hands,proto3" json:"hands,omitempty"` // contains filtered or unexported fields }
func (*GetGameRequest) Descriptor
deprecated
func (*GetGameRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetGameRequest.ProtoReflect.Descriptor instead.
func (*GetGameRequest) GetHands ¶
func (x *GetGameRequest) GetHands() int32
func (*GetGameRequest) ProtoMessage ¶
func (*GetGameRequest) ProtoMessage()
func (*GetGameRequest) ProtoReflect ¶
func (x *GetGameRequest) ProtoReflect() protoreflect.Message
func (*GetGameRequest) Reset ¶
func (x *GetGameRequest) Reset()
func (*GetGameRequest) String ¶
func (x *GetGameRequest) String() string
type GetGameResponse ¶
type GetGameResponse struct { Deal *Deal `protobuf:"bytes,1,opt,name=deal,proto3" json:"deal,omitempty"` // contains filtered or unexported fields }
func (*GetGameResponse) Descriptor
deprecated
func (*GetGameResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetGameResponse.ProtoReflect.Descriptor instead.
func (*GetGameResponse) GetDeal ¶
func (x *GetGameResponse) GetDeal() *Deal
func (*GetGameResponse) ProtoMessage ¶
func (*GetGameResponse) ProtoMessage()
func (*GetGameResponse) ProtoReflect ¶
func (x *GetGameResponse) ProtoReflect() protoreflect.Message
func (*GetGameResponse) Reset ¶
func (x *GetGameResponse) Reset()
func (*GetGameResponse) String ¶
func (x *GetGameResponse) String() string
type Hand ¶
type Hand struct { Cards []*Card `protobuf:"bytes,1,rep,name=cards,proto3" json:"cards,omitempty"` // contains filtered or unexported fields }
func (*Hand) Descriptor
deprecated
func (*Hand) ProtoMessage ¶
func (*Hand) ProtoMessage()
func (*Hand) ProtoReflect ¶
func (x *Hand) ProtoReflect() protoreflect.Message
type HandResult ¶
type HandResult struct { Player *Player `protobuf:"bytes,1,opt,name=player,proto3" json:"player,omitempty"` RelativeHandRank int32 `protobuf:"varint,2,opt,name=relative_hand_rank,json=relativeHandRank,proto3" json:"relative_hand_rank,omitempty"` // contains filtered or unexported fields }
func (*HandResult) Descriptor
deprecated
func (*HandResult) Descriptor() ([]byte, []int)
Deprecated: Use HandResult.ProtoReflect.Descriptor instead.
func (*HandResult) GetPlayer ¶
func (x *HandResult) GetPlayer() *Player
func (*HandResult) GetRelativeHandRank ¶
func (x *HandResult) GetRelativeHandRank() int32
func (*HandResult) ProtoMessage ¶
func (*HandResult) ProtoMessage()
func (*HandResult) ProtoReflect ¶
func (x *HandResult) ProtoReflect() protoreflect.Message
func (*HandResult) Reset ¶
func (x *HandResult) Reset()
func (*HandResult) String ¶
func (x *HandResult) String() string
type Player ¶
type Player struct { Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` BestFive []*Card `protobuf:"bytes,2,rep,name=best_five,json=bestFive,proto3" json:"best_five,omitempty"` HandName string `protobuf:"bytes,3,opt,name=hand_name,json=handName,proto3" json:"hand_name,omitempty"` // contains filtered or unexported fields }
func (*Player) Descriptor
deprecated
func (*Player) GetBestFive ¶
func (*Player) GetHandName ¶
func (*Player) ProtoMessage ¶
func (*Player) ProtoMessage()
func (*Player) ProtoReflect ¶
func (x *Player) ProtoReflect() protoreflect.Message
type PokerAPIClient ¶
type PokerAPIClient interface {
GetGame(ctx context.Context, in *GetGameRequest, opts ...grpc.CallOption) (*GetGameResponse, error)
}
PokerAPIClient is the client API for PokerAPI service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPokerAPIClient ¶
func NewPokerAPIClient(cc grpc.ClientConnInterface) PokerAPIClient
type PokerAPIServer ¶
type PokerAPIServer interface {
GetGame(context.Context, *GetGameRequest) (*GetGameResponse, error)
}
PokerAPIServer is the server API for PokerAPI service.
type UnimplementedPokerAPIServer ¶
type UnimplementedPokerAPIServer struct { }
UnimplementedPokerAPIServer can be embedded to have forward compatible implementations.
func (*UnimplementedPokerAPIServer) GetGame ¶
func (*UnimplementedPokerAPIServer) GetGame(context.Context, *GetGameRequest) (*GetGameResponse, error)