Documentation ¶
Overview ¶
Package golang contains the go files required to run the harness as a GRPC service. To use this harness, you should author the match making function and pass that in as the callback when setting up the function harness service. Note that the main package for the harness does very little except read the config and set up logging and metrics, then start the server. The harness functionality is implemented in harness.go, which implements the gRPC server defined in the pkg/pb/matchfunction.pb.go file.
Package golang provides the Match Making Function service for Open Match golang harness.
Package golang provides the Match Making Function service for Open Match golang harness.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindService ¶
func BindService(p *rpc.ServerParams, cfg config.View, fs *FunctionSettings) error
BindService creates the function service to the server Params.
func RunMatchFunction ¶
func RunMatchFunction(settings *FunctionSettings)
RunMatchFunction is a hook for the main() method in the main executable.
Types ¶
type FunctionSettings ¶
type FunctionSettings struct {
Func MatchFunction
}
FunctionSettings is a collection of parameters used to customize matchfunction views.
type MatchFunction ¶
type MatchFunction func(*MatchFunctionParams) ([]*pb.Match, error)
MatchFunction is the function signature for the Match Making Function (MMF) to be implemented by the user. The harness will pass the Rosters and PlayerPool for the match profile to this function and it will return the Rosters to be populated in the proposal. Input:
- MatchFunctionParams: A structure that defines the resources that are available to the match function. Developers can choose to add context to the structure such that match function has the ability to cancel a stream response/request or to limit match function by sharing a static and protected view.
type MatchFunctionParams ¶
type MatchFunctionParams struct { // Logger is used to generate error/debug logs Logger *logrus.Entry // 'Name' from the MatchProfile. ProfileName string // 'Extensions' from the MatchProfile. Extensions map[string]*any.Any // An array of Rosters. By convention, your input Roster contains players already in // the match, and the names of pools to search when trying to fill an empty slot. Rosters []*pb.Roster // A map that contains mappings from pool name to a list of tickets that satisfied the filters in the pool PoolNameToTickets map[string][]*pb.Ticket }
MatchFunctionParams is a protected view for the match function.