alpha

package
v1.23.0-rc Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package alpha is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSDKHandler

func RegisterSDKHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSDKHandler registers the http handlers for service SDK to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSDKHandlerClient

func RegisterSDKHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SDKClient) error

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

func RegisterSDKHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SDKServer) error

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

func RegisterSDKServer(s *grpc.Server, srv SDKServer)

Types

type Bool added in v1.6.0

type Bool struct {
	Bool                 bool     `protobuf:"varint,1,opt,name=bool,proto3" json:"bool,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Store a boolean result

func (*Bool) Descriptor added in v1.6.0

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

func (*Bool) GetBool added in v1.6.0

func (m *Bool) GetBool() bool

func (*Bool) ProtoMessage added in v1.6.0

func (*Bool) ProtoMessage()

func (*Bool) Reset added in v1.6.0

func (m *Bool) Reset()

func (*Bool) String added in v1.6.0

func (m *Bool) String() string

func (*Bool) XXX_DiscardUnknown added in v1.6.0

func (m *Bool) XXX_DiscardUnknown()

func (*Bool) XXX_Marshal added in v1.6.0

func (m *Bool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Bool) XXX_Merge added in v1.6.0

func (dst *Bool) XXX_Merge(src proto.Message)

func (*Bool) XXX_Size added in v1.6.0

func (m *Bool) XXX_Size() int

func (*Bool) XXX_Unmarshal added in v1.6.0

func (m *Bool) XXX_Unmarshal(b []byte) error

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

func (*Count) GetCount

func (m *Count) GetCount() int64

func (*Count) ProtoMessage

func (*Count) ProtoMessage()

func (*Count) Reset

func (m *Count) Reset()

func (*Count) String

func (m *Count) String() string

func (*Count) XXX_DiscardUnknown

func (m *Count) XXX_DiscardUnknown()

func (*Count) XXX_Marshal

func (m *Count) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Count) XXX_Merge

func (dst *Count) XXX_Merge(src proto.Message)

func (*Count) XXX_Size

func (m *Count) XXX_Size() int

func (*Count) XXX_Unmarshal

func (m *Count) XXX_Unmarshal(b []byte) error

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (dst *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

type PlayerID added in v1.6.0

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 added in v1.6.0

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

func (*PlayerID) GetPlayerID added in v1.6.0

func (m *PlayerID) GetPlayerID() string

func (*PlayerID) ProtoMessage added in v1.6.0

func (*PlayerID) ProtoMessage()

func (*PlayerID) Reset added in v1.6.0

func (m *PlayerID) Reset()

func (*PlayerID) String added in v1.6.0

func (m *PlayerID) String() string

func (*PlayerID) XXX_DiscardUnknown added in v1.6.0

func (m *PlayerID) XXX_DiscardUnknown()

func (*PlayerID) XXX_Marshal added in v1.6.0

func (m *PlayerID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PlayerID) XXX_Merge added in v1.6.0

func (dst *PlayerID) XXX_Merge(src proto.Message)

func (*PlayerID) XXX_Size added in v1.6.0

func (m *PlayerID) XXX_Size() int

func (*PlayerID) XXX_Unmarshal added in v1.6.0

func (m *PlayerID) XXX_Unmarshal(b []byte) error

type PlayerIDList added in v1.6.0

type PlayerIDList struct {
	List                 []string `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

List of Player IDs

func (*PlayerIDList) Descriptor added in v1.6.0

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

func (*PlayerIDList) GetList added in v1.6.0

func (m *PlayerIDList) GetList() []string

func (*PlayerIDList) ProtoMessage added in v1.6.0

func (*PlayerIDList) ProtoMessage()

func (*PlayerIDList) Reset added in v1.6.0

func (m *PlayerIDList) Reset()

func (*PlayerIDList) String added in v1.6.0

func (m *PlayerIDList) String() string

func (*PlayerIDList) XXX_DiscardUnknown added in v1.6.0

func (m *PlayerIDList) XXX_DiscardUnknown()

func (*PlayerIDList) XXX_Marshal added in v1.6.0

func (m *PlayerIDList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PlayerIDList) XXX_Merge added in v1.6.0

func (dst *PlayerIDList) XXX_Merge(src proto.Message)

func (*PlayerIDList) XXX_Size added in v1.6.0

func (m *PlayerIDList) XXX_Size() int

func (*PlayerIDList) XXX_Unmarshal added in v1.6.0

func (m *PlayerIDList) XXX_Unmarshal(b []byte) error

type SDKClient

type SDKClient interface {
	// PlayerConnect increases the SDK’s stored player count by one, and appends this playerID to GameServer.Status.Players.IDs.
	//
	// GameServer.Status.Players.Count and GameServer.Status.Players.IDs are then set to update the player count and id list a second from now,
	// unless there is already an update pending, in which case the update joins that batch operation.
	//
	// PlayerConnect returns true and adds the playerID to the list of playerIDs if this playerID was not already in the
	// list of connected playerIDs.
	//
	// If the playerID exists within the list of connected playerIDs, PlayerConnect will return false, and the list of
	// connected playerIDs will be left unchanged.
	//
	// An error will be returned if the playerID was not already in the list of connected playerIDs but the player capacity for
	// the server has been reached. The playerID will not be added to the list of playerIDs.
	//
	// Warning: Do not use this method if you are manually managing GameServer.Status.Players.IDs and GameServer.Status.Players.Count
	// through the Kubernetes API, as indeterminate results will occur.
	PlayerConnect(ctx context.Context, in *PlayerID, opts ...grpc.CallOption) (*Bool, error)
	// Decreases the SDK’s stored player count by one, and removes the playerID from GameServer.Status.Players.IDs.
	//
	// GameServer.Status.Players.Count and GameServer.Status.Players.IDs are then set to update the player count and id list a second from now,
	// unless there is already an update pending, in which case the update joins that batch operation.
	//
	// PlayerDisconnect will return true and remove the supplied playerID from the list of connected playerIDs if the
	// playerID value exists within the list.
	//
	// If the playerID was not in the list of connected playerIDs, the call will return false, and the connected playerID list
	// will be left unchanged.
	//
	// Warning: Do not use this method if you are manually managing GameServer.status.players.IDs and GameServer.status.players.Count
	// through the Kubernetes API, as indeterminate results will occur.
	PlayerDisconnect(ctx context.Context, in *PlayerID, opts ...grpc.CallOption) (*Bool, error)
	// Update the GameServer.Status.Players.Capacity value with a new capacity.
	SetPlayerCapacity(ctx context.Context, in *Count, opts ...grpc.CallOption) (*Empty, error)
	// Retrieves the current player capacity. This is always accurate from what has been set through this SDK,
	// even if the value has yet to be updated on the GameServer status resource.
	//
	// If GameServer.Status.Players.Capacity is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
	GetPlayerCapacity(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Count, error)
	// Retrieves the current player count. This is always accurate from what has been set through this SDK,
	// even if the value has yet to be updated on the GameServer status resource.
	//
	// If GameServer.Status.Players.Count is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
	GetPlayerCount(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Count, error)
	// Returns if the playerID is currently connected to the GameServer. This is always accurate from what has been set through this SDK,
	// even if the value has yet to be updated on the GameServer status resource.
	//
	// If GameServer.Status.Players.IDs is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to determine connected status.
	IsPlayerConnected(ctx context.Context, in *PlayerID, opts ...grpc.CallOption) (*Bool, error)
	// Returns the list of the currently connected player ids. This is always accurate from what has been set through this SDK,
	// even if the value has yet to be updated on the GameServer status resource.
	//
	// If GameServer.Status.Players.IDs is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
	GetConnectedPlayers(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PlayerIDList, 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 {
	// PlayerConnect increases the SDK’s stored player count by one, and appends this playerID to GameServer.Status.Players.IDs.
	//
	// GameServer.Status.Players.Count and GameServer.Status.Players.IDs are then set to update the player count and id list a second from now,
	// unless there is already an update pending, in which case the update joins that batch operation.
	//
	// PlayerConnect returns true and adds the playerID to the list of playerIDs if this playerID was not already in the
	// list of connected playerIDs.
	//
	// If the playerID exists within the list of connected playerIDs, PlayerConnect will return false, and the list of
	// connected playerIDs will be left unchanged.
	//
	// An error will be returned if the playerID was not already in the list of connected playerIDs but the player capacity for
	// the server has been reached. The playerID will not be added to the list of playerIDs.
	//
	// Warning: Do not use this method if you are manually managing GameServer.Status.Players.IDs and GameServer.Status.Players.Count
	// through the Kubernetes API, as indeterminate results will occur.
	PlayerConnect(context.Context, *PlayerID) (*Bool, error)
	// Decreases the SDK’s stored player count by one, and removes the playerID from GameServer.Status.Players.IDs.
	//
	// GameServer.Status.Players.Count and GameServer.Status.Players.IDs are then set to update the player count and id list a second from now,
	// unless there is already an update pending, in which case the update joins that batch operation.
	//
	// PlayerDisconnect will return true and remove the supplied playerID from the list of connected playerIDs if the
	// playerID value exists within the list.
	//
	// If the playerID was not in the list of connected playerIDs, the call will return false, and the connected playerID list
	// will be left unchanged.
	//
	// Warning: Do not use this method if you are manually managing GameServer.status.players.IDs and GameServer.status.players.Count
	// through the Kubernetes API, as indeterminate results will occur.
	PlayerDisconnect(context.Context, *PlayerID) (*Bool, error)
	// Update the GameServer.Status.Players.Capacity value with a new capacity.
	SetPlayerCapacity(context.Context, *Count) (*Empty, error)
	// Retrieves the current player capacity. This is always accurate from what has been set through this SDK,
	// even if the value has yet to be updated on the GameServer status resource.
	//
	// If GameServer.Status.Players.Capacity is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
	GetPlayerCapacity(context.Context, *Empty) (*Count, error)
	// Retrieves the current player count. This is always accurate from what has been set through this SDK,
	// even if the value has yet to be updated on the GameServer status resource.
	//
	// If GameServer.Status.Players.Count is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
	GetPlayerCount(context.Context, *Empty) (*Count, error)
	// Returns if the playerID is currently connected to the GameServer. This is always accurate from what has been set through this SDK,
	// even if the value has yet to be updated on the GameServer status resource.
	//
	// If GameServer.Status.Players.IDs is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to determine connected status.
	IsPlayerConnected(context.Context, *PlayerID) (*Bool, error)
	// Returns the list of the currently connected player ids. This is always accurate from what has been set through this SDK,
	// even if the value has yet to be updated on the GameServer status resource.
	//
	// If GameServer.Status.Players.IDs is set manually through the Kubernetes API, use SDK.GameServer() or SDK.WatchGameServer() instead to view this value.
	GetConnectedPlayers(context.Context, *Empty) (*PlayerIDList, error)
}

SDKServer is the server API for SDK service.

Jump to

Keyboard shortcuts

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