Documentation ¶
Overview ¶
Package alpha is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- 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.ServiceRegistrar, srv SDKServer)
- type Bool
- type Count
- type Empty
- type PlayerID
- type PlayerIDList
- type SDKClient
- type SDKServer
- type UnimplementedSDKServer
- func (UnimplementedSDKServer) GetConnectedPlayers(context.Context, *Empty) (*PlayerIDList, error)
- func (UnimplementedSDKServer) GetPlayerCapacity(context.Context, *Empty) (*Count, error)
- func (UnimplementedSDKServer) GetPlayerCount(context.Context, *Empty) (*Count, error)
- func (UnimplementedSDKServer) IsPlayerConnected(context.Context, *PlayerID) (*Bool, error)
- func (UnimplementedSDKServer) PlayerConnect(context.Context, *PlayerID) (*Bool, error)
- func (UnimplementedSDKServer) PlayerDisconnect(context.Context, *PlayerID) (*Bool, error)
- func (UnimplementedSDKServer) SetPlayerCapacity(context.Context, *Count) (*Empty, error)
- type UnsafeSDKServer
Constants ¶
This section is empty.
Variables ¶
var File_alpha_proto protoreflect.FileDescriptor
var SDK_ServiceDesc = grpc.ServiceDesc{ ServiceName: "agones.dev.sdk.alpha.SDK", HandlerType: (*SDKServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "PlayerConnect", Handler: _SDK_PlayerConnect_Handler, }, { MethodName: "PlayerDisconnect", Handler: _SDK_PlayerDisconnect_Handler, }, { MethodName: "SetPlayerCapacity", Handler: _SDK_SetPlayerCapacity_Handler, }, { MethodName: "GetPlayerCapacity", Handler: _SDK_GetPlayerCapacity_Handler, }, { MethodName: "GetPlayerCount", Handler: _SDK_GetPlayerCount_Handler, }, { MethodName: "IsPlayerConnected", Handler: _SDK_IsPlayerConnected_Handler, }, { MethodName: "GetConnectedPlayers", Handler: _SDK_GetConnectedPlayers_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "alpha.proto", }
SDK_ServiceDesc is the grpc.ServiceDesc for SDK service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
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. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSDKHandlerFromEndpoint instead.
func RegisterSDKServer ¶
func RegisterSDKServer(s grpc.ServiceRegistrar, 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"` // contains filtered or unexported fields }
Store a boolean result
func (*Bool) Descriptor
deprecated
added in
v1.6.0
func (*Bool) ProtoMessage ¶ added in v1.6.0
func (*Bool) ProtoMessage()
func (*Bool) ProtoReflect ¶ added in v1.29.0
func (x *Bool) ProtoReflect() protoreflect.Message
type Count ¶
type Count struct { Count int64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
Store a count variable.
func (*Count) Descriptor
deprecated
func (*Count) ProtoMessage ¶
func (*Count) ProtoMessage()
func (*Count) ProtoReflect ¶ added in v1.29.0
func (x *Count) ProtoReflect() protoreflect.Message
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
I am Empty
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶ added in v1.29.0
func (x *Empty) ProtoReflect() protoreflect.Message
type PlayerID ¶ added in v1.6.0
type PlayerID struct { PlayerID string `protobuf:"bytes,1,opt,name=playerID,proto3" json:"playerID,omitempty"` // contains filtered or unexported fields }
The unique identifier for a given player.
func (*PlayerID) Descriptor
deprecated
added in
v1.6.0
func (*PlayerID) GetPlayerID ¶ added in v1.6.0
func (*PlayerID) ProtoMessage ¶ added in v1.6.0
func (*PlayerID) ProtoMessage()
func (*PlayerID) ProtoReflect ¶ added in v1.29.0
func (x *PlayerID) ProtoReflect() protoreflect.Message
type PlayerIDList ¶ added in v1.6.0
type PlayerIDList struct { List []string `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` // contains filtered or unexported fields }
List of Player IDs
func (*PlayerIDList) Descriptor
deprecated
added in
v1.6.0
func (*PlayerIDList) Descriptor() ([]byte, []int)
Deprecated: Use PlayerIDList.ProtoReflect.Descriptor instead.
func (*PlayerIDList) GetList ¶ added in v1.6.0
func (x *PlayerIDList) GetList() []string
func (*PlayerIDList) ProtoMessage ¶ added in v1.6.0
func (*PlayerIDList) ProtoMessage()
func (*PlayerIDList) ProtoReflect ¶ added in v1.29.0
func (x *PlayerIDList) ProtoReflect() protoreflect.Message
func (*PlayerIDList) Reset ¶ added in v1.6.0
func (x *PlayerIDList) Reset()
func (*PlayerIDList) String ¶ added in v1.6.0
func (x *PlayerIDList) String() string
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://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewSDKClient ¶
func NewSDKClient(cc grpc.ClientConnInterface) 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. All implementations should embed UnimplementedSDKServer for forward compatibility
type UnimplementedSDKServer ¶ added in v1.29.0
type UnimplementedSDKServer struct { }
UnimplementedSDKServer should be embedded to have forward compatible implementations.
func (UnimplementedSDKServer) GetConnectedPlayers ¶ added in v1.29.0
func (UnimplementedSDKServer) GetConnectedPlayers(context.Context, *Empty) (*PlayerIDList, error)
func (UnimplementedSDKServer) GetPlayerCapacity ¶ added in v1.29.0
func (UnimplementedSDKServer) GetPlayerCount ¶ added in v1.29.0
func (UnimplementedSDKServer) IsPlayerConnected ¶ added in v1.29.0
func (UnimplementedSDKServer) PlayerConnect ¶ added in v1.29.0
func (UnimplementedSDKServer) PlayerDisconnect ¶ added in v1.29.0
func (UnimplementedSDKServer) SetPlayerCapacity ¶ added in v1.29.0
type UnsafeSDKServer ¶ added in v1.29.0
type UnsafeSDKServer interface {
// contains filtered or unexported methods
}
UnsafeSDKServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SDKServer will result in compilation errors.