plugins

package
v0.0.0-...-54d14c8 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 9 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PluginConfigPath = path.Join(settings.ConfigPath, "plugins-enabled")

PluginConfigPath - XXX

View Source
var Plugins = map[string]PluginRegistry{}

Plugins - XXX

Functions

func Add

func Add(name string, registry PluginRegistry)

Add - XXX

func ReadPluginConfig

func ReadPluginConfig(plugin string) ([]byte, error)

ReadPluginConfig - Reads the file from the expected path and returns it as bytes

func UmarshalPluginConfig

func UmarshalPluginConfig(plugin string) (interface{}, error)

UmarshalPluginConfig - Converts bytes to interface

Types

type ConfiguredPlugin

type ConfiguredPlugin struct {
	Name   string
	Plugin Plugin
}

ConfiguredPlugin - XXX

type Plugin

type Plugin interface {

	// Description returns a one-sentence description on the Plugin
	Description() string

	SampleConfig() string

	// Collects all the metrics and returns a struct with the results
	Collect() (interface{}, error)

	// Start starts the service - Optional
	Start() error

	// Stop stops the services and closes any necessary channels and connections - Optional
	Stop()
}

Plugin - XXX

type PluginConfig

type PluginConfig struct {
	Path string
	Name string
}

PluginConfig - XXX

func GetAllEnabledPlugins

func GetAllEnabledPlugins() ([]PluginConfig, error)

GetAllEnabledPlugins - XXX

func GetConfigPath

func GetConfigPath(plugin string) (PluginConfig, error)

GetConfigPath - Simple function that generates the plugin config path for the current distro

type PluginRegistry

type PluginRegistry func() Plugin

PluginRegistry - XXX

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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