Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrPlanExecutionEndingEarly can be thrown actively by clients to end plan execution early. // For example, a value was retrieved from cache and thus, there's no point executing the algo // to calculate this value anymore. The engine will swallow this error, end execution and then // return a nil error to clients. // // Note: If the ending plan is nested inside another plan, the outer plan will still continue // as usual. ErrPlanExecutionEndingEarly = errors.New("plan execution ending early") // ErrRootPlanExecutionEndingEarly can be thrown actively by clients to end plan execution // early. For example, a value was retrieved from cache and thus, there's no point executing // the algo to calculate this value anymore. The engine will swallow this error, end execution // and then return a nil error to clients. // // Note: If the ending plan is nested inside another plan, the outer plan will also end. ErrRootPlanExecutionEndingEarly = errors.New("plan execution ending early from root") ErrPlanMustUsePointerReceiver = makeFormatErr("%v is using value receiver, all plans must be implemented using pointer receiver") ErrPlanNotAnalyzed = makeFormatErr("%v has not been analyzed yet, call AnalyzePlan on it first") ErrNestedPlanCannotBePointer = makeFormatErr("%v has a nested plan called %v that is a pointer") ErrPlanNotMeetingInoutRequirements = makeFormatErr("%v does not implement the required in-out interface %v, problem found: %v") ErrPlanMissingMethod = makeFormatErr("missing method: [%v]") ErrPlanHavingAmbiguousMethods = makeFormatErr("required method: [%v], found ambiguous methods: [%v]") ErrPlanHavingSameMethodRegisteredMoreThanOnce = makeFormatErr("required method provided more than once by the same struct: [%v]") ErrPlanHavingMethodButSignatureMismatched = makeFormatErr("required method: [%v], found method with mismatched signature: [%v]") ErrInvalidComputerType = makeFormatErr("%v is not a computer") ErrMetadataMissing = makeFormatErr("metadata is missing for %v, it must implement the MetadataProvider interface") ErrNilMetadata = makeFormatErr("metadata is nil for %v") ErrComputerMetaMissing = makeFormatErr("computer meta is missing in %v") ErrInoutMetaMissing = makeFormatErr("inout meta is missing in %v") )
Functions ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (Engine) AnalyzePlan ¶
func (Engine) ExecuteMasterPlan ¶
func (e Engine) ExecuteMasterPlan(ctx context.Context, p MasterPlan) error
func (Engine) VerifyConfigurations ¶
type ImpureComputer ¶
type ImpureComputer interface {
Compute(ctx context.Context, p MasterPlan) (any, error)
}
type MetadataProvider ¶
type MetadataProvider interface {
CTEMetadata() any
}
type SideEffect ¶
type SideEffect struct{}
type SideEffectComputer ¶
type SideEffectComputer interface {
Compute(ctx context.Context, p MasterPlan) error
}
type SwitchComputer ¶
type SwitchComputer interface {
Switch(ctx context.Context, p MasterPlan) (MasterPlan, error)
}
type SyncResult ¶
type SyncResult struct {
Outcome any
}
type SyncSideEffect ¶
type SyncSideEffect struct{}
Click to show internal directories.
Click to hide internal directories.