gatewayinfo

package
v2.3.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2018 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestBurst = 50

RequestBurst sets the burst of requests to the account server

View Source
var RequestInterval = 50 * time.Millisecond

RequestInterval sets how often the account server may be queried

Functions

This section is empty.

Types

type Public

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

Public gateway information will be injected

func NewPublic

func NewPublic(accountServer string) *Public

NewPublic returns a middleware that injects public gateway information

func (*Public) HandleConnect

func (p *Public) HandleConnect(ctx middleware.Context, msg *types.ConnectMessage) error

HandleConnect fetches public gateway information in the background when a ConnectMessage is received

func (*Public) HandleDisconnect

func (p *Public) HandleDisconnect(ctx middleware.Context, msg *types.DisconnectMessage) error

HandleDisconnect cleans up

func (*Public) HandleStatus

func (p *Public) HandleStatus(ctx middleware.Context, msg *types.StatusMessage) error

HandleStatus inserts metadata if set in info, but not present in message

func (*Public) WithExpire

func (p *Public) WithExpire(duration time.Duration) *Public

WithExpire adds an expiration to gateway information. Information is re-fetched if expired

func (*Public) WithRedis

func (p *Public) WithRedis(client *redis.Client, prefix string) (*Public, error)

WithRedis initializes the Redis store for persistence between restarts

Jump to

Keyboard shortcuts

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