Documentation ¶
Index ¶
- Variables
- func HostBot(conf *BotConfig, bot Bot)
- func ParseBoardToProto(in []*Card) []*proto.Card
- func ParsePlayerListToProto(in []*Player) []*proto.Player
- func ParsePotListToProto(in []*Pot) []*proto.Pot
- func SliceMap[T, U any](slice []T, callback func(value T, index int) U) []U
- type BaseBot
- type Bot
- type BotConfig
- type Card
- type ConcretePlugin
- type GRPCClient
- type GRPCServer
- type Player
- type Plugin
- type Pot
Constants ¶
This section is empty.
Variables ¶
View Source
var Handshake = plugin.HandshakeConfig{
ProtocolVersion: 1,
MagicCookieKey: "TECHNICAL_CHALLENGE_POKER_BOT",
MagicCookieValue: "all-in",
}
Functions ¶
func ParseBoardToProto ¶
func ParsePlayerListToProto ¶
func ParsePotListToProto ¶
Types ¶
type ConcretePlugin ¶
type ConcretePlugin struct { // GRPCPlugin must still implement the Plugin interface plugin.Plugin // Concrete implementation Impl Plugin }
This is the implementation of plugin.GRPCPlugin so we can serve/consume this.
func (*ConcretePlugin) GRPCClient ¶
func (p *ConcretePlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)
func (*ConcretePlugin) GRPCServer ¶
func (p *ConcretePlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
type GRPCServer ¶
type GRPCServer struct { proto.UnimplementedPluginServer // This is the real implementation Impl Plugin }
func (*GRPCServer) Action ¶
func (m *GRPCServer) Action( ctx context.Context, req *proto.ActionRequest) (*proto.ActionResponse, error)
func (*GRPCServer) Register ¶
func (m *GRPCServer) Register( ctx context.Context, req *proto.RegisterRequest) (*proto.RegisterResponse, error)
type Player ¶
func ParsePlayerListToStruc ¶
func ParsePlayerToStruct ¶
func (*Player) ParseToProto ¶
Click to show internal directories.
Click to hide internal directories.