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 APIKeyFunc
- type AgentFunc
- type ApplicationFunc
- 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 CredentialFunc
- type HumanFunc
- type InviteFunc
- type MembershipFunc
- type OAuthAccountFunc
- type OAuthAppFunc
- type OAuthAppSecretFunc
- type OAuthAuthCodeFunc
- type OAuthConsentFunc
- type OAuthTokenFunc
- type OrganizationFunc
- type PrincipalFunc
- type PrincipalMembershipFunc
- type PrincipalTokenFunc
- type RefreshTokenFunc
- type ServiceAccountFunc
- type ServiceAccountKeyPairFunc
- type ServicePrincipalFunc
- type UserFunc
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 APIKeyFunc ¶
The APIKeyFunc type is an adapter to allow the use of ordinary function as APIKey mutator.
type AgentFunc ¶ added in v0.2.0
The AgentFunc type is an adapter to allow the use of ordinary function as Agent mutator.
type ApplicationFunc ¶ added in v0.2.0
The ApplicationFunc type is an adapter to allow the use of ordinary function as Application 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 CredentialFunc ¶ added in v0.2.0
The CredentialFunc type is an adapter to allow the use of ordinary function as Credential mutator.
type HumanFunc ¶ added in v0.2.0
The HumanFunc type is an adapter to allow the use of ordinary function as Human mutator.
type InviteFunc ¶ added in v0.2.0
The InviteFunc type is an adapter to allow the use of ordinary function as Invite mutator.
type MembershipFunc ¶
The MembershipFunc type is an adapter to allow the use of ordinary function as Membership mutator.
type OAuthAccountFunc ¶
The OAuthAccountFunc type is an adapter to allow the use of ordinary function as OAuthAccount mutator.
type OAuthAppFunc ¶
The OAuthAppFunc type is an adapter to allow the use of ordinary function as OAuthApp mutator.
type OAuthAppSecretFunc ¶
The OAuthAppSecretFunc type is an adapter to allow the use of ordinary function as OAuthAppSecret mutator.
type OAuthAuthCodeFunc ¶
The OAuthAuthCodeFunc type is an adapter to allow the use of ordinary function as OAuthAuthCode mutator.
type OAuthConsentFunc ¶
The OAuthConsentFunc type is an adapter to allow the use of ordinary function as OAuthConsent mutator.
type OAuthTokenFunc ¶
The OAuthTokenFunc type is an adapter to allow the use of ordinary function as OAuthToken mutator.
type OrganizationFunc ¶
The OrganizationFunc type is an adapter to allow the use of ordinary function as Organization mutator.
type PrincipalFunc ¶ added in v0.2.0
The PrincipalFunc type is an adapter to allow the use of ordinary function as Principal mutator.
type PrincipalMembershipFunc ¶ added in v0.2.0
type PrincipalMembershipFunc func(context.Context, *ent.PrincipalMembershipMutation) (ent.Value, error)
The PrincipalMembershipFunc type is an adapter to allow the use of ordinary function as PrincipalMembership mutator.
type PrincipalTokenFunc ¶ added in v0.2.0
The PrincipalTokenFunc type is an adapter to allow the use of ordinary function as PrincipalToken mutator.
type RefreshTokenFunc ¶
The RefreshTokenFunc type is an adapter to allow the use of ordinary function as RefreshToken mutator.
type ServiceAccountFunc ¶
The ServiceAccountFunc type is an adapter to allow the use of ordinary function as ServiceAccount mutator.
type ServiceAccountKeyPairFunc ¶
type ServiceAccountKeyPairFunc func(context.Context, *ent.ServiceAccountKeyPairMutation) (ent.Value, error)
The ServiceAccountKeyPairFunc type is an adapter to allow the use of ordinary function as ServiceAccountKeyPair mutator.
type ServicePrincipalFunc ¶ added in v0.2.0
The ServicePrincipalFunc type is an adapter to allow the use of ordinary function as ServicePrincipal mutator.