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 RoleFunc
- type ServiceFunc
- type ServiceRelationshipFunc
- type ServiceResourceFunc
- type ServiceResourceRelationshipFunc
- type ServiceRevisionFunc
- type SettingFunc
- type SubjectFunc
- type SubjectRoleRelationshipFunc
- type TemplateFunc
- type TemplateVersionFunc
- type TokenFunc
- type VariableFunc
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 RoleFunc ¶
The RoleFunc type is an adapter to allow the use of ordinary function as Role mutator.
type ServiceFunc ¶
The ServiceFunc type is an adapter to allow the use of ordinary function as Service mutator.
type ServiceRelationshipFunc ¶
type ServiceRelationshipFunc func(context.Context, *model.ServiceRelationshipMutation) (model.Value, error)
The ServiceRelationshipFunc type is an adapter to allow the use of ordinary function as ServiceRelationship mutator.
type ServiceResourceFunc ¶
The ServiceResourceFunc type is an adapter to allow the use of ordinary function as ServiceResource mutator.
type ServiceResourceRelationshipFunc ¶
type ServiceResourceRelationshipFunc func(context.Context, *model.ServiceResourceRelationshipMutation) (model.Value, error)
The ServiceResourceRelationshipFunc type is an adapter to allow the use of ordinary function as ServiceResourceRelationship mutator.
type ServiceRevisionFunc ¶
The ServiceRevisionFunc type is an adapter to allow the use of ordinary function as ServiceRevision 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.