Documentation ¶
Index ¶
- func FixedError(err error) ent.Hook
- func If(hk ent.Hook, cond Condition) ent.Hook
- func On(hk ent.Hook, op ent.Op) ent.Hook
- func Reject(op ent.Op) ent.Hook
- func Unless(hk ent.Hook, op ent.Op) ent.Hook
- type BlogPostFunc
- type CategoryFunc
- 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 ent.Op) Condition
- func Not(cond Condition) Condition
- func Or(first, second Condition, rest ...Condition) Condition
- type DependsOnSkippedFunc
- type DuplicateNumberMessageFunc
- type ExplicitSkippedMessageFunc
- type ImageFunc
- type ImplicitSkippedMessageFunc
- type InvalidFieldMessageFunc
- type MessageWithEnumFunc
- type MessageWithFieldOneFunc
- type MessageWithIDFunc
- type MessageWithOptionalsFunc
- type MessageWithPackageNameFunc
- type PortalFunc
- type UserFunc
- type ValidMessageFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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, ent.Delete|ent.Create)
Types ¶
type BlogPostFunc ¶
The BlogPostFunc type is an adapter to allow the use of ordinary function as BlogPost mutator.
type CategoryFunc ¶
The CategoryFunc type is an adapter to allow the use of ordinary function as Category 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 DependsOnSkippedFunc ¶
The DependsOnSkippedFunc type is an adapter to allow the use of ordinary function as DependsOnSkipped mutator.
type DuplicateNumberMessageFunc ¶
type DuplicateNumberMessageFunc func(context.Context, *ent.DuplicateNumberMessageMutation) (ent.Value, error)
The DuplicateNumberMessageFunc type is an adapter to allow the use of ordinary function as DuplicateNumberMessage mutator.
type ExplicitSkippedMessageFunc ¶
type ExplicitSkippedMessageFunc func(context.Context, *ent.ExplicitSkippedMessageMutation) (ent.Value, error)
The ExplicitSkippedMessageFunc type is an adapter to allow the use of ordinary function as ExplicitSkippedMessage mutator.
type ImageFunc ¶
The ImageFunc type is an adapter to allow the use of ordinary function as Image mutator.
type ImplicitSkippedMessageFunc ¶
type ImplicitSkippedMessageFunc func(context.Context, *ent.ImplicitSkippedMessageMutation) (ent.Value, error)
The ImplicitSkippedMessageFunc type is an adapter to allow the use of ordinary function as ImplicitSkippedMessage mutator.
type InvalidFieldMessageFunc ¶
type InvalidFieldMessageFunc func(context.Context, *ent.InvalidFieldMessageMutation) (ent.Value, error)
The InvalidFieldMessageFunc type is an adapter to allow the use of ordinary function as InvalidFieldMessage mutator.
type MessageWithEnumFunc ¶
The MessageWithEnumFunc type is an adapter to allow the use of ordinary function as MessageWithEnum mutator.
type MessageWithFieldOneFunc ¶
type MessageWithFieldOneFunc func(context.Context, *ent.MessageWithFieldOneMutation) (ent.Value, error)
The MessageWithFieldOneFunc type is an adapter to allow the use of ordinary function as MessageWithFieldOne mutator.
type MessageWithIDFunc ¶
The MessageWithIDFunc type is an adapter to allow the use of ordinary function as MessageWithID mutator.
type MessageWithOptionalsFunc ¶
type MessageWithOptionalsFunc func(context.Context, *ent.MessageWithOptionalsMutation) (ent.Value, error)
The MessageWithOptionalsFunc type is an adapter to allow the use of ordinary function as MessageWithOptionals mutator.
type MessageWithPackageNameFunc ¶
type MessageWithPackageNameFunc func(context.Context, *ent.MessageWithPackageNameMutation) (ent.Value, error)
The MessageWithPackageNameFunc type is an adapter to allow the use of ordinary function as MessageWithPackageName mutator.
type PortalFunc ¶
The PortalFunc type is an adapter to allow the use of ordinary function as Portal mutator.
type UserFunc ¶
The UserFunc type is an adapter to allow the use of ordinary function as User mutator.
type ValidMessageFunc ¶
The ValidMessageFunc type is an adapter to allow the use of ordinary function as ValidMessage mutator.