allocation

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 15 Imported by: 8

Documentation

Overview

Package allocation is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var AllocationRequest_SchedulingStrategy_name = map[int32]string{
	0: "Packed",
	1: "Distributed",
}
View Source
var AllocationRequest_SchedulingStrategy_value = map[string]int32{
	"Packed":      0,
	"Distributed": 1,
}

Functions

func RegisterAllocationServiceHandler

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

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

func RegisterAllocationServiceHandlerClient

func RegisterAllocationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AllocationServiceClient) error

RegisterAllocationServiceHandlerClient registers the http handlers for service AllocationService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AllocationServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AllocationServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AllocationServiceClient" to call the correct interceptors.

func RegisterAllocationServiceHandlerFromEndpoint

func RegisterAllocationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAllocationServiceHandlerFromEndpoint is same as RegisterAllocationServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAllocationServiceHandlerServer

func RegisterAllocationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AllocationServiceServer) error

RegisterAllocationServiceHandlerServer registers the http handlers for service AllocationService to "mux". UnaryRPC :call AllocationServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterAllocationServiceServer

func RegisterAllocationServiceServer(s *grpc.Server, srv AllocationServiceServer)

Types

type AllocationRequest

type AllocationRequest struct {
	// The k8s namespace that is hosting the targeted fleet of gameservers to be allocated
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// If specified, multi-cluster policies are applied. Otherwise, allocation will happen locally.
	MultiClusterSetting *MultiClusterSetting `protobuf:"bytes,2,opt,name=multiClusterSetting,proto3" json:"multiClusterSetting,omitempty"`
	// The required allocation. Defaults to all GameServers.
	RequiredGameServerSelector *LabelSelector `protobuf:"bytes,3,opt,name=requiredGameServerSelector,proto3" json:"requiredGameServerSelector,omitempty"`
	// The ordered list of preferred allocations out of the `required` set.
	// If the first selector is not matched, the selection attempts the second selector, and so on.
	PreferredGameServerSelectors []*LabelSelector `protobuf:"bytes,4,rep,name=preferredGameServerSelectors,proto3" json:"preferredGameServerSelectors,omitempty"`
	// Scheduling strategy. Defaults to "Packed".
	Scheduling AllocationRequest_SchedulingStrategy `` /* 127-byte string literal not displayed */
	// MetaPatch is optional custom metadata that is added to the game server at
	// allocation You can use this to tell the server necessary session data
	MetaPatch            *MetaPatch `protobuf:"bytes,6,opt,name=metaPatch,proto3" json:"metaPatch,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*AllocationRequest) Descriptor

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

func (*AllocationRequest) GetMetaPatch

func (m *AllocationRequest) GetMetaPatch() *MetaPatch

func (*AllocationRequest) GetMultiClusterSetting

func (m *AllocationRequest) GetMultiClusterSetting() *MultiClusterSetting

func (*AllocationRequest) GetNamespace

func (m *AllocationRequest) GetNamespace() string

func (*AllocationRequest) GetPreferredGameServerSelectors

func (m *AllocationRequest) GetPreferredGameServerSelectors() []*LabelSelector

func (*AllocationRequest) GetRequiredGameServerSelector

func (m *AllocationRequest) GetRequiredGameServerSelector() *LabelSelector

func (*AllocationRequest) GetScheduling

func (*AllocationRequest) ProtoMessage

func (*AllocationRequest) ProtoMessage()

func (*AllocationRequest) Reset

func (m *AllocationRequest) Reset()

func (*AllocationRequest) String

func (m *AllocationRequest) String() string

func (*AllocationRequest) XXX_DiscardUnknown

func (m *AllocationRequest) XXX_DiscardUnknown()

func (*AllocationRequest) XXX_Marshal

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

func (*AllocationRequest) XXX_Merge

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

func (*AllocationRequest) XXX_Size

func (m *AllocationRequest) XXX_Size() int

func (*AllocationRequest) XXX_Unmarshal

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

type AllocationRequest_SchedulingStrategy

type AllocationRequest_SchedulingStrategy int32
const (
	AllocationRequest_Packed      AllocationRequest_SchedulingStrategy = 0
	AllocationRequest_Distributed AllocationRequest_SchedulingStrategy = 1
)

func (AllocationRequest_SchedulingStrategy) EnumDescriptor

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

func (AllocationRequest_SchedulingStrategy) String

type AllocationResponse

type AllocationResponse struct {
	GameServerName       string                                     `protobuf:"bytes,2,opt,name=gameServerName,proto3" json:"gameServerName,omitempty"`
	Ports                []*AllocationResponse_GameServerStatusPort `protobuf:"bytes,3,rep,name=ports,proto3" json:"ports,omitempty"`
	Address              string                                     `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"`
	NodeName             string                                     `protobuf:"bytes,5,opt,name=nodeName,proto3" json:"nodeName,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                   `json:"-"`
	XXX_unrecognized     []byte                                     `json:"-"`
	XXX_sizecache        int32                                      `json:"-"`
}

func (*AllocationResponse) Descriptor

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

func (*AllocationResponse) GetAddress

func (m *AllocationResponse) GetAddress() string

func (*AllocationResponse) GetGameServerName

func (m *AllocationResponse) GetGameServerName() string

func (*AllocationResponse) GetNodeName

func (m *AllocationResponse) GetNodeName() string

func (*AllocationResponse) GetPorts

func (*AllocationResponse) ProtoMessage

func (*AllocationResponse) ProtoMessage()

func (*AllocationResponse) Reset

func (m *AllocationResponse) Reset()

func (*AllocationResponse) String

func (m *AllocationResponse) String() string

func (*AllocationResponse) XXX_DiscardUnknown

func (m *AllocationResponse) XXX_DiscardUnknown()

func (*AllocationResponse) XXX_Marshal

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

func (*AllocationResponse) XXX_Merge

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

func (*AllocationResponse) XXX_Size

func (m *AllocationResponse) XXX_Size() int

func (*AllocationResponse) XXX_Unmarshal

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

type AllocationResponse_GameServerStatusPort

type AllocationResponse_GameServerStatusPort struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Port                 int32    `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The gameserver port info that is allocated.

func (*AllocationResponse_GameServerStatusPort) Descriptor

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

func (*AllocationResponse_GameServerStatusPort) GetName

func (*AllocationResponse_GameServerStatusPort) GetPort

func (*AllocationResponse_GameServerStatusPort) ProtoMessage

func (*AllocationResponse_GameServerStatusPort) Reset

func (*AllocationResponse_GameServerStatusPort) String

func (*AllocationResponse_GameServerStatusPort) XXX_DiscardUnknown

func (m *AllocationResponse_GameServerStatusPort) XXX_DiscardUnknown()

func (*AllocationResponse_GameServerStatusPort) XXX_Marshal

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

func (*AllocationResponse_GameServerStatusPort) XXX_Merge

func (*AllocationResponse_GameServerStatusPort) XXX_Size

func (*AllocationResponse_GameServerStatusPort) XXX_Unmarshal

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

type AllocationServiceClient

type AllocationServiceClient interface {
	Allocate(ctx context.Context, in *AllocationRequest, opts ...grpc.CallOption) (*AllocationResponse, error)
}

AllocationServiceClient is the client API for AllocationService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAllocationServiceClient

func NewAllocationServiceClient(cc *grpc.ClientConn) AllocationServiceClient

type AllocationServiceServer

type AllocationServiceServer interface {
	Allocate(context.Context, *AllocationRequest) (*AllocationResponse, error)
}

AllocationServiceServer is the server API for AllocationService service.

type LabelSelector

type LabelSelector struct {
	// Labels to match.
	MatchLabels          map[string]string `` /* 163-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

LabelSelector used for finding a GameServer with matching labels.

func (*LabelSelector) Descriptor

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

func (*LabelSelector) GetMatchLabels

func (m *LabelSelector) GetMatchLabels() map[string]string

func (*LabelSelector) ProtoMessage

func (*LabelSelector) ProtoMessage()

func (*LabelSelector) Reset

func (m *LabelSelector) Reset()

func (*LabelSelector) String

func (m *LabelSelector) String() string

func (*LabelSelector) XXX_DiscardUnknown

func (m *LabelSelector) XXX_DiscardUnknown()

func (*LabelSelector) XXX_Marshal

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

func (*LabelSelector) XXX_Merge

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

func (*LabelSelector) XXX_Size

func (m *LabelSelector) XXX_Size() int

func (*LabelSelector) XXX_Unmarshal

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

type MetaPatch

type MetaPatch struct {
	Labels               map[string]string `` /* 153-byte string literal not displayed */
	Annotations          map[string]string `` /* 163-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

MetaPatch is the metadata used to patch the GameServer metadata on allocation

func (*MetaPatch) Descriptor

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

func (*MetaPatch) GetAnnotations

func (m *MetaPatch) GetAnnotations() map[string]string

func (*MetaPatch) GetLabels

func (m *MetaPatch) GetLabels() map[string]string

func (*MetaPatch) ProtoMessage

func (*MetaPatch) ProtoMessage()

func (*MetaPatch) Reset

func (m *MetaPatch) Reset()

func (*MetaPatch) String

func (m *MetaPatch) String() string

func (*MetaPatch) XXX_DiscardUnknown

func (m *MetaPatch) XXX_DiscardUnknown()

func (*MetaPatch) XXX_Marshal

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

func (*MetaPatch) XXX_Merge

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

func (*MetaPatch) XXX_Size

func (m *MetaPatch) XXX_Size() int

func (*MetaPatch) XXX_Unmarshal

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

type MultiClusterSetting

type MultiClusterSetting struct {
	// If set to true, multi-cluster allocation is enabled.
	Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// Selects multi-cluster allocation policies to apply. If not specified, all multi-cluster allocation policies are to be applied.
	PolicySelector       *LabelSelector `protobuf:"bytes,2,opt,name=policySelector,proto3" json:"policySelector,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

Specifies settings for multi-cluster allocation.

func (*MultiClusterSetting) Descriptor

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

func (*MultiClusterSetting) GetEnabled

func (m *MultiClusterSetting) GetEnabled() bool

func (*MultiClusterSetting) GetPolicySelector

func (m *MultiClusterSetting) GetPolicySelector() *LabelSelector

func (*MultiClusterSetting) ProtoMessage

func (*MultiClusterSetting) ProtoMessage()

func (*MultiClusterSetting) Reset

func (m *MultiClusterSetting) Reset()

func (*MultiClusterSetting) String

func (m *MultiClusterSetting) String() string

func (*MultiClusterSetting) XXX_DiscardUnknown

func (m *MultiClusterSetting) XXX_DiscardUnknown()

func (*MultiClusterSetting) XXX_Marshal

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

func (*MultiClusterSetting) XXX_Merge

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

func (*MultiClusterSetting) XXX_Size

func (m *MultiClusterSetting) XXX_Size() int

func (*MultiClusterSetting) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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