api_plugins

package
v0.0.0-...-cd49aae Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPlugins

func LoadPlugins(dir string) error

func Register

func Register(name string, apiPlugin APIPlugin)

func SetLoggerForAllPlugins

func SetLoggerForAllPlugins(sysLog syslogwrapper.SyslogWrapperInterface)

Types

type APIPlugin

type APIPlugin interface {
	FetchData() (interface{}, error)
	Schema() string
	TablePrefix() string
	ValidateConfig(config json.RawMessage) error
	Interval() (int, error)
	SetLogger(sysLog syslogwrapper.SyslogWrapperInterface)
	GetFieldNames() []string
	GetValues(record interface{}) []interface{}
	Name() string // Added method
}

func InitPlugin

func InitPlugin(name string) (APIPlugin, error)

type PluginSpec

type PluginSpec struct {
	Name   string                 `yaml:"name"`
	Config map[string]interface{} `yaml:"config"`
}

type Response

type Response struct {
	Records []interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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