api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package api is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

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 BoolValue

type BoolValue struct {
	Value bool `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*BoolValue) Descriptor deprecated

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

Deprecated: Use BoolValue.ProtoReflect.Descriptor instead.

func (*BoolValue) GetValue

func (x *BoolValue) GetValue() bool

func (*BoolValue) ProtoMessage

func (*BoolValue) ProtoMessage()

func (*BoolValue) ProtoReflect

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

func (*BoolValue) Reset

func (x *BoolValue) Reset()

func (*BoolValue) String

func (x *BoolValue) String() string

type Duration

type Duration struct {
	Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
	// contains filtered or unexported fields
}

time duration, in seconds

func (*Duration) Descriptor deprecated

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

Deprecated: Use Duration.ProtoReflect.Descriptor instead.

func (*Duration) GetSeconds

func (x *Duration) GetSeconds() int64

func (*Duration) ProtoMessage

func (*Duration) ProtoMessage()

func (*Duration) ProtoReflect

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

func (*Duration) Reset

func (x *Duration) Reset()

func (*Duration) String

func (x *Duration) 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

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type GameServer

type GameServer struct {
	ObjectMeta *GameServer_ObjectMeta `protobuf:"bytes,1,opt,name=object_meta,json=objectMeta,proto3" json:"object_meta,omitempty"`
	Spec       *GameServer_Spec       `protobuf:"bytes,2,opt,name=spec,proto3" json:"spec,omitempty"`
	Status     *GameServer_Status     `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

A GameServer Custom Resource Definition object We will only export those resources that make the most sense. Can always expand to more as needed.

func (*GameServer) Descriptor deprecated

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

Deprecated: Use GameServer.ProtoReflect.Descriptor instead.

func (*GameServer) GetObjectMeta

func (x *GameServer) GetObjectMeta() *GameServer_ObjectMeta

func (*GameServer) GetSpec

func (x *GameServer) GetSpec() *GameServer_Spec

func (*GameServer) GetStatus

func (x *GameServer) GetStatus() *GameServer_Status

func (*GameServer) ProtoMessage

func (*GameServer) ProtoMessage()

func (*GameServer) ProtoReflect

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

func (*GameServer) Reset

func (x *GameServer) Reset()

func (*GameServer) String

func (x *GameServer) String() string

type GameServer_ObjectMeta

type GameServer_ObjectMeta struct {
	Name            string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Namespace       string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Uid             string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"`
	ResourceVersion string `protobuf:"bytes,4,opt,name=resource_version,json=resourceVersion,proto3" json:"resource_version,omitempty"`
	Generation      int64  `protobuf:"varint,5,opt,name=generation,proto3" json:"generation,omitempty"`
	// timestamp is in Epoch format, unit: seconds
	CreationTimestamp int64 `protobuf:"varint,6,opt,name=creation_timestamp,json=creationTimestamp,proto3" json:"creation_timestamp,omitempty"`
	// optional deletion timestamp in Epoch format, unit: seconds
	DeletionTimestamp int64             `protobuf:"varint,7,opt,name=deletion_timestamp,json=deletionTimestamp,proto3" json:"deletion_timestamp,omitempty"`
	Annotations       map[string]string `` /* 163-byte string literal not displayed */
	Labels            map[string]string `` /* 153-byte string literal not displayed */
	// contains filtered or unexported fields
}

representation of the K8s ObjectMeta resource

func (*GameServer_ObjectMeta) Descriptor deprecated

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

Deprecated: Use GameServer_ObjectMeta.ProtoReflect.Descriptor instead.

func (*GameServer_ObjectMeta) GetAnnotations

func (x *GameServer_ObjectMeta) GetAnnotations() map[string]string

func (*GameServer_ObjectMeta) GetCreationTimestamp

func (x *GameServer_ObjectMeta) GetCreationTimestamp() int64

func (*GameServer_ObjectMeta) GetDeletionTimestamp

func (x *GameServer_ObjectMeta) GetDeletionTimestamp() int64

func (*GameServer_ObjectMeta) GetGeneration

func (x *GameServer_ObjectMeta) GetGeneration() int64

func (*GameServer_ObjectMeta) GetLabels

func (x *GameServer_ObjectMeta) GetLabels() map[string]string

func (*GameServer_ObjectMeta) GetName

func (x *GameServer_ObjectMeta) GetName() string

func (*GameServer_ObjectMeta) GetNamespace

func (x *GameServer_ObjectMeta) GetNamespace() string

func (*GameServer_ObjectMeta) GetResourceVersion

func (x *GameServer_ObjectMeta) GetResourceVersion() string

func (*GameServer_ObjectMeta) GetUid

func (x *GameServer_ObjectMeta) GetUid() string

func (*GameServer_ObjectMeta) ProtoMessage

func (*GameServer_ObjectMeta) ProtoMessage()

func (*GameServer_ObjectMeta) ProtoReflect

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

func (*GameServer_ObjectMeta) Reset

func (x *GameServer_ObjectMeta) Reset()

func (*GameServer_ObjectMeta) String

func (x *GameServer_ObjectMeta) String() string

type GameServer_Spec

type GameServer_Spec struct {
	Constraints    []*GameServer_Spec_Constraint `protobuf:"bytes,1,rep,name=constraints,proto3" json:"constraints,omitempty"`
	ReadinessGates []string                      `protobuf:"bytes,2,rep,name=readiness_gates,json=readinessGates,proto3" json:"readiness_gates,omitempty"`
	DeletableGates []string                      `protobuf:"bytes,3,rep,name=deletable_gates,json=deletableGates,proto3" json:"deletable_gates,omitempty"`
	// contains filtered or unexported fields
}

func (*GameServer_Spec) Descriptor deprecated

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

Deprecated: Use GameServer_Spec.ProtoReflect.Descriptor instead.

func (*GameServer_Spec) GetConstraints

func (x *GameServer_Spec) GetConstraints() []*GameServer_Spec_Constraint

func (*GameServer_Spec) GetDeletableGates

func (x *GameServer_Spec) GetDeletableGates() []string

func (*GameServer_Spec) GetReadinessGates

func (x *GameServer_Spec) GetReadinessGates() []string

func (*GameServer_Spec) ProtoMessage

func (*GameServer_Spec) ProtoMessage()

func (*GameServer_Spec) ProtoReflect

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

func (*GameServer_Spec) Reset

func (x *GameServer_Spec) Reset()

func (*GameServer_Spec) String

func (x *GameServer_Spec) String() string

type GameServer_Spec_Constraint

type GameServer_Spec_Constraint struct {
	Type      string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Effective bool   `protobuf:"varint,2,opt,name=effective,proto3" json:"effective,omitempty"`
	Message   string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// optional time added timestamp in Epoch format, unit: seconds
	TimeAdded int64 `protobuf:"varint,4,opt,name=timeAdded,proto3" json:"timeAdded,omitempty"`
	// contains filtered or unexported fields
}

func (*GameServer_Spec_Constraint) Descriptor deprecated

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

Deprecated: Use GameServer_Spec_Constraint.ProtoReflect.Descriptor instead.

func (*GameServer_Spec_Constraint) GetEffective

func (x *GameServer_Spec_Constraint) GetEffective() bool

func (*GameServer_Spec_Constraint) GetMessage

func (x *GameServer_Spec_Constraint) GetMessage() string

func (*GameServer_Spec_Constraint) GetTimeAdded

func (x *GameServer_Spec_Constraint) GetTimeAdded() int64

func (*GameServer_Spec_Constraint) GetType

func (x *GameServer_Spec_Constraint) GetType() string

func (*GameServer_Spec_Constraint) ProtoMessage

func (*GameServer_Spec_Constraint) ProtoMessage()

func (*GameServer_Spec_Constraint) ProtoReflect

func (*GameServer_Spec_Constraint) Reset

func (x *GameServer_Spec_Constraint) Reset()

func (*GameServer_Spec_Constraint) String

func (x *GameServer_Spec_Constraint) String() string

type GameServer_Status

type GameServer_Status struct {
	State              string                                `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"`
	Address            string                                `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	NodeName           string                                `protobuf:"bytes,3,opt,name=nodeName,proto3" json:"nodeName,omitempty"`
	LoadBalancerStatus *GameServer_Status_LoadBalancerStatus `protobuf:"bytes,4,opt,name=load_balancer_status,json=loadBalancerStatus,proto3" json:"load_balancer_status,omitempty"`
	// contains filtered or unexported fields
}

func (*GameServer_Status) Descriptor deprecated

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

Deprecated: Use GameServer_Status.ProtoReflect.Descriptor instead.

func (*GameServer_Status) GetAddress

func (x *GameServer_Status) GetAddress() string

func (*GameServer_Status) GetLoadBalancerStatus

func (x *GameServer_Status) GetLoadBalancerStatus() *GameServer_Status_LoadBalancerStatus

func (*GameServer_Status) GetNodeName

func (x *GameServer_Status) GetNodeName() string

func (*GameServer_Status) GetState

func (x *GameServer_Status) GetState() string

func (*GameServer_Status) ProtoMessage

func (*GameServer_Status) ProtoMessage()

func (*GameServer_Status) ProtoReflect

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

func (*GameServer_Status) Reset

func (x *GameServer_Status) Reset()

func (*GameServer_Status) String

func (x *GameServer_Status) String() string

type GameServer_Status_LoadBalancerStatus

type GameServer_Status_LoadBalancerStatus struct {
	Ingress []*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress `protobuf:"bytes,1,rep,name=ingress,proto3" json:"ingress,omitempty"`
	// contains filtered or unexported fields
}

func (*GameServer_Status_LoadBalancerStatus) Descriptor deprecated

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

Deprecated: Use GameServer_Status_LoadBalancerStatus.ProtoReflect.Descriptor instead.

func (*GameServer_Status_LoadBalancerStatus) GetIngress

func (*GameServer_Status_LoadBalancerStatus) ProtoMessage

func (*GameServer_Status_LoadBalancerStatus) ProtoMessage()

func (*GameServer_Status_LoadBalancerStatus) ProtoReflect

func (*GameServer_Status_LoadBalancerStatus) Reset

func (*GameServer_Status_LoadBalancerStatus) String

type GameServer_Status_LoadBalancerStatus_LoadBalancerIngress

type GameServer_Status_LoadBalancerStatus_LoadBalancerIngress struct {
	Ip    string                                                                       `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
	Ports []*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort `protobuf:"bytes,2,rep,name=ports,proto3" json:"ports,omitempty"`
	// contains filtered or unexported fields
}

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress) Descriptor deprecated

Deprecated: Use GameServer_Status_LoadBalancerStatus_LoadBalancerIngress.ProtoReflect.Descriptor instead.

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress) GetIp

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress) GetPorts

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress) ProtoMessage

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress) ProtoReflect

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress) Reset

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress) String

type GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort

type GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort struct {

	// protoc v3.13 has support optional field,
	// but grpc-gateway not support optional current.
	// see https://github.com/grpc-ecosystem/grpc-gateway/issues/1278.
	ContainerPort      *wrappers.Int32Value                                                                 `protobuf:"bytes,1,opt,name=container_port,json=containerPort,proto3" json:"container_port,omitempty"`
	ExternalPort       *wrappers.Int32Value                                                                 `protobuf:"bytes,2,opt,name=external_port,json=externalPort,proto3" json:"external_port,omitempty"`
	ContainerPortRange *GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange `protobuf:"bytes,3,opt,name=container_port_range,json=containerPortRange,proto3" json:"container_port_range,omitempty"`
	ExternalPortRange  *GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange `protobuf:"bytes,4,opt,name=external_port_range,json=externalPortRange,proto3" json:"external_port_range,omitempty"`
	Protocol           string                                                                               `protobuf:"bytes,5,opt,name=protocol,proto3" json:"protocol,omitempty"`
	// contains filtered or unexported fields
}

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) Descriptor deprecated

Deprecated: Use GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort.ProtoReflect.Descriptor instead.

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) GetContainerPort

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) GetContainerPortRange

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) GetExternalPort

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) GetExternalPortRange

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) GetProtocol

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) ProtoMessage

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) ProtoReflect

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) Reset

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort) String

type GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange

type GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange struct {
	MinPort int32 `protobuf:"varint,1,opt,name=minPort,proto3" json:"minPort,omitempty"`
	MaxPort int32 `protobuf:"varint,2,opt,name=maxPort,proto3" json:"maxPort,omitempty"`
	// contains filtered or unexported fields
}

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange) Descriptor deprecated

Deprecated: Use GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange.ProtoReflect.Descriptor instead.

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange) GetMaxPort

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange) GetMinPort

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange) ProtoMessage

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange) ProtoReflect

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange) Reset

func (*GameServer_Status_LoadBalancerStatus_LoadBalancerIngress_LoadBalancerPort_PortRange) String

type KeyValue

type KeyValue struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Key, Value entry

func (*KeyValue) Descriptor deprecated

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

Deprecated: Use KeyValue.ProtoReflect.Descriptor instead.

func (*KeyValue) GetKey

func (x *KeyValue) GetKey() string

func (*KeyValue) GetValue

func (x *KeyValue) GetValue() string

func (*KeyValue) ProtoMessage

func (*KeyValue) ProtoMessage()

func (*KeyValue) ProtoReflect

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

func (*KeyValue) Reset

func (x *KeyValue) Reset()

func (*KeyValue) String

func (x *KeyValue) String() string

type SDKClient

type SDKClient interface {
	// Retrieve the current GameServer data
	GetGameServer(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GameServer, error)
	// Send GameServer details whenever the GameServer is updated
	WatchGameServer(ctx context.Context, in *Empty, opts ...grpc.CallOption) (SDK_WatchGameServerClient, error)
	// Apply a Label to the backing GameServer metadata
	SetLabel(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*Empty, error)
	// Apply a Annotation to the backing GameServer metadata
	SetAnnotation(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*Empty, error)
	// Apply a condition to the backing GameServer condition
	SetCondition(ctx context.Context, in *KeyValue, opts ...grpc.CallOption) (*Empty, 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 {
	// Retrieve the current GameServer data
	GetGameServer(context.Context, *Empty) (*GameServer, error)
	// Send GameServer details whenever the GameServer is updated
	WatchGameServer(*Empty, SDK_WatchGameServerServer) error
	// Apply a Label to the backing GameServer metadata
	SetLabel(context.Context, *KeyValue) (*Empty, error)
	// Apply a Annotation to the backing GameServer metadata
	SetAnnotation(context.Context, *KeyValue) (*Empty, error)
	// Apply a condition to the backing GameServer condition
	SetCondition(context.Context, *KeyValue) (*Empty, error)
	// contains filtered or unexported methods
}

SDKServer is the server API for SDK service. All implementations must embed UnimplementedSDKServer for forward compatibility

type SDK_WatchGameServerClient

type SDK_WatchGameServerClient interface {
	Recv() (*GameServer, error)
	grpc.ClientStream
}

type SDK_WatchGameServerServer

type SDK_WatchGameServerServer interface {
	Send(*GameServer) error
	grpc.ServerStream
}

type UnimplementedSDKServer

type UnimplementedSDKServer struct {
}

UnimplementedSDKServer must be embedded to have forward compatible implementations.

func (UnimplementedSDKServer) GetGameServer

func (UnimplementedSDKServer) SetAnnotation

func (UnimplementedSDKServer) SetCondition

func (UnimplementedSDKServer) SetLabel

func (UnimplementedSDKServer) WatchGameServer

type UnsafeSDKServer

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