alpha

package
v1.29.0-rc Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: Apache-2.0 Imports: 17 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

View Source
var File_alpha_proto protoreflect.FileDescriptor
View Source
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

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

Deprecated: Use Bool.ProtoReflect.Descriptor instead.

func (*Bool) GetBool added in v1.6.0

func (x *Bool) GetBool() bool

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

func (*Bool) Reset added in v1.6.0

func (x *Bool) Reset()

func (*Bool) String added in v1.6.0

func (x *Bool) String() string

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

Deprecated: Use Count.ProtoReflect.Descriptor instead.

func (*Count) GetCount

func (x *Count) GetCount() int64

func (*Count) ProtoMessage

func (*Count) ProtoMessage()

func (*Count) ProtoReflect added in v1.29.0

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

func (*Count) Reset

func (x *Count) Reset()

func (*Count) String

func (x *Count) String() string

type Empty

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

I am Empty

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect added in v1.29.0

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

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

Deprecated: Use PlayerID.ProtoReflect.Descriptor instead.

func (*PlayerID) GetPlayerID added in v1.6.0

func (x *PlayerID) GetPlayerID() string

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

func (*PlayerID) Reset added in v1.6.0

func (x *PlayerID) Reset()

func (*PlayerID) String added in v1.6.0

func (x *PlayerID) String() string

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) GetPlayerCapacity(context.Context, *Empty) (*Count, error)

func (UnimplementedSDKServer) GetPlayerCount added in v1.29.0

func (UnimplementedSDKServer) GetPlayerCount(context.Context, *Empty) (*Count, error)

func (UnimplementedSDKServer) IsPlayerConnected added in v1.29.0

func (UnimplementedSDKServer) IsPlayerConnected(context.Context, *PlayerID) (*Bool, error)

func (UnimplementedSDKServer) PlayerConnect added in v1.29.0

func (UnimplementedSDKServer) PlayerDisconnect added in v1.29.0

func (UnimplementedSDKServer) PlayerDisconnect(context.Context, *PlayerID) (*Bool, error)

func (UnimplementedSDKServer) SetPlayerCapacity added in v1.29.0

func (UnimplementedSDKServer) SetPlayerCapacity(context.Context, *Count) (*Empty, error)

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.

Jump to

Keyboard shortcuts

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