core

package
v0.0.0-...-7429660 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core interface {
	// Use 应用插件
	Use(...Plugin) Core
	// Next 下一步
	Next(context.Context)
	// AbortErr 放弃后续执行并设置错误
	AbortErr(error)
	// Abort 放弃后续执行
	Abort()
	// IsAborted 是否已放弃
	IsAborted() bool
	// Err 获取执行中的错误
	Err() error
	// Copy 复制
	Copy() Core
	// Index 索引
	Index() int
	// Reset 重置
	Reset(idx int)
}

Core 插件管理器接口

func New

func New(ps []Plugin) Core

New 构造插件处理器

type Function

type Function func(context.Context, Core)

Function 插件函数原型

func (Function) Do

func (f Function) Do(ctx context.Context, core Core)

type Plugin

type Plugin interface {
	// Do 处理
	Do(context.Context, Core)
}

Plugin 插件接口

Jump to

Keyboard shortcuts

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