backend

package
v0.2.0-alpha-RC1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package backend is a generated protocol buffer package.

It is generated from these files:

backend.proto

It has these top-level messages:

Profile
MatchObject
Roster
Filter
Stats
PlayerPool
Player
Result
IlInput
Timestamp
ConnectionInfo
Assignments

backend is a package compiled from the protobuffer in <REPO_ROOT>/api/protobuf-spec/backend.proto. It is auto-generated and shouldn't be edited.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAPIServer

func RegisterAPIServer(s *grpc.Server, srv APIServer)

Types

type APIClient

type APIClient interface {
	// Calls to ask the matchmaker to run a matchmaking function.
	//
	// Run MMF once.  Return a matchobject that fits this profile.
	CreateMatch(ctx context.Context, in *Profile, opts ...grpc.CallOption) (*MatchObject, error)
	// Continually run MMF and stream matchobjects that fit this profile until
	// client closes the connection.
	ListMatches(ctx context.Context, in *Profile, opts ...grpc.CallOption) (API_ListMatchesClient, error)
	// Delete a matchobject from state storage manually. (Matchobjects in state
	// storage will also automatically expire after a while)
	DeleteMatch(ctx context.Context, in *MatchObject, opts ...grpc.CallOption) (*Result, error)
	// Call for communication of connection info to players.
	//
	// Write the connection info for the list of players in the
	// Assignments.Rosters to state storage.  The FrontendAPI is responsible for
	// sending anything written here to the game clients.
	// TODO: change this to be agnostic; return a 'result' instead of a connection
	// string so it can be integrated with session service etc
	CreateAssignments(ctx context.Context, in *Assignments, opts ...grpc.CallOption) (*Result, error)
	// Remove DGS connection info from state storage for all players in the Roster.
	DeleteAssignments(ctx context.Context, in *Roster, opts ...grpc.CallOption) (*Result, error)
}

func NewAPIClient

func NewAPIClient(cc *grpc.ClientConn) APIClient

type APIServer

type APIServer interface {
	// Calls to ask the matchmaker to run a matchmaking function.
	//
	// Run MMF once.  Return a matchobject that fits this profile.
	CreateMatch(context.Context, *Profile) (*MatchObject, error)
	// Continually run MMF and stream matchobjects that fit this profile until
	// client closes the connection.
	ListMatches(*Profile, API_ListMatchesServer) error
	// Delete a matchobject from state storage manually. (Matchobjects in state
	// storage will also automatically expire after a while)
	DeleteMatch(context.Context, *MatchObject) (*Result, error)
	// Call for communication of connection info to players.
	//
	// Write the connection info for the list of players in the
	// Assignments.Rosters to state storage.  The FrontendAPI is responsible for
	// sending anything written here to the game clients.
	// TODO: change this to be agnostic; return a 'result' instead of a connection
	// string so it can be integrated with session service etc
	CreateAssignments(context.Context, *Assignments) (*Result, error)
	// Remove DGS connection info from state storage for all players in the Roster.
	DeleteAssignments(context.Context, *Roster) (*Result, error)
}

type API_ListMatchesClient

type API_ListMatchesClient interface {
	Recv() (*MatchObject, error)
	grpc.ClientStream
}

type API_ListMatchesServer

type API_ListMatchesServer interface {
	Send(*MatchObject) error
	grpc.ServerStream
}

type Assignments

type Assignments struct {
	Rosters        []*Roster       `protobuf:"bytes,1,rep,name=rosters" json:"rosters,omitempty"`
	ConnectionInfo *ConnectionInfo `protobuf:"bytes,2,opt,name=connection_info,json=connectionInfo" json:"connection_info,omitempty"`
}

func (*Assignments) Descriptor

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

func (*Assignments) GetConnectionInfo

func (m *Assignments) GetConnectionInfo() *ConnectionInfo

func (*Assignments) GetRosters

func (m *Assignments) GetRosters() []*Roster

func (*Assignments) ProtoMessage

func (*Assignments) ProtoMessage()

func (*Assignments) Reset

func (m *Assignments) Reset()

func (*Assignments) String

func (m *Assignments) String() string

type ConnectionInfo

type ConnectionInfo struct {
	ConnectionString string `protobuf:"bytes,1,opt,name=connection_string,json=connectionString" json:"connection_string,omitempty"`
}

Simple message used to pass the connection string for the DGS to the player.

func (*ConnectionInfo) Descriptor

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

func (*ConnectionInfo) GetConnectionString

func (m *ConnectionInfo) GetConnectionString() string

func (*ConnectionInfo) ProtoMessage

func (*ConnectionInfo) ProtoMessage()

func (*ConnectionInfo) Reset

func (m *ConnectionInfo) Reset()

func (*ConnectionInfo) String

func (m *ConnectionInfo) String() string

type Filter

type Filter struct {
	Name      string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Attribute string `protobuf:"bytes,2,opt,name=attribute" json:"attribute,omitempty"`
	Maxv      int64  `protobuf:"varint,3,opt,name=maxv" json:"maxv,omitempty"`
	Minv      int64  `protobuf:"varint,4,opt,name=minv" json:"minv,omitempty"`
	Stats     *Stats `protobuf:"bytes,5,opt,name=stats" json:"stats,omitempty"`
}

A filter to apply to the player pool.

func (*Filter) Descriptor

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

func (*Filter) GetAttribute

func (m *Filter) GetAttribute() string

func (*Filter) GetMaxv

func (m *Filter) GetMaxv() int64

func (*Filter) GetMinv

func (m *Filter) GetMinv() int64

func (*Filter) GetName

func (m *Filter) GetName() string

func (*Filter) GetStats

func (m *Filter) GetStats() *Stats

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) Reset

func (m *Filter) Reset()

func (*Filter) String

func (m *Filter) String() string

type IlInput

type IlInput struct {
}

IlInput is an empty message reserved for future use.

func (*IlInput) Descriptor

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

func (*IlInput) ProtoMessage

func (*IlInput) ProtoMessage()

func (*IlInput) Reset

func (m *IlInput) Reset()

func (*IlInput) String

func (m *IlInput) String() string

type MatchObject

type MatchObject struct {
	Id         string        `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Properties string        `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
	Rosters    []*Roster     `protobuf:"bytes,3,rep,name=rosters" json:"rosters,omitempty"`
	Pools      []*PlayerPool `protobuf:"bytes,4,rep,name=pools" json:"pools,omitempty"`
}

A MMF takes the Profile object above, and generates a MatchObject.

func (*MatchObject) Descriptor

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

func (*MatchObject) GetId

func (m *MatchObject) GetId() string

func (*MatchObject) GetPools

func (m *MatchObject) GetPools() []*PlayerPool

func (*MatchObject) GetProperties

func (m *MatchObject) GetProperties() string

func (*MatchObject) GetRosters

func (m *MatchObject) GetRosters() []*Roster

func (*MatchObject) ProtoMessage

func (*MatchObject) ProtoMessage()

func (*MatchObject) Reset

func (m *MatchObject) Reset()

func (*MatchObject) String

func (m *MatchObject) String() string

type Player

type Player struct {
	Id         string              `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Properties string              `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
	Pool       string              `protobuf:"bytes,3,opt,name=pool" json:"pool,omitempty"`
	Attributes []*Player_Attribute `protobuf:"bytes,4,rep,name=attributes" json:"attributes,omitempty"`
}

Data structure for a profile to pass to the matchmaking function.

func (*Player) Descriptor

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

func (*Player) GetAttributes

func (m *Player) GetAttributes() []*Player_Attribute

func (*Player) GetId

func (m *Player) GetId() string

func (*Player) GetPool

func (m *Player) GetPool() string

func (*Player) GetProperties

func (m *Player) GetProperties() string

func (*Player) ProtoMessage

func (*Player) ProtoMessage()

func (*Player) Reset

func (m *Player) Reset()

func (*Player) String

func (m *Player) String() string

type PlayerPool

type PlayerPool struct {
	Name    string    `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Filters []*Filter `protobuf:"bytes,2,rep,name=filters" json:"filters,omitempty"`
	Roster  *Roster   `protobuf:"bytes,3,opt,name=roster" json:"roster,omitempty"`
	Stats   *Stats    `protobuf:"bytes,4,opt,name=stats" json:"stats,omitempty"`
}

func (*PlayerPool) Descriptor

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

func (*PlayerPool) GetFilters

func (m *PlayerPool) GetFilters() []*Filter

func (*PlayerPool) GetName

func (m *PlayerPool) GetName() string

func (*PlayerPool) GetRoster

func (m *PlayerPool) GetRoster() *Roster

func (*PlayerPool) GetStats

func (m *PlayerPool) GetStats() *Stats

func (*PlayerPool) ProtoMessage

func (*PlayerPool) ProtoMessage()

func (*PlayerPool) Reset

func (m *PlayerPool) Reset()

func (*PlayerPool) String

func (m *PlayerPool) String() string

type Player_Attribute

type Player_Attribute struct {
	Name  string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Value int64  `protobuf:"varint,2,opt,name=value" json:"value,omitempty"`
}

func (*Player_Attribute) Descriptor

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

func (*Player_Attribute) GetName

func (m *Player_Attribute) GetName() string

func (*Player_Attribute) GetValue

func (m *Player_Attribute) GetValue() int64

func (*Player_Attribute) ProtoMessage

func (*Player_Attribute) ProtoMessage()

func (*Player_Attribute) Reset

func (m *Player_Attribute) Reset()

func (*Player_Attribute) String

func (m *Player_Attribute) String() string

type Profile

type Profile struct {
	Id         string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Properties string `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
	Name       string `protobuf:"bytes,3,opt,name=name" json:"name,omitempty"`
	// When you send a Profile to the backendAPI, it looks to see if you populated
	// this field with protobuf-encoded PlayerPool objects containing valid the filters
	// objects.  If you did, they are used by OM.  If you didn't, the backendAPI
	// next looks in your properties blob at the key specified in the 'jsonkeys.pools'
	// config value from config/matchmaker_config.json - If it finds valid player
	// pool definitions at that key, it will try to unmarshal them into this field.
	// If you didn't specify valid player pools in either place, OM assumes you
	// know what you're doing and just leaves this unpopulatd.
	Pools []*PlayerPool `protobuf:"bytes,4,rep,name=pools" json:"pools,omitempty"`
}

func (*Profile) Descriptor

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

func (*Profile) GetId

func (m *Profile) GetId() string

func (*Profile) GetName

func (m *Profile) GetName() string

func (*Profile) GetPools

func (m *Profile) GetPools() []*PlayerPool

func (*Profile) GetProperties

func (m *Profile) GetProperties() string

func (*Profile) ProtoMessage

func (*Profile) ProtoMessage()

func (*Profile) Reset

func (m *Profile) Reset()

func (*Profile) String

func (m *Profile) String() string

type Result

type Result struct {
	Success bool   `protobuf:"varint,1,opt,name=success" json:"success,omitempty"`
	Error   string `protobuf:"bytes,2,opt,name=error" json:"error,omitempty"`
}

Simple message to return success/failure and error status.

func (*Result) Descriptor

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

func (*Result) GetError

func (m *Result) GetError() string

func (*Result) GetSuccess

func (m *Result) GetSuccess() bool

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

type Roster

type Roster struct {
	Name    string    `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Players []*Player `protobuf:"bytes,2,rep,name=players" json:"players,omitempty"`
}

Data structure to hold a list of players in a match.

func (*Roster) Descriptor

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

func (*Roster) GetName

func (m *Roster) GetName() string

func (*Roster) GetPlayers

func (m *Roster) GetPlayers() []*Player

func (*Roster) ProtoMessage

func (*Roster) ProtoMessage()

func (*Roster) Reset

func (m *Roster) Reset()

func (*Roster) String

func (m *Roster) String() string

type Stats

type Stats struct {
	Count   int64   `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
	Elapsed float64 `protobuf:"fixed64,2,opt,name=elapsed" json:"elapsed,omitempty"`
}

func (*Stats) Descriptor

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

func (*Stats) GetCount

func (m *Stats) GetCount() int64

func (*Stats) GetElapsed

func (m *Stats) GetElapsed() float64

func (*Stats) ProtoMessage

func (*Stats) ProtoMessage()

func (*Stats) Reset

func (m *Stats) Reset()

func (*Stats) String

func (m *Stats) String() string

type Timestamp

type Timestamp struct {
	Ts int64 `protobuf:"varint,1,opt,name=ts" json:"ts,omitempty"`
}

Epoch timestamp in seconds.

func (*Timestamp) Descriptor

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

func (*Timestamp) GetTs

func (m *Timestamp) GetTs() int64

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) Reset

func (m *Timestamp) Reset()

func (*Timestamp) String

func (m *Timestamp) String() string

Jump to

Keyboard shortcuts

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