rcon

package
v0.0.0-...-16a83fc Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynmapChunkloadingStat

type DynmapChunkloadingStat struct {
	State    string
	Count    int
	Duration float64
}

type DynmapRenderStat

type DynmapRenderStat struct {
	Dim                          string
	Processed, Rendered, Updated int
}

type EntityCount

type EntityCount struct {
	Name  string
	Count int
}

type ErrRCONConnectionTimeout

type ErrRCONConnectionTimeout struct{}

func (ErrRCONConnectionTimeout) Error

func (e ErrRCONConnectionTimeout) Error() string

type ErrRCONMissingHost

type ErrRCONMissingHost struct{}

func (ErrRCONMissingHost) Error

func (e ErrRCONMissingHost) Error() string

type ErrRCONMissingPassword

type ErrRCONMissingPassword struct{}

func (ErrRCONMissingPassword) Error

func (e ErrRCONMissingPassword) Error() string

type ErrRCONMissingPort

type ErrRCONMissingPort struct{}

func (ErrRCONMissingPort) Error

func (e ErrRCONMissingPort) Error() string

type RCONClient

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

func NewRCONClient

func NewRCONClient(host string, port int, password string) (*RCONClient, error)

Creates an RCON client, does not create a connection immediatly

func (*RCONClient) Close

func (c *RCONClient) Close() error

Close the RCON connection if necessary

func (*RCONClient) CloseConn

func (c *RCONClient) CloseConn() error

Closes the RCON Connection and sets it to nil

func (*RCONClient) GetDynmapStats

func (c *RCONClient) GetDynmapStats() ([]DynmapRenderStat, []DynmapChunkloadingStat, error)

Get the render statistics returned from Dynmap

func (*RCONClient) GetForgeEntities

func (c *RCONClient) GetForgeEntities() ([]EntityCount, error)

Get the count and name of all loaded forge entities

func (*RCONClient) GetForgeTPS

func (c *RCONClient) GetForgeTPS() ([]TPSStat, TPSStat, error)

Get the TPS statistics returned from forge

func (*RCONClient) GetPaperTPS

func (c *RCONClient) GetPaperTPS() ([]float64, error)

Get the TPS statistics returned from paper

func (*RCONClient) GetPlayersOnline

func (c *RCONClient) GetPlayersOnline() []string

Return a list of all players currently online

type RCONCollector

type RCONCollector struct {
	ServerType    string
	DynmapEnabled bool
	// contains filtered or unexported fields
}

func NewRCONCollector

func NewRCONCollector(cfg config.Config) (*RCONCollector, error)

Create new instance of collector, returns error if RCON is not correctly configured not provided Arguments:

cfg: Configuration for minecraft-exporter. Needs RCON to be filled out in full

func (*RCONCollector) Close

func (c *RCONCollector) Close() error

Close the RCON connection

func (*RCONCollector) Collect

func (c *RCONCollector) Collect(ch chan<- prometheus.Metric)

Implements the Collect function for prometheus.Collector

func (*RCONCollector) Describe

func (c *RCONCollector) Describe(ch chan<- *prometheus.Desc)

Implements the Describe function for prometheus.Collector

type TPSStat

type TPSStat struct {
	ID, Name string
	Ticktime float64
	TPS      float64
}

Jump to

Keyboard shortcuts

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