platform

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const LOG_INTERVAL = 3 * 60 * 10

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(set *pflag.FlagSet)

func GetSource

func GetSource(name string, fileHandler Configer, ctx context.Context, tailMode bool) (source.Reader, error)

GetSource 按名称获得并初始化一个指定来源

func Register

func Register(name string, handler Handler)

Types

type Configer

type Configer interface {
	IsLocalFile() bool
	GetFileName() string
	OpenFile() (io.Reader, error)
	GetTimeFormat() string
}

Configer 配置来源文件,获取来源文件的属性,获得文件描述符的适配接口

type Handler

type Handler interface {
	AddFlags(*pflag.FlagSet)
	GetNotifier(ncfg *notify.Config, ctx context.Context) (Notifier, error)
	GetSource(fileHandler Configer, ctx context.Context, tailMode bool) (source.Reader, error)
}

type HandlerNeedCheck added in v0.9.0

type HandlerNeedCheck interface {
	Check(fileHandler Configer) error
}

type Notifier

type Notifier interface {
	ListExistedEntrys() (map[string]*entry.LogEntry, error)
	NotifyDel(...*entry.LogEntry) error
}

Notifier有两种实现模式,一种是批量,一种是单条,因此Notifier类型作为通用类型,只是interface{}

func GetNotifier

func GetNotifier(name string, ctx context.Context, ncfg *notify.Config, platCfg Configer) (Notifier, error)

type Source

type Source interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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