serving

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustServeForever

func MustServeForever(params *ServerParams)

MustServeForever is a convenience method for a production server to start serving and wait for termination signal.

func MustServeForeverMulti

func MustServeForeverMulti(params []*ServerParams)

MustServeForeverMulti is a convenience method for a production server to start serving multiple handlers and wait for termination signal.

Types

type BindingFunc

type BindingFunc func(*OpenMatchServer)

BindingFunc is used as a callback to configure OpenMatchServer most notably the GRPC server instance.

type GrpcWrapper

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

GrpcWrapper is a decoration around the standard GRPC server that sets up a bunch of things common to Open Match servers.

func NewGrpcServer

func NewGrpcServer(serviceLh, proxyLh *netlistener.ListenerHolder, logger *log.Entry) *GrpcWrapper

NewGrpcServer creates a new GrpcWrapper.

func (*GrpcWrapper) AddProxy

func (gw *GrpcWrapper) AddProxy(handlerFunc func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error)

AddProxy registers a reverse proxy from REST to gRPC when server is created.

func (*GrpcWrapper) AddService

func (gw *GrpcWrapper) AddService(handlerFunc func(*grpc.Server))

AddService adds a service registration function to be run when the server is created.

func (*GrpcWrapper) Start

func (gw *GrpcWrapper) Start() error

Start begins the gRPC server.

func (*GrpcWrapper) Stop

func (gw *GrpcWrapper) Stop() error

Stop gracefully shutsdown the gRPC server.

func (*GrpcWrapper) WaitForTermination

func (gw *GrpcWrapper) WaitForTermination() (error, error)

WaitForTermination blocks until the gRPC server is shutdown.

type OpenMatchServer

type OpenMatchServer struct {
	GrpcServer *GrpcWrapper
	Logger     *log.Entry
	RedisPool  *redis.Pool
	Config     config.View
}

OpenMatchServer contains the context of a standard Open Match Server.

func MustNew

func MustNew(params *ServerParams) *OpenMatchServer

MustNew panics if an OpenMatchServer cannot be created.

func New

func New(params *ServerParams) (*OpenMatchServer, error)

New creates an OpenMatchServer based on the parameters.

func NewMulti

func NewMulti(paramsList []*ServerParams) (*OpenMatchServer, error)

NewMulti creates an OpenMatchServer based on the parameters.

func (*OpenMatchServer) CopyFrom

func (oms *OpenMatchServer) CopyFrom(src *OpenMatchServer)

CopyFrom copies the state of an OpenMatchServer from the source server.

func (*OpenMatchServer) Start

func (oms *OpenMatchServer) Start() error

Start the Open Match Server

func (*OpenMatchServer) Stop

func (oms *OpenMatchServer) Stop() error

Stop the Open Match Server

type ServerParams

type ServerParams struct {
	BaseLogFields         log.Fields
	ServicePortConfigName string
	ProxyPortConfigName   string
	CustomMeasureViews    []*view.View
	Bindings              []BindingFunc
}

ServerParams is a collection of parameters used to create an Open Match server.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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