entity

package
v0.0.0-...-d0c4231 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandlers

func NewHandlers(handlerData map[string]interface{}) (map[string]Handler, error)

func NewInputs

func NewInputs(inputData map[string]interface{}) (map[string]Input, error)

func NewOutputs

func NewOutputs(outputData map[string]interface{}) (map[string]Output, error)

Types

type FileWatcher

type FileWatcher struct {
	Path    string
	File    *os.File
	Offset  int64
	Watcher *fsnotify.Watcher
}

func NewFileWatcher

func NewFileWatcher(path string) *FileWatcher

func (*FileWatcher) ReWatch

func (wf *FileWatcher) ReWatch() error

type Handler

type Handler struct {
	ScriptPath string     `mapstructure:"script_path"`
	AddData    *sync.Map  `mapstructure:"add_data"`
	Lua        *lua.State `mapstructure:"-"`
}

type Input

type Input struct {
	Type          string // file or docker
	Path          string
	CName         []string // 容器名称
	Files         []string
	Format        string
	Regex         string
	CompiledRegex *regexp.Regexp
	DockerLogPath string            `mapstructure:"docker_log_path"`
	FileMap       map[string]string // file 与 containerName 之间的映射
}

type Message

type Message struct {
	Service   string
	Source    string
	Table     string
	Container string
	AddData   map[string]interface{}
	Message   interface{}
	HostName  string
}

func NewMessage

func NewMessage(source string, table string, container string, addData map[string]interface{}, message map[string]interface{}) *Message

type Output

type Output struct {
	Type          string
	HttpURL       string            `mapstructure:"http_url"`
	HttpHeaders   map[string]string `mapstructure:"http_headers"`
	RedisAddr     string            `mapstructure:"redis_addr"`
	RedisDB       int               `mapstructure:"redis_db"`
	RedisKey      string            `mapstructure:"redis_key"`
	MySQLHost     string            `mapstructure:"mysql_host"`
	MySQLPort     int               `mapstructure:"mysql_port"`
	MySQLDb       string            `mapstructure:"mysql_db"`
	MySQLUser     string            `mapstructure:"mysql_user"`
	MySQLPassword string            `mapstructure:"mysql_password"`
	HostName      string
}

Jump to

Keyboard shortcuts

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