aoptypes

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.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 Save all types of call chains under different trigger

func (TuneGroup) GetTuneChainByTypeAndTrigger

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

GetTuneChainByTypeAndTrigger Return TuneChain by TuneType and TuneTrigger

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