Documentation ¶
Index ¶
- func MustServeForever(params *ServerParams)
- func MustServeForeverMulti(params []*ServerParams)
- type BindingFunc
- type GrpcWrapper
- func (gw *GrpcWrapper) AddProxy(handlerFunc func(context.Context, *runtime.ServeMux, *grpc.ClientConn) error)
- func (gw *GrpcWrapper) AddService(handlerFunc func(*grpc.Server))
- func (gw *GrpcWrapper) Start() error
- func (gw *GrpcWrapper) Stop() error
- func (gw *GrpcWrapper) WaitForTermination() (error, error)
- type OpenMatchServer
- type ServerParams
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) 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
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.