file

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConfig

type BaseConfig struct {
	BatchSize    int            `json:"batchSize"`    //单次批量写入数
	BatchTimeout time2.Duration `json:"batchTimeout"` //单次批量写入超时时间
}

BaseConfig 基础文件流输出配置

func NewBaseConfig

func NewBaseConfig(conf *config.JSON) (*BaseConfig, error)

NewBaseConfig 通过json配置获取基础文件流输出配置

func (*BaseConfig) GetBatchSize

func (b *BaseConfig) GetBatchSize() int

GetBatchSize 单次批量写入数

func (*BaseConfig) GetBatchTimeout

func (b *BaseConfig) GetBatchTimeout() time.Duration

GetBatchTimeout 单次批量写入超时时间

type Config

type Config interface {
	GetBatchSize() int              //单次批量写入数
	GetBatchTimeout() time.Duration //单次批量写入超时时间
}

Config 文件流输出配置

type Job

type Job struct {
	*plugin.BaseJob
}

Job 工作

func NewJob

func NewJob() *Job

NewJob 创建工作

func (*Job) Destroy

func (j *Job) Destroy(ctx context.Context) (err error)

Destroy 销毁

type Task

type Task struct {
	*writer.BaseTask
	// contains filtered or unexported fields
}

Task 任务

func NewTask

func NewTask(newConfig func(conf *config.JSON) (Config, error)) *Task

NewTask 通过获取配置newConfig创建任务

func (*Task) Destroy

func (t *Task) Destroy(ctx context.Context) (err error)

Destroy 销毁

func (*Task) Init

func (t *Task) Init(ctx context.Context) (err error)

Init 初始化

func (*Task) StartWrite

func (t *Task) StartWrite(ctx context.Context, receiver plugin.RecordReceiver) (err error)

StartWrite 开始写

Jump to

Keyboard shortcuts

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