plugins

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: BSD-3-Clause Imports: 14 Imported by: 0

README

Lua

plugin_stat:name()

Return plugin name.

plugin_stat:dir()

Return current plugin directory.

plugin:error_count()

Return count of errors in current plugin.

plugin:start_count()

Return count of starts of current plugin.

plugin:last_error()

Return last error (nil or string).

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	Host     string            `yaml:"host"`
	DBName   string            `yaml:"dbname"`
	Port     int               `yaml:"port"`
	UserName string            `yaml:"username"`
	Password string            `yaml:"password"`
	Params   map[string]string `yaml:"params"`
}

Connection to PostgreSQL

type PluginStatistic

type PluginStatistic struct {
	Host           string
	PluginName     string
	PluginFileName string
	Starts         int
	Errors         int
	LastCheck      int64
	LastError      string
}

PluginStatistic represent statistics for plugin

type Pool

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

Pool of plugins

func NewPool

func NewPool(rootDir string, globalCacheDir string) *Pool

NewPool return new Pool

func (*Pool) AddPluginToHost

func (p *Pool) AddPluginToHost(pluginName, host string, secrets *secrets.Storage) error

AddPluginToHost add plugin to host

func (*Pool) PluginStatisticPerHost

func (p *Pool) PluginStatisticPerHost() map[string][]PluginStatistic

PluginStatisticPerHost statistic information about all host

func (*Pool) RegisterHost

func (p *Pool) RegisterHost(host string, connections map[string]*Connection)

RegisterHost register new host

func (*Pool) RemoveHostAndPlugins

func (p *Pool) RemoveHostAndPlugins(host string)

RemoveHostAndPlugins stop all plugins and remove host

func (*Pool) StopAndRemovePluginFromHost

func (p *Pool) StopAndRemovePluginFromHost(pluginName, host string) error

StopAndRemovePluginFromHost stop plugin on host

Jump to

Keyboard shortcuts

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