runner

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader 读取运行器

func NewReader

func NewReader(task reader.Task, sender plugin.RecordSender, taskKey string) *Reader

NewReader 通过读取任务task、记录发送器sender以及任务关键字taskKey创建读取运行器

func (*Reader) Plugin

func (r *Reader) Plugin() plugin.Task

Plugin 插件任务

func (*Reader) Run

func (r *Reader) Run(ctx context.Context) (err error)

Run 运行,运行顺序:Init->Prepare->StartRead->Post->Destroy

func (*Reader) Shutdown

func (r *Reader) Shutdown() error

Shutdown 关闭

type Runner

type Runner interface {
	Plugin() plugin.Task           //插件任务
	Shutdown() error               //关闭
	Run(ctx context.Context) error //运行
}

Runner 运行器

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer 写入运行器

func NewWriter

func NewWriter(task writer.Task, receiver plugin.RecordReceiver, taskKey string) *Writer

NewWriter 通过读取任务task、记录接受器receiver以及任务关键字taskKey创建写入运行器

func (*Writer) Plugin

func (w *Writer) Plugin() plugin.Task

Plugin 插件任务

func (*Writer) Run

func (w *Writer) Run(ctx context.Context) (err error)

Run 运行,运行顺序:Init->Prepare->StartWrite->Post->Destroy

func (*Writer) Shutdown

func (w *Writer) Shutdown() error

Shutdown 关闭

Jump to

Keyboard shortcuts

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