Documentation ¶
Index ¶
- Constants
- Variables
- func AddCronTask(name, spec string, fun func() error) error
- func DelCronTask(name string) error
- func PluginDetail() string
- func RegistHandler(key string, a Adapter)
- func RegistInputer(key string, input Inputer)
- func RegistOutputer(key string, output Outputer)
- type Adapter
- type Codec
- type Config
- type Configer
- type Inject
- type Input
- type Inputer
- type Output
- type Outputer
- type PluginsMap
- type RuntimeConfig
- type Transport
Constants ¶
View Source
const ( B = 1 //1B = 8bit KB = 1024 * B //1KB MB = 1024 * KB //1MB GB = 1024 * MB //1GB TB = 1024 * GB //1TB PB = 1024 * TB //1PB )
View Source
const (
VERSION = "0.0.2"
)
Variables ¶
View Source
var ( ClosedError = errors.New("Closed") ReadBufferClosedError = errors.New("ReadBufferClosedError:chan is closed") WriteBufferClosedError = errors.New("WriteBufferClosedError:chan is closed") MaxBytesError = errors.New("MaxBytesError:message is larger than byte buffer") InputNullError = errors.New("InputError:plugin is null") OutputNullError = errors.New("OutputError:plugin is null") UnknownError = errors.New("UnknownError:unknow error") )
Functions ¶
func PluginDetail ¶
func PluginDetail() string
func RegistHandler ¶
func RegistInputer ¶
func RegistOutputer ¶
Types ¶
type Config ¶
type Config struct { Runtime *RuntimeConfig `json:"runtime"` InputConfig map[string]pluginConfig `json:"inputs"` HandleConfig map[string]pluginConfig `json:"handles"` OutputConfig map[string]pluginConfig `json:"outputs"` }
func (*Config) InitCodecs ¶
func (*Config) InitInputs ¶
func (*Config) InitOutputs ¶
type Inputer ¶
type Inputer interface { Init(Configer) error Start() error Read(p []byte) (n int, err error) Close() error Version() string }
数据输入接口
type Outputer ¶
type Outputer interface { Init(Configer) error Write(p []byte) (n int, err error) Start() error Close() error Version() string }
数据输入接口, 实现了标准io库中的ReadCloser接口
type PluginsMap ¶
type PluginsMap struct { Inputers map[string]Inputer Outputers map[string]Outputer Adapters map[string]Adapter }
var Plugins *PluginsMap
func NewPluginsMap ¶
func NewPluginsMap() *PluginsMap
type RuntimeConfig ¶
type RuntimeConfig struct { DEBUG bool `json:"DEBUG"` MAXPROCS int `json:"MAXPROCS"` BYTESIZE int `json:"BYTESIZE"` CHANSIZE int `json:"CHANSIZE"` VERSION string `json:"VERSION"` HTTP string `json:"HTTP"` }
func NewRuntimeConfig ¶
func NewRuntimeConfig() *RuntimeConfig
Source Files ¶
Click to show internal directories.
Click to hide internal directories.