plugins

package
v1.20.82 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: Zlib Imports: 3 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, ctx context.Context, key string, d interface{}) (interface{}, error)

func DoWithError added in v0.5.24

func DoWithError(name string, ctx context.Context, key 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, ctx context.Context, key 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
	// key parameter is custom defined
	// d parameter is can use Command or custom
	// return is custom
	Do(ctx context.Context, key string, d interface{}) (interface{}, error)
	DoChan(ctx context.Context, key 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