Documentation ¶
Index ¶
- Variables
- type Engine
- type ImpureComputer
- type ImpureComputerWithLoadingData
- type LoadingComputer
- type LoadingData
- type MasterPlan
- type MetadataProvider
- type Plan
- type Post
- type Pre
- type Result
- type SideEffect
- type SideEffectComputer
- type SideEffectComputerWithLoadingData
- type SwitchComputer
- type SwitchComputerWithLoadingData
- type SyncResult
- type SyncSideEffect
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. Component having problem: %v") ErrPlanMissingMethod = makeFormatErr("missing method: [%v]") ErrPlanHavingAmbiguousMethods = makeFormatErr("required method: [%v], found ambiguous methods: [%v], components carrying the ambiguous methods: [%v]") ErrPlanHavingSameMethodRegisteredMoreThanOnce = makeFormatErr("required method provided more than once by the same computer key: [%v], computer key locations: [%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 ¶
This section is empty.
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) (interface{}, error)
}
type ImpureComputerWithLoadingData ¶
type ImpureComputerWithLoadingData interface { LoadingComputer Compute(ctx context.Context, p MasterPlan, data LoadingData) (interface{}, error) }
type LoadingComputer ¶
type LoadingComputer interface {
Load(ctx context.Context, p MasterPlan) (interface{}, error)
}
type LoadingData ¶
type LoadingData struct { Data interface{} Err error }
type MetadataProvider ¶
type MetadataProvider interface {
CTEMetadata() interface{}
}
type SideEffect ¶
type SideEffect struct{}
type SideEffectComputer ¶
type SideEffectComputer interface {
Compute(ctx context.Context, p MasterPlan) error
}
type SideEffectComputerWithLoadingData ¶
type SideEffectComputerWithLoadingData interface { LoadingComputer Compute(ctx context.Context, p MasterPlan, data LoadingData) error }
type SwitchComputer ¶
type SwitchComputer interface {
Switch(ctx context.Context, p MasterPlan) (MasterPlan, error)
}
type SwitchComputerWithLoadingData ¶
type SwitchComputerWithLoadingData interface { LoadingComputer Switch(ctx context.Context, p MasterPlan, data LoadingData) (MasterPlan, error) }
type SyncResult ¶
type SyncResult struct {
Outcome interface{}
}
type SyncSideEffect ¶
type SyncSideEffect struct{}
Click to show internal directories.
Click to hide internal directories.