connections

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionOptions

type ConnectionOptions struct {
	Addr                 string
	Mode                 config.QueryMode
	RCONPassword         string
	ConnectTimeout       time.Duration
	CacheExpiration      time.Duration
	CacheCleanupInterval time.Duration
}

ConnectionOptions options for a Connection

type IConnection

type IConnection interface {
	Reconnect() error
	Close()
	GetMap() (string, error)
	GetPlayerCount() (*models.PlayerCount, error)
	GetPlayers() (map[string]*models.Player, error)
}

func NewRCON

func NewRCON(name string, opts *ConnectionOptions) IConnection

func NewServerQuery

func NewServerQuery(name string, opts *ConnectionOptions, log *logrus.Logger) IConnection

type RCON

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

func (*RCON) Close

func (c *RCON) Close()

Close closes the RCON connection

func (*RCON) GetMap

func (c *RCON) GetMap() (string, error)

GetMap return map of server

func (*RCON) GetPlayerCount

func (c *RCON) GetPlayerCount() (*models.PlayerCount, error)

GetPlayerCount return server player count

func (*RCON) GetPlayers

func (c *RCON) GetPlayers() (map[string]*models.Player, error)

func (*RCON) Reconnect

func (c *RCON) Reconnect() error

type ServerQuery

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

func (*ServerQuery) Close

func (c *ServerQuery) Close()

Close closes the RCON connection

func (*ServerQuery) GetMap

func (c *ServerQuery) GetMap() (string, error)

GetMap return map of server

func (*ServerQuery) GetPlayerCount

func (c *ServerQuery) GetPlayerCount() (*models.PlayerCount, error)

GetPlayerCount return server player count

func (*ServerQuery) GetPlayers

func (c *ServerQuery) GetPlayers() (map[string]*models.Player, error)

func (*ServerQuery) Reconnect

func (c *ServerQuery) Reconnect() error

Jump to

Keyboard shortcuts

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