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 AppActionFunc
- type AppDictFunc
- type AppDictItemFunc
- type AppFunc
- type AppMenuFunc
- type AppPolicyFunc
- type AppResFunc
- type AppRoleFunc
- type AppRolePolicyFunc
- 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 FileIdentityFunc
- type FileSourceFunc
- type OauthClientFunc
- type OrgAppFunc
- type OrgFunc
- type OrgPolicyFunc
- type OrgRoleFunc
- type OrgRoleUserFunc
- type OrgUserFunc
- type OrgUserPreferenceFunc
- type PermissionFunc
- type UserDeviceFunc
- type UserFunc
- type UserIdentityFunc
- type UserLoginProfileFunc
- type UserPasswordFunc
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 AppActionFunc ¶
The AppActionFunc type is an adapter to allow the use of ordinary function as AppAction mutator.
type AppDictFunc ¶
The AppDictFunc type is an adapter to allow the use of ordinary function as AppDict mutator.
type AppDictItemFunc ¶
The AppDictItemFunc type is an adapter to allow the use of ordinary function as AppDictItem mutator.
type AppMenuFunc ¶
The AppMenuFunc type is an adapter to allow the use of ordinary function as AppMenu mutator.
type AppPolicyFunc ¶
The AppPolicyFunc type is an adapter to allow the use of ordinary function as AppPolicy mutator.
type AppResFunc ¶
The AppResFunc type is an adapter to allow the use of ordinary function as AppRes mutator.
type AppRoleFunc ¶
The AppRoleFunc type is an adapter to allow the use of ordinary function as AppRole mutator.
type AppRolePolicyFunc ¶
The AppRolePolicyFunc type is an adapter to allow the use of ordinary function as AppRolePolicy 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 FileIdentityFunc ¶
The FileIdentityFunc type is an adapter to allow the use of ordinary function as FileIdentity mutator.
type FileSourceFunc ¶
The FileSourceFunc type is an adapter to allow the use of ordinary function as FileSource mutator.
type OauthClientFunc ¶
The OauthClientFunc type is an adapter to allow the use of ordinary function as OauthClient mutator.
type OrgAppFunc ¶
The OrgAppFunc type is an adapter to allow the use of ordinary function as OrgApp mutator.
type OrgPolicyFunc ¶
The OrgPolicyFunc type is an adapter to allow the use of ordinary function as OrgPolicy mutator.
type OrgRoleFunc ¶
The OrgRoleFunc type is an adapter to allow the use of ordinary function as OrgRole mutator.
type OrgRoleUserFunc ¶
The OrgRoleUserFunc type is an adapter to allow the use of ordinary function as OrgRoleUser mutator.
type OrgUserFunc ¶
The OrgUserFunc type is an adapter to allow the use of ordinary function as OrgUser mutator.
type OrgUserPreferenceFunc ¶
The OrgUserPreferenceFunc type is an adapter to allow the use of ordinary function as OrgUserPreference mutator.
type PermissionFunc ¶
The PermissionFunc type is an adapter to allow the use of ordinary function as Permission mutator.
type UserDeviceFunc ¶
The UserDeviceFunc type is an adapter to allow the use of ordinary function as UserDevice mutator.
type UserFunc ¶
The UserFunc type is an adapter to allow the use of ordinary function as User mutator.
type UserIdentityFunc ¶
The UserIdentityFunc type is an adapter to allow the use of ordinary function as UserIdentity mutator.
type UserLoginProfileFunc ¶
The UserLoginProfileFunc type is an adapter to allow the use of ordinary function as UserLoginProfile mutator.
type UserPasswordFunc ¶
The UserPasswordFunc type is an adapter to allow the use of ordinary function as UserPassword mutator.