Documentation ¶
Overview ¶
Package alpha is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterSDKHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSDKHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SDKClient) error
- func RegisterSDKHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSDKHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SDKServer) error
- func RegisterSDKServer(s *grpc.Server, srv SDKServer)
- type Count
- func (*Count) Descriptor() ([]byte, []int)
- func (m *Count) GetCount() int64
- func (*Count) ProtoMessage()
- func (m *Count) Reset()
- func (m *Count) String() string
- func (m *Count) XXX_DiscardUnknown()
- func (m *Count) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Count) XXX_Merge(src proto.Message)
- func (m *Count) XXX_Size() int
- func (m *Count) XXX_Unmarshal(b []byte) error
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) String() string
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type PlayerId
- func (*PlayerId) Descriptor() ([]byte, []int)
- func (m *PlayerId) GetPlayerId() string
- func (*PlayerId) ProtoMessage()
- func (m *PlayerId) Reset()
- func (m *PlayerId) String() string
- func (m *PlayerId) XXX_DiscardUnknown()
- func (m *PlayerId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PlayerId) XXX_Merge(src proto.Message)
- func (m *PlayerId) XXX_Size() int
- func (m *PlayerId) XXX_Unmarshal(b []byte) error
- type SDKClient
- type SDKServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSDKHandler ¶
RegisterSDKHandler registers the http handlers for service SDK to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSDKHandlerClient ¶
RegisterSDKHandlerClient registers the http handlers for service SDK to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SDKClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SDKClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SDKClient" to call the correct interceptors.
func RegisterSDKHandlerFromEndpoint ¶
func RegisterSDKHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSDKHandlerFromEndpoint is same as RegisterSDKHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSDKHandlerServer ¶
RegisterSDKHandlerServer registers the http handlers for service SDK to "mux". UnaryRPC :call SDKServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterSDKServer ¶
Types ¶
type Count ¶
type Count struct { Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Store a count variable.
func (*Count) Descriptor ¶
func (*Count) ProtoMessage ¶
func (*Count) ProtoMessage()
func (*Count) XXX_DiscardUnknown ¶
func (m *Count) XXX_DiscardUnknown()
func (*Count) XXX_Marshal ¶
func (*Count) XXX_Unmarshal ¶
type Empty ¶
type Empty struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
I am Empty
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶
func (*Empty) XXX_Unmarshal ¶
type PlayerId ¶
type PlayerId struct { PlayerId string `protobuf:"bytes,1,opt,name=playerId,proto3" json:"playerId,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
The unique identifier for a given player.
func (*PlayerId) Descriptor ¶
func (*PlayerId) GetPlayerId ¶
func (*PlayerId) ProtoMessage ¶
func (*PlayerId) ProtoMessage()
func (*PlayerId) XXX_DiscardUnknown ¶
func (m *PlayerId) XXX_DiscardUnknown()
func (*PlayerId) XXX_Marshal ¶
func (*PlayerId) XXX_Unmarshal ¶
type SDKClient ¶
type SDKClient interface { // Call when a player has connected. PlayerConnect(ctx context.Context, in *PlayerId, opts ...grpc.CallOption) (*Empty, error) // Call when a player has disconnected. PlayerDisconnect(ctx context.Context, in *PlayerId, opts ...grpc.CallOption) (*Empty, error) // Change the player capacity to a new value. SetPlayerCapacity(ctx context.Context, in *Count, opts ...grpc.CallOption) (*Empty, error) // Get the last player capacity that was set through the SDK. // If the player capacity is set from outside the SDK, use SDK.GameServer() instead. GetPlayerCapacity(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Count, error) // get the current player count GetPlayerCount(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Count, error) }
SDKClient is the client API for SDK service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewSDKClient ¶
func NewSDKClient(cc *grpc.ClientConn) SDKClient
type SDKServer ¶
type SDKServer interface { // Call when a player has connected. PlayerConnect(context.Context, *PlayerId) (*Empty, error) // Call when a player has disconnected. PlayerDisconnect(context.Context, *PlayerId) (*Empty, error) // Change the player capacity to a new value. SetPlayerCapacity(context.Context, *Count) (*Empty, error) // Get the last player capacity that was set through the SDK. // If the player capacity is set from outside the SDK, use SDK.GameServer() instead. GetPlayerCapacity(context.Context, *Empty) (*Count, error) // get the current player count GetPlayerCount(context.Context, *Empty) (*Count, error) }
SDKServer is the server API for SDK service.