Documentation ¶
Index ¶
- Constants
- Variables
- func NewChooseClusterFactory(chooseFn func(ctx context.Context, state ogcore.State) int) func() ogcore.Node
- func NewConditionWrapperFactory(cond func(ctx context.Context, state ogcore.State) bool) func() ogcore.Node
- func NewRetryWrapper(times int) ogcore.Node
- func NewSlientWrapper() ogcore.Node
- func NewTimeoutWrapper(timeout time.Duration) ogcore.Node
- func SetTraceId(state ogcore.State, id string)
- type AsyncWrapper
- type ChooseCluster
- type CmdNode
- type ConditionWrapper
- type DebugWrapper
- type DelayWrapper
- type FastState
- type GuardState
- type HookState
- type LoopWrapper
- type OverlayState
- type ParallelCluster
- type RaceCluster
- type RetryWrapper
- type SlientWrapper
- type StateHookFn
- type TimeoutWrapper
- type TraceWrapper
Constants ¶
View Source
const ( CMD = "CMD" Choose = "Choose" Parallel = "Parallel" Race = "Race" Async = "Async" Condition = "Condition" Loop = "Loop" Retry = "Retry" Slient = "Slient" Timeout = "Timeout" Trace = "Trace" Delay = "Delay" Debug = "Debug" )
View Source
const ( AllowRead = 1 << iota AllowWrite )
Variables ¶
View Source
var AsyncWrapperFactory = func() ogcore.Node { return &AsyncWrapper{} }
View Source
var ChooseClusterFactory = func() ogcore.Node { return &ChooseCluster{} }
View Source
var CmdNodeFactory = func() ogcore.Node { return &CmdNode{} }
View Source
var ConditionWrapperFactory = func() ogcore.Node { return &ConditionWrapper{} }
View Source
var DebugWrapperFactory = func() ogcore.Node { return &DebugWrapper{} }
View Source
var DelayWrapperFactory = func() ogcore.Node { return &DelayWrapper{} }
View Source
var ErrTimeout = errors.New("the running time exceeds the limit")
View Source
var LoopWrapperFactory = func() ogcore.Node { return &LoopWrapper{LoopTimes: 1} }
View Source
var ParallelClusterFactory = func() ogcore.Node { return &ParallelCluster{} }
View Source
var RaceClusterFactory = func() ogcore.Node { return &RaceCluster{} }
View Source
var RetryWrapperFactory = func() ogcore.Node { return &RetryWrapper{MaxRetryTimes: 1} }
View Source
var SlientWrapperFactory = NewSlientWrapper
View Source
var TimeoutWrapperFactory = func() ogcore.Node { return &TimeoutWrapper{} }
View Source
var TraceWrapperFactory = func() ogcore.Node { return &TraceWrapper{} }
Functions ¶
func NewChooseClusterFactory ¶
func NewRetryWrapper ¶
func NewSlientWrapper ¶
func SetTraceId ¶
Types ¶
type AsyncWrapper ¶
type AsyncWrapper struct { ograph.BaseWrapper *slog.Logger }
type ChooseCluster ¶
type CmdNode ¶
type CmdNode struct { ograph.BaseNode *slog.Logger Cmd []string Env []string Dir string Path string }
func (*CmdNode) CmdIsAllowed ¶
type ConditionWrapper ¶
type DebugWrapper ¶
type DebugWrapper struct { ograph.BaseWrapper *slog.Logger }
type DelayWrapper ¶
type FastState ¶
type FastState struct {
// contains filtered or unexported fields
}
func NewFastState ¶
func NewFastState() *FastState
type GuardState ¶
type GuardState struct {
// contains filtered or unexported fields
}
func NewGuardState ¶
func NewGuardState(state ogcore.State, guard func(key any) (flag int)) *GuardState
func (*GuardState) Set ¶
func (state *GuardState) Set(key any, val any)
type HookState ¶
type HookState struct { Base ogcore.State Hooks []StateHookFn }
func NewHookState ¶
func NewHookState(base ogcore.State, hooks ...StateHookFn) *HookState
type LoopWrapper ¶
type LoopWrapper struct { ograph.BaseWrapper LoopTimes int LoopInterval time.Duration }
type OverlayState ¶
func NewOverlayState ¶
func NewOverlayState(state ogcore.State) *OverlayState
func (*OverlayState) Set ¶
func (state *OverlayState) Set(key any, val any)
func (*OverlayState) Sync ¶
func (state *OverlayState) Sync()
type ParallelCluster ¶
type ParallelCluster struct {
ograph.BaseCluster
}
type RaceCluster ¶
type RaceCluster struct { ograph.BaseCluster *slog.Logger StateIsolation bool }
type RetryWrapper ¶
type RetryWrapper struct { ograph.BaseWrapper *slog.Logger MaxRetryTimes int }
type SlientWrapper ¶
type SlientWrapper struct { ograph.BaseWrapper *slog.Logger }
type TimeoutWrapper ¶
type TimeoutWrapper struct { ograph.BaseWrapper Timeout time.Duration }
type TraceWrapper ¶
type TraceWrapper struct { ograph.BaseWrapper *slog.Logger }
Source Files ¶
- cluster_choose.go
- cluster_parallel.go
- cluster_race.go
- constants.go
- node_cmd.go
- register.go
- state_fast.go
- state_guard.go
- state_hook.go
- state_overlay.go
- wrapper_async.go
- wrapper_condition.go
- wrapper_debug.go
- wrapper_delay.go
- wrapper_loop.go
- wrapper_retry.go
- wrapper_slient.go
- wrapper_timeout.go
- wrapper_trace.go
Click to show internal directories.
Click to hide internal directories.