schema

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	STOP Action = iota
	CONTINUE
	SKIP
)

type Buffer

type Buffer interface {
	Write([]byte) error
	Read() []byte
}

type Cfg

type Cfg struct {
	Viper  *viper.Viper
	Logger log.Logger
}

type Container

type Container interface {
	Init() error
	FInit() error
	Add([]Plugin) error
	Remove(string) error
	Get(...string) ([]Plugin, error)
}

type Loader

type Loader interface {
	Init() error
	FInit() error
	Load(...NewPlugin) ([]Plugin, error)
}

type NewPlugin

type NewPlugin = func(*Cfg) (Plugin, error)
var NewPluginObj NewPlugin

type Opts

type Opts interface {
	Set(interface{}, interface{})
	Get(interface{}) (interface{}, bool)
}

type Plugin

type Plugin interface {
	Name() string
	Init() error
	FInit() error
	Interest(msg *proto.Msg, tools PluginTools) (Action, error)
	PreProcess(msg *proto.Msg, tools PluginTools) (Action, error)
	Process(msg *proto.Msg, tools PluginTools) (Action, error)
	PostProcess(msg *proto.Msg, tools PluginTools) (Action, error)
}

type PluginTools

type PluginTools interface {
	Opts
	Buffer
}

Jump to

Keyboard shortcuts

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