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(duration time.Duration) ogcore.Node
- func SetTraceId(state ogcore.State, id string)
- type AsyncWrapper
- type ChooseCluster
- type CmdNode
- type ConditionWrapper
- type DelayWrapper
- type FastState
- type GuardState
- type LoopWrapper
- type OverlayState
- type ParallelCluster
- type RaceCluster
- type RetryWrapper
- type SlientWrapper
- 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" )
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 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 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 LoopWrapper ¶
type LoopWrapper struct { ograph.BaseWrapper LoopTimes int }
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 string }
type TraceWrapper ¶
type TraceWrapper struct { ograph.BaseWrapper *slog.Logger }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.