pb

package module
v0.0.0-...-ec66dda Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Plugin_Register_FullMethodName = "/pb.Plugin/Register"
	Plugin_Action_FullMethodName   = "/pb.Plugin/Action"
)

Variables

View Source
var (
	Rank_name = map[int32]string{
		0:  "UNKNOWN_Rank",
		1:  "AceLow",
		2:  "Two",
		3:  "Three",
		4:  "Four",
		5:  "Five",
		6:  "Six",
		7:  "Severn",
		8:  "Eight",
		9:  "Nine",
		10: "Ten",
		11: "Jack",
		12: "Queen",
		13: "King",
		14: "Ace",
	}
	Rank_value = map[string]int32{
		"UNKNOWN_Rank": 0,
		"AceLow":       1,
		"Two":          2,
		"Three":        3,
		"Four":         4,
		"Five":         5,
		"Six":          6,
		"Severn":       7,
		"Eight":        8,
		"Nine":         9,
		"Ten":          10,
		"Jack":         11,
		"Queen":        12,
		"King":         13,
		"Ace":          14,
	}
)

Enum value maps for Rank.

View Source
var (
	Suit_name = map[int32]string{
		0: "UNKNOWN_Suit",
		1: "Spades",
		2: "Dimonds",
		3: "Clubs",
		4: "Hearts",
	}
	Suit_value = map[string]int32{
		"UNKNOWN_Suit": 0,
		"Spades":       1,
		"Dimonds":      2,
		"Clubs":        3,
		"Hearts":       4,
	}
)

Enum value maps for Suit.

View Source
var (
	State_name = map[int32]string{
		0: "UNKNOWN_State",
		1: "Active",
		2: "Folded",
		3: "Called",
	}
	State_value = map[string]int32{
		"UNKNOWN_State": 0,
		"Active":        1,
		"Folded":        2,
		"Called":        3,
	}
)

Enum value maps for State.

View Source
var (
	Action_name = map[int32]string{
		0: "UNKNOWN_Action",
		1: "Fold",
		2: "Bet",
	}
	Action_value = map[string]int32{
		"UNKNOWN_Action": 0,
		"Fold":           1,
		"Bet":            2,
	}
)

Enum value maps for Action.

View Source
var File_poker_proto protoreflect.FileDescriptor
View Source
var Plugin_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pb.Plugin",
	HandlerType: (*PluginServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _Plugin_Register_Handler,
		},
		{
			MethodName: "Action",
			Handler:    _Plugin_Action_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "poker.proto",
}

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

Functions

func RegisterPluginServer

func RegisterPluginServer(s grpc.ServiceRegistrar, srv PluginServer)

Types

type Action

type Action int32
const (
	Action_UNKNOWN_Action Action = 0
	Action_Fold           Action = 1
	// Bet refers to both betting and raising
	Action_Bet Action = 2
)

func (Action) Descriptor

func (Action) Descriptor() protoreflect.EnumDescriptor

func (Action) Enum

func (x Action) Enum() *Action

func (Action) EnumDescriptor deprecated

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

Deprecated: Use Action.Descriptor instead.

func (Action) Number

func (x Action) Number() protoreflect.EnumNumber

func (Action) String

func (x Action) String() string

func (Action) Type

func (Action) Type() protoreflect.EnumType

type ActionRequest

type ActionRequest struct {

	// Players at the table
	Players []*Player `protobuf:"bytes,1,rep,name=players,proto3" json:"players,omitempty"`
	// Cards on the board inc player's hole cards
	HoleCards []*Card `protobuf:"bytes,2,rep,name=hole_cards,json=holeCards,proto3" json:"hole_cards,omitempty"`
	Flop      []*Card `protobuf:"bytes,3,rep,name=flop,proto3" json:"flop,omitempty"`
	Turn      *Card   `protobuf:"bytes,4,opt,name=turn,proto3" json:"turn,omitempty"`
	River     *Card   `protobuf:"bytes,5,opt,name=river,proto3" json:"river,omitempty"`
	// Chips on the table
	Pots        []*Pot `protobuf:"bytes,6,rep,name=pots,proto3" json:"pots,omitempty"`
	BetSoFar    uint64 `protobuf:"varint,7,opt,name=bet_so_far,json=betSoFar,proto3" json:"bet_so_far,omitempty"`
	BetToPlayer uint64 `protobuf:"varint,8,opt,name=bet_to_player,json=betToPlayer,proto3" json:"bet_to_player,omitempty"`
	MinRaise    uint64 `protobuf:"varint,9,opt,name=min_raise,json=minRaise,proto3" json:"min_raise,omitempty"`
	// contains filtered or unexported fields
}

func (*ActionRequest) Descriptor deprecated

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

Deprecated: Use ActionRequest.ProtoReflect.Descriptor instead.

func (*ActionRequest) GetBetSoFar

func (x *ActionRequest) GetBetSoFar() uint64

func (*ActionRequest) GetBetToPlayer

func (x *ActionRequest) GetBetToPlayer() uint64

func (*ActionRequest) GetFlop

func (x *ActionRequest) GetFlop() []*Card

func (*ActionRequest) GetHoleCards

func (x *ActionRequest) GetHoleCards() []*Card

func (*ActionRequest) GetMinRaise

func (x *ActionRequest) GetMinRaise() uint64

func (*ActionRequest) GetPlayers

func (x *ActionRequest) GetPlayers() []*Player

func (*ActionRequest) GetPots

func (x *ActionRequest) GetPots() []*Pot

func (*ActionRequest) GetRiver

func (x *ActionRequest) GetRiver() *Card

func (*ActionRequest) GetTurn

func (x *ActionRequest) GetTurn() *Card

func (*ActionRequest) ProtoMessage

func (*ActionRequest) ProtoMessage()

func (*ActionRequest) ProtoReflect

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

func (*ActionRequest) Reset

func (x *ActionRequest) Reset()

func (*ActionRequest) String

func (x *ActionRequest) String() string

type ActionResponse

type ActionResponse struct {
	Action Action `protobuf:"varint,1,opt,name=action,proto3,enum=pb.Action" json:"action,omitempty"`
	Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*ActionResponse) Descriptor deprecated

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

Deprecated: Use ActionResponse.ProtoReflect.Descriptor instead.

func (*ActionResponse) GetAction

func (x *ActionResponse) GetAction() Action

func (*ActionResponse) GetAmount

func (x *ActionResponse) GetAmount() uint64

func (*ActionResponse) ProtoMessage

func (*ActionResponse) ProtoMessage()

func (*ActionResponse) ProtoReflect

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

func (*ActionResponse) Reset

func (x *ActionResponse) Reset()

func (*ActionResponse) String

func (x *ActionResponse) String() string

type Card

type Card struct {
	Rank Rank `protobuf:"varint,1,opt,name=rank,proto3,enum=pb.Rank" json:"rank,omitempty"`
	Suit Suit `protobuf:"varint,2,opt,name=suit,proto3,enum=pb.Suit" json:"suit,omitempty"`
	// contains filtered or unexported fields
}

func (*Card) Descriptor deprecated

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

Deprecated: Use Card.ProtoReflect.Descriptor instead.

func (*Card) GetRank

func (x *Card) GetRank() Rank

func (*Card) GetSuit

func (x *Card) GetSuit() Suit

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 Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type Player

type Player struct {
	Guid     string `protobuf:"bytes,1,opt,name=guid,proto3" json:"guid,omitempty"`
	Name     string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	State    State  `protobuf:"varint,3,opt,name=state,proto3,enum=pb.State" json:"state,omitempty"`
	Bank     uint64 `protobuf:"varint,4,opt,name=bank,proto3" json:"bank,omitempty"`
	BetSoFar uint64 `protobuf:"varint,5,opt,name=bet_so_far,json=betSoFar,proto3" json:"bet_so_far,omitempty"`
	// contains filtered or unexported fields
}

func (*Player) Descriptor deprecated

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

Deprecated: Use Player.ProtoReflect.Descriptor instead.

func (*Player) GetBank

func (x *Player) GetBank() uint64

func (*Player) GetBetSoFar

func (x *Player) GetBetSoFar() uint64

func (*Player) GetGuid

func (x *Player) GetGuid() string

func (*Player) GetName

func (x *Player) GetName() string

func (*Player) GetState

func (x *Player) GetState() State

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 PluginClient

type PluginClient interface {
	Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	Action(ctx context.Context, in *ActionRequest, opts ...grpc.CallOption) (*ActionResponse, error)
}

PluginClient is the client API for Plugin 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 NewPluginClient

func NewPluginClient(cc grpc.ClientConnInterface) PluginClient

type PluginServer

type PluginServer interface {
	Register(context.Context, *RegisterRequest) (*RegisterResponse, error)
	Action(context.Context, *ActionRequest) (*ActionResponse, error)
	// contains filtered or unexported methods
}

PluginServer is the server API for Plugin service. All implementations must embed UnimplementedPluginServer for forward compatibility

type Pot

type Pot struct {
	Size    uint64   `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
	Players []string `protobuf:"bytes,2,rep,name=players,proto3" json:"players,omitempty"`
	// contains filtered or unexported fields
}

func (*Pot) Descriptor deprecated

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

Deprecated: Use Pot.ProtoReflect.Descriptor instead.

func (*Pot) GetPlayers

func (x *Pot) GetPlayers() []string

func (*Pot) GetSize

func (x *Pot) GetSize() uint64

func (*Pot) ProtoMessage

func (*Pot) ProtoMessage()

func (*Pot) ProtoReflect

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

func (*Pot) Reset

func (x *Pot) Reset()

func (*Pot) String

func (x *Pot) String() string

type Rank

type Rank int32
const (
	Rank_UNKNOWN_Rank Rank = 0
	Rank_AceLow       Rank = 1
	Rank_Two          Rank = 2
	Rank_Three        Rank = 3
	Rank_Four         Rank = 4
	Rank_Five         Rank = 5
	Rank_Six          Rank = 6
	Rank_Severn       Rank = 7
	Rank_Eight        Rank = 8
	Rank_Nine         Rank = 9
	Rank_Ten          Rank = 10
	Rank_Jack         Rank = 11
	Rank_Queen        Rank = 12
	Rank_King         Rank = 13
	Rank_Ace          Rank = 14
)

func (Rank) Descriptor

func (Rank) Descriptor() protoreflect.EnumDescriptor

func (Rank) Enum

func (x Rank) Enum() *Rank

func (Rank) EnumDescriptor deprecated

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

Deprecated: Use Rank.Descriptor instead.

func (Rank) Number

func (x Rank) Number() protoreflect.EnumNumber

func (Rank) String

func (x Rank) String() string

func (Rank) Type

func (Rank) Type() protoreflect.EnumType

type RegisterRequest

type RegisterRequest struct {
	PlayerGuid             string `protobuf:"bytes,1,opt,name=player_guid,json=playerGuid,proto3" json:"player_guid,omitempty"`
	DecisionTimeoutSeconds uint64 `` /* 130-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*RegisterRequest) Descriptor deprecated

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

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) GetDecisionTimeoutSeconds

func (x *RegisterRequest) GetDecisionTimeoutSeconds() uint64

func (*RegisterRequest) GetPlayerGuid

func (x *RegisterRequest) GetPlayerGuid() string

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) ProtoReflect

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

func (*RegisterRequest) Reset

func (x *RegisterRequest) Reset()

func (*RegisterRequest) String

func (x *RegisterRequest) String() string

type RegisterResponse

type RegisterResponse struct {
	BotName string `protobuf:"bytes,1,opt,name=bot_name,json=botName,proto3" json:"bot_name,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterResponse) Descriptor deprecated

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

Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.

func (*RegisterResponse) GetBotName

func (x *RegisterResponse) GetBotName() string

func (*RegisterResponse) ProtoMessage

func (*RegisterResponse) ProtoMessage()

func (*RegisterResponse) ProtoReflect

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

func (*RegisterResponse) Reset

func (x *RegisterResponse) Reset()

func (*RegisterResponse) String

func (x *RegisterResponse) String() string

type State

type State int32
const (
	State_UNKNOWN_State State = 0
	State_Active        State = 1
	State_Folded        State = 2
	State_Called        State = 3
)

func (State) Descriptor

func (State) Descriptor() protoreflect.EnumDescriptor

func (State) Enum

func (x State) Enum() *State

func (State) EnumDescriptor deprecated

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

Deprecated: Use State.Descriptor instead.

func (State) Number

func (x State) Number() protoreflect.EnumNumber

func (State) String

func (x State) String() string

func (State) Type

func (State) Type() protoreflect.EnumType

type Suit

type Suit int32
const (
	Suit_UNKNOWN_Suit Suit = 0
	Suit_Spades       Suit = 1
	Suit_Dimonds      Suit = 2
	Suit_Clubs        Suit = 3
	Suit_Hearts       Suit = 4
)

func (Suit) Descriptor

func (Suit) Descriptor() protoreflect.EnumDescriptor

func (Suit) Enum

func (x Suit) Enum() *Suit

func (Suit) EnumDescriptor deprecated

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

Deprecated: Use Suit.Descriptor instead.

func (Suit) Number

func (x Suit) Number() protoreflect.EnumNumber

func (Suit) String

func (x Suit) String() string

func (Suit) Type

func (Suit) Type() protoreflect.EnumType

type UnimplementedPluginServer

type UnimplementedPluginServer struct {
}

UnimplementedPluginServer must be embedded to have forward compatible implementations.

func (UnimplementedPluginServer) Action

func (UnimplementedPluginServer) Register

type UnsafePluginServer

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

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

Jump to

Keyboard shortcuts

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