stats

package
v0.0.0-...-722ef49 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Tag  string
	Rcon *webrcon.RconClient
	Test bool
	// contains filtered or unexported fields
}

Client maintains the InfluxDB client connection

func (*Client) CollectStats

func (client *Client) CollectStats(done chan struct{}, wg *sync.WaitGroup)

CollectStats begins running the configured stats.

func (*Client) InitClient

func (client *Client) InitClient(host string, port int, database string, username string, password string, ssl bool)

InitClient establishes the InfluxDB connection and sets up queues

func (*Client) OnMessageMonitoredStat

func (client *Client) OnMessageMonitoredStat(message []byte)

OnMessageMonitoredStat implements the RCON client OnMessage callback, to be used for Monitored Stats.

func (*Client) RegisterInternalStat

func (client *Client) RegisterInternalStat(scriptpath string, interval int)

RegisterInternalStat registers an internal type stat.

func (*Client) RegisterInvokedStat

func (client *Client) RegisterInvokedStat(command string, scriptpath string, interval int)

RegisterInvokedStat registers an invoked type stat.

func (*Client) RegisterMonitoredStat

func (client *Client) RegisterMonitoredStat(pattern string, scriptpath string)

RegisterMonitoredStat registers a stat based on monitoring the RCON data.

type DiscordWebhookData

type DiscordWebhookData struct {
	Username string `json:"username,omitempty"`
	Content  string `json:"content"`
}

DiscordWebhookData contains a simple webhook message, no embed support (yet, maybe I dunno)

type InternalStats

type InternalStats struct {
	StatsImpl
	// contains filtered or unexported fields
}

InternalStats stats, or rather stats that just run at an interval with not RCON command.

type MonitoredStats

type MonitoredStats struct {
	StatsImpl
	// contains filtered or unexported fields
}

MonitoredStats style stats.

type SlackWebhookData

type SlackWebhookData struct {
	Text string `json:"text"`
}

SlackWebhookData contains the webhook message for slack

type Stats

type Stats struct {
	StatsImpl
	// contains filtered or unexported fields
}

Stats contains the configured stats plugins

type StatsImpl

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

StatsImpl defines the data all stat types use.

type TengoDiscordWebhook

type TengoDiscordWebhook struct {
	tengo.ObjectImpl
}

TengoDiscordWebhook defines the object for sending a discord webhook

func (*TengoDiscordWebhook) Call

func (o *TengoDiscordWebhook) Call(args ...tengo.Object) (ret tengo.Object, err error)

Call provides the logger functionality. discord_webhook(hookurl, content, [optional]username)

func (*TengoDiscordWebhook) CanCall

func (o *TengoDiscordWebhook) CanCall() bool

CanCall returns true since we're a function type.

func (*TengoDiscordWebhook) String

func (o *TengoDiscordWebhook) String() string

String returns the function name

func (*TengoDiscordWebhook) TypeName

func (o *TengoDiscordWebhook) TypeName() string

TypeName returns the function name

type TengoFieldEscape

type TengoFieldEscape struct {
	tengo.ObjectImpl
}

TengoFieldEscape defines the object for escaping field values

func (*TengoFieldEscape) Call

func (o *TengoFieldEscape) Call(args ...tengo.Object) (ret tengo.Object, err error)

Call provides the field escape functionality.

func (*TengoFieldEscape) CanCall

func (o *TengoFieldEscape) CanCall() bool

CanCall returns true since we're a function type.

func (*TengoFieldEscape) String

func (o *TengoFieldEscape) String() string

String returns the function name

func (*TengoFieldEscape) TypeName

func (o *TengoFieldEscape) TypeName() string

TypeName returns the function name

type TengoGlobals

type TengoGlobals struct {
	tengo.ObjectImpl
}

TengoGlobals defines the object that holds globals. We need this to enforce concurrency safety.

func (*TengoGlobals) IndexGet

func (o *TengoGlobals) IndexGet(index tengo.Object) (res tengo.Object, err error)

IndexGet returns the value for the given key.

func (*TengoGlobals) IndexSet

func (o *TengoGlobals) IndexSet(index, value tengo.Object) (err error)

IndexSet sets the value for the given key.

func (*TengoGlobals) String

func (o *TengoGlobals) String() string

String returns a string representation

func (*TengoGlobals) TypeName

func (o *TengoGlobals) TypeName() string

TypeName returns the type name

type TengoLock

type TengoLock struct {
	tengo.ObjectImpl
}

TengoLock defines the object type for a generic mutex lock function

func (*TengoLock) Call

func (o *TengoLock) Call(args ...tengo.Object) (ret tengo.Object, err error)

Call provides the lock functionality.

func (*TengoLock) CanCall

func (o *TengoLock) CanCall() bool

CanCall returns true since we're a function type.

func (*TengoLock) String

func (o *TengoLock) String() string

String returns the string lock

func (*TengoLock) TypeName

func (o *TengoLock) TypeName() string

TypeName returns the name lock

type TengoLogger

type TengoLogger struct {
	tengo.ObjectImpl
}

TengoLogger defines the object type for the logger functions

func (*TengoLogger) Call

func (o *TengoLogger) Call(args ...tengo.Object) (ret tengo.Object, err error)

Call provides the logger functionality.

func (*TengoLogger) CanCall

func (o *TengoLogger) CanCall() bool

CanCall returns true since we're a function type.

func (*TengoLogger) String

func (o *TengoLogger) String() string

String returns the logger name

func (*TengoLogger) TypeName

func (o *TengoLogger) TypeName() string

TypeName returns the logger name

type TengoSlackWebhook

type TengoSlackWebhook struct {
	tengo.ObjectImpl
}

TengoSlackWebhook defines the object for sending a slack webhook

func (*TengoSlackWebhook) Call

func (o *TengoSlackWebhook) Call(args ...tengo.Object) (ret tengo.Object, err error)

Call provides the logger functionality. slack_webhook(hookurl, text)

func (*TengoSlackWebhook) CanCall

func (o *TengoSlackWebhook) CanCall() bool

CanCall returns true since we're a function type.

func (*TengoSlackWebhook) String

func (o *TengoSlackWebhook) String() string

String returns the function name

func (*TengoSlackWebhook) TypeName

func (o *TengoSlackWebhook) TypeName() string

TypeName returns the function name

type TengoTagEscape

type TengoTagEscape struct {
	tengo.ObjectImpl
}

TengoTagEscape defines the object type for escaping tag values

func (*TengoTagEscape) Call

func (o *TengoTagEscape) Call(args ...tengo.Object) (ret tengo.Object, err error)

Call provides the escape functionality.

func (*TengoTagEscape) CanCall

func (o *TengoTagEscape) CanCall() bool

CanCall returns true since we're a function type.

func (*TengoTagEscape) String

func (o *TengoTagEscape) String() string

String returns the function name

func (*TengoTagEscape) TypeName

func (o *TengoTagEscape) TypeName() string

TypeName returns the function name

type TengoUnlock

type TengoUnlock struct {
	tengo.ObjectImpl
}

TengoUnlock defines the object type for a generic mutex unlock function

func (*TengoUnlock) Call

func (o *TengoUnlock) Call(args ...tengo.Object) (ret tengo.Object, err error)

Call provides the lock functionality.

func (*TengoUnlock) CanCall

func (o *TengoUnlock) CanCall() bool

CanCall returns true since we're a function type.

func (*TengoUnlock) String

func (o *TengoUnlock) String() string

String returns the string unlock

func (*TengoUnlock) TypeName

func (o *TengoUnlock) TypeName() string

TypeName returns the name unlock

Jump to

Keyboard shortcuts

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