v1alpha1

package
v0.0.0-...-7d29c7d Latest Latest
Warning

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

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

Documentation

Overview

Package v1alpha1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

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

Deprecated: Use Card.ProtoReflect.Descriptor instead.

func (*Card) GetSuit

func (x *Card) GetSuit() string

func (*Card) GetValue

func (x *Card) GetValue() string

func (*Card) ProtoMessage

func (*Card) ProtoMessage()

func (*Card) ProtoReflect

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

func (*Card) Reset

func (x *Card) Reset()

func (*Card) String

func (x *Card) String() string

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

Deprecated: Use Deal.ProtoReflect.Descriptor instead.

func (*Deal) GetBoard

func (x *Deal) GetBoard() []*Card

func (*Deal) GetHandResult

func (x *Deal) GetHandResult() []*HandResult

func (*Deal) GetHands

func (x *Deal) GetHands() []*Hand

func (*Deal) ProtoMessage

func (*Deal) ProtoMessage()

func (*Deal) ProtoReflect

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

func (*Deal) Reset

func (x *Deal) Reset()

func (*Deal) String

func (x *Deal) String() string

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

Deprecated: Use Hand.ProtoReflect.Descriptor instead.

func (*Hand) GetCards

func (x *Hand) GetCards() []*Card

func (*Hand) ProtoMessage

func (*Hand) ProtoMessage()

func (*Hand) ProtoReflect

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

func (*Hand) Reset

func (x *Hand) Reset()

func (*Hand) String

func (x *Hand) String() string

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

Deprecated: Use Player.ProtoReflect.Descriptor instead.

func (*Player) GetBestFive

func (x *Player) GetBestFive() []*Card

func (*Player) GetHandName

func (x *Player) GetHandName() string

func (*Player) GetNumber

func (x *Player) GetNumber() int32

func (*Player) ProtoMessage

func (*Player) ProtoMessage()

func (*Player) ProtoReflect

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

func (*Player) Reset

func (x *Player) Reset()

func (*Player) String

func (x *Player) String() string

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

Jump to

Keyboard shortcuts

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