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 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 DiscordAccountFunc
- type DiscordBotFunc
- type GithubAccountFunc
- type GithubOrganizationFunc
- type GithubOrganizationMemberFunc
- type ProjectAssociationFunc
- type ProjectContributorFunc
- type ProjectFunc
- type ProjectTechnologyFunc
- type RepositoryFunc
- type RepositoryTechnologyFunc
- type SiteFunc
- type TechnologyAssociationFunc
- type TechnologyFunc
- 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 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 DiscordAccountFunc ¶
The DiscordAccountFunc type is an adapter to allow the use of ordinary function as DiscordAccount mutator.
type DiscordBotFunc ¶
The DiscordBotFunc type is an adapter to allow the use of ordinary function as DiscordBot mutator.
type GithubAccountFunc ¶
The GithubAccountFunc type is an adapter to allow the use of ordinary function as GithubAccount mutator.
type GithubOrganizationFunc ¶
type GithubOrganizationFunc func(context.Context, *ent.GithubOrganizationMutation) (ent.Value, error)
The GithubOrganizationFunc type is an adapter to allow the use of ordinary function as GithubOrganization mutator.
type GithubOrganizationMemberFunc ¶
type GithubOrganizationMemberFunc func(context.Context, *ent.GithubOrganizationMemberMutation) (ent.Value, error)
The GithubOrganizationMemberFunc type is an adapter to allow the use of ordinary function as GithubOrganizationMember mutator.
type ProjectAssociationFunc ¶
type ProjectAssociationFunc func(context.Context, *ent.ProjectAssociationMutation) (ent.Value, error)
The ProjectAssociationFunc type is an adapter to allow the use of ordinary function as ProjectAssociation mutator.
type ProjectContributorFunc ¶
type ProjectContributorFunc func(context.Context, *ent.ProjectContributorMutation) (ent.Value, error)
The ProjectContributorFunc type is an adapter to allow the use of ordinary function as ProjectContributor mutator.
type ProjectFunc ¶
The ProjectFunc type is an adapter to allow the use of ordinary function as Project mutator.
type ProjectTechnologyFunc ¶
The ProjectTechnologyFunc type is an adapter to allow the use of ordinary function as ProjectTechnology mutator.
type RepositoryFunc ¶
The RepositoryFunc type is an adapter to allow the use of ordinary function as Repository mutator.
type RepositoryTechnologyFunc ¶
type RepositoryTechnologyFunc func(context.Context, *ent.RepositoryTechnologyMutation) (ent.Value, error)
The RepositoryTechnologyFunc type is an adapter to allow the use of ordinary function as RepositoryTechnology mutator.
type SiteFunc ¶
The SiteFunc type is an adapter to allow the use of ordinary function as Site mutator.
type TechnologyAssociationFunc ¶
type TechnologyAssociationFunc func(context.Context, *ent.TechnologyAssociationMutation) (ent.Value, error)
The TechnologyAssociationFunc type is an adapter to allow the use of ordinary function as TechnologyAssociation mutator.
type TechnologyFunc ¶
The TechnologyFunc type is an adapter to allow the use of ordinary function as Technology mutator.