aoptypes

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CtxKeyTasks = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PipelineBaseTunePoint

type PipelineBaseTunePoint struct{}

func (PipelineBaseTunePoint) Type

type SDK

type SDK struct {
	Bundle   *bundle.Bundle
	DBClient *dbclient.Client
	Report   *reportsvc.ReportSvc

	TuneType    TuneType
	TuneTrigger TuneTrigger

	Pipeline spec.Pipeline
	Task     spec.PipelineTask
}

func (SDK) Clone

func (sdk SDK) Clone() SDK

type TaskBaseTunePoint

type TaskBaseTunePoint struct{}

func (TaskBaseTunePoint) Type

func (p TaskBaseTunePoint) Type() TuneType

type TuneChain

type TuneChain []TunePoint

TuneChain 表示一组有序 TunePoint

func (TuneChain) Handle

func (chain TuneChain) Handle(ctx *TuneContext) error

Handle 根据上下文调用 TuneChain

type TuneContext

type TuneContext struct {
	context.Context
	SDK SDK
}

func (*TuneContext) PutKV

func (ctx *TuneContext) PutKV(k, v interface{})

func (*TuneContext) TryGet

func (ctx *TuneContext) TryGet(k interface{}) (interface{}, bool)

type TuneGroup

type TuneGroup map[TuneType]map[TuneTrigger]TuneChain

TuneGroup 保存所有类型不同触发时机下的调用链

func (TuneGroup) GetTuneChainByTypeAndTrigger

func (g TuneGroup) GetTuneChainByTypeAndTrigger(pointType TuneType, trigger TuneTrigger) TuneChain

GetTuneChainByTypeAndTrigger 根据 类型 和 触发时机 返回 调用链

type TunePoint

type TunePoint interface {
	Type() TuneType
	Name() string
	Handle(*TuneContext) error
}

TunePoint 调音点

type TuneTrigger

type TuneTrigger string

TuneTrigger 调节的触发时机

const (
	TuneTriggerPipelineBeforeExec               TuneTrigger = "pipeline_before_exec"
	TuneTriggerPipelineInQueuePrecheckBeforePop TuneTrigger = "pipeline_in_queue_precheck_before_pop"
	TuneTriggerPipelineAfterExec                TuneTrigger = "pipeline_after_exec"

	TuneTriggerTaskBeforeExec    TuneTrigger = "task_before_exec"
	TuneTriggerTaskAfterExec     TuneTrigger = "task_after_exec"
	TuneTriggerTaskBeforePrepare TuneTrigger = "task_before_prepare"
	TuneTriggerTaskAfterPrepare  TuneTrigger = "task_after_prepare"
	TuneTriggerTaskBeforeCreate  TuneTrigger = "task_before_create"
	TuneTriggerTaskAfterCreate   TuneTrigger = "task_after_create"
	TuneTriggerTaskBeforeStart   TuneTrigger = "task_before_start"
	TuneTriggerTaskAfterStart    TuneTrigger = "task_after_start"
	TuneTriggerTaskBeforeQueue   TuneTrigger = "task_before_queue"
	TuneTriggerTaskAfterQueue    TuneTrigger = "task_after_queue"
	TuneTriggerTaskBeforeWait    TuneTrigger = "task_before_wait"
	TuneTriggerTaskAfterWait     TuneTrigger = "task_after_wait"
)

type TuneType

type TuneType string

TuneType 调节的类型

const (
	TuneTypePipeline TuneType = "pipeline" // pipeline 级别调节
	TuneTypeTask     TuneType = "task"     // task 级别调节
)

Jump to

Keyboard shortcuts

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