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: 2 modules, 15 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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