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 AllMethodsServiceFunc
- 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 EnumWithConflictingValueFunc
- type ExplicitSkippedMessageFunc
- type ImageFunc
- type ImplicitSkippedMessageFunc
- type InvalidFieldMessageFunc
- type MessageWithEnumFunc
- type MessageWithFieldOneFunc
- type MessageWithIDFunc
- type MessageWithIntsFunc
- type MessageWithOptionalsFunc
- type MessageWithPackageNameFunc
- type MessageWithStringsFunc
- type NoBackrefFunc
- type OneMethodServiceFunc
- type PortalFunc
- type SkipEdgeExampleFunc
- type TwoMethodServiceFunc
- 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 AllMethodsServiceFunc ¶ added in v0.2.0
The AllMethodsServiceFunc type is an adapter to allow the use of ordinary function as AllMethodsService mutator.
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 EnumWithConflictingValueFunc ¶ added in v0.5.0
type EnumWithConflictingValueFunc func(context.Context, *ent.EnumWithConflictingValueMutation) (ent.Value, error)
The EnumWithConflictingValueFunc type is an adapter to allow the use of ordinary function as EnumWithConflictingValue 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 MessageWithIntsFunc ¶ added in v0.5.0
The MessageWithIntsFunc type is an adapter to allow the use of ordinary function as MessageWithInts 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 MessageWithStringsFunc ¶ added in v0.3.0
type MessageWithStringsFunc func(context.Context, *ent.MessageWithStringsMutation) (ent.Value, error)
The MessageWithStringsFunc type is an adapter to allow the use of ordinary function as MessageWithStrings mutator.
type NoBackrefFunc ¶ added in v0.3.0
The NoBackrefFunc type is an adapter to allow the use of ordinary function as NoBackref mutator.
type OneMethodServiceFunc ¶ added in v0.2.0
The OneMethodServiceFunc type is an adapter to allow the use of ordinary function as OneMethodService mutator.
type PortalFunc ¶
The PortalFunc type is an adapter to allow the use of ordinary function as Portal mutator.
type SkipEdgeExampleFunc ¶ added in v0.3.0
The SkipEdgeExampleFunc type is an adapter to allow the use of ordinary function as SkipEdgeExample mutator.
type TwoMethodServiceFunc ¶ added in v0.2.0
The TwoMethodServiceFunc type is an adapter to allow the use of ordinary function as TwoMethodService 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.