gateway

package
v0.0.0-...-07b2db6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetQuiet

func SetQuiet()

SetQuiet logging

Types

type Credentials

type Credentials struct {
	Username string
}

Credentials for authentication

type CurrentMatch

type CurrentMatch struct {
}

CurrentMatch serializable struct to bring client up to speed

type Gateway

type Gateway struct {
	WSBackend *url.URL
	BasePath  string
	Port      int
}

Gateway is the server that serves static files and proxies to the different backends

func (*Gateway) Serve

func (gw *Gateway) Serve()

Serve static files and proxy to the different backends

type SessionResponse

type SessionResponse struct {
	Credentials Credentials
	InMatch     bool
	Match       CurrentMatch
}

SessionResponse serializable struct to send client's session

type TTLMap

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

TTLMap is a map with a TTL

func NewTTLMap

func NewTTLMap(ln int, maxTTL int, gcFrequencySecs int) (m *TTLMap)

NewTTLMap creates a new map

func (*TTLMap) Get

func (m *TTLMap) Get(k string) (v *model.Player, err error)

Get gets value for key k

func (*TTLMap) Len

func (m *TTLMap) Len() int

Len returns the length of the map

func (*TTLMap) Put

func (m *TTLMap) Put(k string, v *model.Player) error

Put puts key k and value v

func (*TTLMap) Refresh

func (m *TTLMap) Refresh(k, newk string) error

Refresh updates the key k to newk

Jump to

Keyboard shortcuts

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