plugins

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2022 License: Zlib Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	KAlarm = "alarm"
)

Variables

This section is empty.

Functions

func Add added in v0.1.7

func Add(name string, p Plugin)

func Do added in v0.1.6

func Do(name string, d interface{}) (interface{}, error)

func DoWithError added in v0.5.24

func DoWithError(name string, d interface{}) error

DoWithError 只关心error

func Remove added in v0.1.7

func Remove(name string)

Types

type Chan added in v0.5.24

type Chan chan Data

func DoChan added in v0.5.24

func DoChan(name string, d interface{}) (Chan, error)

type Command added in v0.5.41

type Command struct {
	Cmd  string
	Data interface{}
}

type Data added in v0.5.24

type Data struct {
	Error error
	Data  interface{}
}

type Plugin added in v0.1.6

type Plugin interface {
	// Do
	// name is plugin's name
	// d parameter is can use Command or custom
	// return is custom
	Do(name string, d interface{}) (interface{}, error)
	DoChan(name string, d interface{}) (Chan, error)
}

func Get

func Get(name string) Plugin

type Plugins

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

Jump to

Keyboard shortcuts

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