Documentation ¶
Index ¶
- func FixedError(err error) model.Hook
- func If(hk model.Hook, cond Condition) model.Hook
- func On(hk model.Hook, op model.Op) model.Hook
- func Reject(op model.Op) model.Hook
- func Unless(hk model.Hook, op model.Op) model.Hook
- type CatalogFunc
- type Chain
- type Condition
- func And(first, second Condition, rest ...Condition) Condition
- func HasAddedFields(field string, fields ...string) Condition
- func HasClearedFields(field string, fields ...string) Condition
- func HasFields(field string, fields ...string) Condition
- func HasOp(op model.Op) Condition
- func Not(cond Condition) Condition
- func Or(first, second Condition, rest ...Condition) Condition
- type ConnectorFunc
- type CostReportFunc
- type DistributeLockFunc
- type EnvironmentConnectorRelationshipFunc
- type EnvironmentFunc
- type PerspectiveFunc
- type ProjectFunc
- type ResourceComponentFunc
- type ResourceComponentRelationshipFunc
- type ResourceDefinitionFunc
- type ResourceDefinitionMatchingRuleFunc
- type ResourceFunc
- type ResourceRelationshipFunc
- type ResourceRunFunc
- type ResourceStateFunc
- type RoleFunc
- type SettingFunc
- type SubjectFunc
- type SubjectRoleRelationshipFunc
- type TemplateFunc
- type TemplateVersionFunc
- type TokenFunc
- type VariableFunc
- type WorkflowExecutionFunc
- type WorkflowFunc
- type WorkflowStageExecutionFunc
- type WorkflowStageFunc
- type WorkflowStepExecutionFunc
- type WorkflowStepFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedError ¶
FixedError is a hook returning a fixed error.
func If ¶
If executes the given hook under condition.
hook.If(ComputeAverage, And(HasFields(...), HasAddedFields(...)))
func On ¶
On executes the given hook only for the given operation.
hook.On(Log, model.Delete|model.Create)
Types ¶
type CatalogFunc ¶
The CatalogFunc type is an adapter to allow the use of ordinary function as Catalog mutator.
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain acts as a list of hooks and is effectively immutable. Once created, it will always hold the same set of hooks in the same order.
func (Chain) Append ¶
Append extends a chain, adding the specified hook as the last ones in the mutation flow.
type Condition ¶
Condition is a hook condition function.
func HasAddedFields ¶
HasAddedFields is a condition validating `.AddedField` on fields.
func HasClearedFields ¶
HasClearedFields is a condition validating `.FieldCleared` on fields.
type ConnectorFunc ¶
The ConnectorFunc type is an adapter to allow the use of ordinary function as Connector mutator.
type CostReportFunc ¶
The CostReportFunc type is an adapter to allow the use of ordinary function as CostReport mutator.
type DistributeLockFunc ¶
The DistributeLockFunc type is an adapter to allow the use of ordinary function as DistributeLock mutator.
type EnvironmentConnectorRelationshipFunc ¶
type EnvironmentConnectorRelationshipFunc func(context.Context, *model.EnvironmentConnectorRelationshipMutation) (model.Value, error)
The EnvironmentConnectorRelationshipFunc type is an adapter to allow the use of ordinary function as EnvironmentConnectorRelationship mutator.
type EnvironmentFunc ¶
The EnvironmentFunc type is an adapter to allow the use of ordinary function as Environment mutator.
type PerspectiveFunc ¶
The PerspectiveFunc type is an adapter to allow the use of ordinary function as Perspective mutator.
type ProjectFunc ¶
The ProjectFunc type is an adapter to allow the use of ordinary function as Project mutator.
type ResourceComponentFunc ¶ added in v0.4.0
type ResourceComponentFunc func(context.Context, *model.ResourceComponentMutation) (model.Value, error)
The ResourceComponentFunc type is an adapter to allow the use of ordinary function as ResourceComponent mutator.
type ResourceComponentRelationshipFunc ¶ added in v0.4.0
type ResourceComponentRelationshipFunc func(context.Context, *model.ResourceComponentRelationshipMutation) (model.Value, error)
The ResourceComponentRelationshipFunc type is an adapter to allow the use of ordinary function as ResourceComponentRelationship mutator.
type ResourceDefinitionFunc ¶ added in v0.4.0
type ResourceDefinitionFunc func(context.Context, *model.ResourceDefinitionMutation) (model.Value, error)
The ResourceDefinitionFunc type is an adapter to allow the use of ordinary function as ResourceDefinition mutator.
type ResourceDefinitionMatchingRuleFunc ¶ added in v0.4.0
type ResourceDefinitionMatchingRuleFunc func(context.Context, *model.ResourceDefinitionMatchingRuleMutation) (model.Value, error)
The ResourceDefinitionMatchingRuleFunc type is an adapter to allow the use of ordinary function as ResourceDefinitionMatchingRule mutator.
type ResourceFunc ¶ added in v0.4.0
The ResourceFunc type is an adapter to allow the use of ordinary function as Resource mutator.
type ResourceRelationshipFunc ¶ added in v0.4.0
type ResourceRelationshipFunc func(context.Context, *model.ResourceRelationshipMutation) (model.Value, error)
The ResourceRelationshipFunc type is an adapter to allow the use of ordinary function as ResourceRelationship mutator.
type ResourceRunFunc ¶ added in v0.6.0
The ResourceRunFunc type is an adapter to allow the use of ordinary function as ResourceRun mutator.
type ResourceStateFunc ¶ added in v0.6.0
The ResourceStateFunc type is an adapter to allow the use of ordinary function as ResourceState mutator.
type RoleFunc ¶
The RoleFunc type is an adapter to allow the use of ordinary function as Role mutator.
type SettingFunc ¶
The SettingFunc type is an adapter to allow the use of ordinary function as Setting mutator.
type SubjectFunc ¶
The SubjectFunc type is an adapter to allow the use of ordinary function as Subject mutator.
type SubjectRoleRelationshipFunc ¶
type SubjectRoleRelationshipFunc func(context.Context, *model.SubjectRoleRelationshipMutation) (model.Value, error)
The SubjectRoleRelationshipFunc type is an adapter to allow the use of ordinary function as SubjectRoleRelationship mutator.
type TemplateFunc ¶
The TemplateFunc type is an adapter to allow the use of ordinary function as Template mutator.
type TemplateVersionFunc ¶
The TemplateVersionFunc type is an adapter to allow the use of ordinary function as TemplateVersion mutator.
type TokenFunc ¶
The TokenFunc type is an adapter to allow the use of ordinary function as Token mutator.
type VariableFunc ¶
The VariableFunc type is an adapter to allow the use of ordinary function as Variable mutator.
type WorkflowExecutionFunc ¶ added in v0.4.0
type WorkflowExecutionFunc func(context.Context, *model.WorkflowExecutionMutation) (model.Value, error)
The WorkflowExecutionFunc type is an adapter to allow the use of ordinary function as WorkflowExecution mutator.
type WorkflowFunc ¶ added in v0.4.0
The WorkflowFunc type is an adapter to allow the use of ordinary function as Workflow mutator.
type WorkflowStageExecutionFunc ¶ added in v0.4.0
type WorkflowStageExecutionFunc func(context.Context, *model.WorkflowStageExecutionMutation) (model.Value, error)
The WorkflowStageExecutionFunc type is an adapter to allow the use of ordinary function as WorkflowStageExecution mutator.
type WorkflowStageFunc ¶ added in v0.4.0
The WorkflowStageFunc type is an adapter to allow the use of ordinary function as WorkflowStage mutator.
type WorkflowStepExecutionFunc ¶ added in v0.4.0
type WorkflowStepExecutionFunc func(context.Context, *model.WorkflowStepExecutionMutation) (model.Value, error)
The WorkflowStepExecutionFunc type is an adapter to allow the use of ordinary function as WorkflowStepExecution mutator.
type WorkflowStepFunc ¶ added in v0.4.0
The WorkflowStepFunc type is an adapter to allow the use of ordinary function as WorkflowStep mutator.