Documentation ¶
Index ¶
- func FixedError(err error) generated.Hook
- func If(hk generated.Hook, cond Condition) generated.Hook
- func On(hk generated.Hook, op generated.Op) generated.Hook
- func Reject(op generated.Op) generated.Hook
- func Unless(hk generated.Hook, op generated.Op) generated.Hook
- type APITokenFunc
- 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 generated.Op) Condition
- func Not(cond Condition) Condition
- func Or(first, second Condition, rest ...Condition) Condition
- type ContactFunc
- type ContactHistoryFunc
- type DocumentDataFunc
- type DocumentDataHistoryFunc
- type EmailVerificationTokenFunc
- type EntitlementFunc
- type EntitlementHistoryFunc
- type EntitlementPlanFeatureFunc
- type EntitlementPlanFeatureHistoryFunc
- type EntitlementPlanFunc
- type EntitlementPlanHistoryFunc
- type EntityFunc
- type EntityHistoryFunc
- type EntityTypeFunc
- type EntityTypeHistoryFunc
- type EventFunc
- type EventHistoryFunc
- type FeatureFunc
- type FeatureHistoryFunc
- type FileFunc
- type FileHistoryFunc
- type GroupFunc
- type GroupHistoryFunc
- type GroupMembershipFunc
- type GroupMembershipHistoryFunc
- type GroupSettingFunc
- type GroupSettingHistoryFunc
- type HushFunc
- type HushHistoryFunc
- type IntegrationFunc
- type IntegrationHistoryFunc
- type InviteFunc
- type NoteFunc
- type NoteHistoryFunc
- type OauthProviderFunc
- type OauthProviderHistoryFunc
- type OhAuthTooTokenFunc
- type OrgMembershipFunc
- type OrgMembershipHistoryFunc
- type OrganizationFunc
- type OrganizationHistoryFunc
- type OrganizationSettingFunc
- type OrganizationSettingHistoryFunc
- type PasswordResetTokenFunc
- type PersonalAccessTokenFunc
- type SubscriberFunc
- type TFASettingFunc
- type TemplateFunc
- type TemplateHistoryFunc
- type UserFunc
- type UserHistoryFunc
- type UserSettingFunc
- type UserSettingHistoryFunc
- type WebauthnFunc
- type WebhookFunc
- type WebhookHistoryFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixedError ¶
FixedError is a hook returning a fixed error.
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, generated.Delete|generated.Create)
Types ¶
type APITokenFunc ¶ added in v0.5.0
The APITokenFunc type is an adapter to allow the use of ordinary function as APIToken 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 ContactFunc ¶ added in v0.7.4
The ContactFunc type is an adapter to allow the use of ordinary function as Contact mutator.
type ContactHistoryFunc ¶ added in v0.7.4
type ContactHistoryFunc func(context.Context, *generated.ContactHistoryMutation) (generated.Value, error)
The ContactHistoryFunc type is an adapter to allow the use of ordinary function as ContactHistory mutator.
type DocumentDataFunc ¶ added in v0.4.4
type DocumentDataFunc func(context.Context, *generated.DocumentDataMutation) (generated.Value, error)
The DocumentDataFunc type is an adapter to allow the use of ordinary function as DocumentData mutator.
type DocumentDataHistoryFunc ¶ added in v0.4.5
type DocumentDataHistoryFunc func(context.Context, *generated.DocumentDataHistoryMutation) (generated.Value, error)
The DocumentDataHistoryFunc type is an adapter to allow the use of ordinary function as DocumentDataHistory mutator.
type EmailVerificationTokenFunc ¶ added in v0.2.2
type EmailVerificationTokenFunc func(context.Context, *generated.EmailVerificationTokenMutation) (generated.Value, error)
The EmailVerificationTokenFunc type is an adapter to allow the use of ordinary function as EmailVerificationToken mutator.
type EntitlementFunc ¶
The EntitlementFunc type is an adapter to allow the use of ordinary function as Entitlement mutator.
type EntitlementHistoryFunc ¶ added in v0.4.5
type EntitlementHistoryFunc func(context.Context, *generated.EntitlementHistoryMutation) (generated.Value, error)
The EntitlementHistoryFunc type is an adapter to allow the use of ordinary function as EntitlementHistory mutator.
type EntitlementPlanFeatureFunc ¶ added in v0.7.0
type EntitlementPlanFeatureFunc func(context.Context, *generated.EntitlementPlanFeatureMutation) (generated.Value, error)
The EntitlementPlanFeatureFunc type is an adapter to allow the use of ordinary function as EntitlementPlanFeature mutator.
type EntitlementPlanFeatureHistoryFunc ¶ added in v0.7.0
type EntitlementPlanFeatureHistoryFunc func(context.Context, *generated.EntitlementPlanFeatureHistoryMutation) (generated.Value, error)
The EntitlementPlanFeatureHistoryFunc type is an adapter to allow the use of ordinary function as EntitlementPlanFeatureHistory mutator.
type EntitlementPlanFunc ¶ added in v0.7.0
type EntitlementPlanFunc func(context.Context, *generated.EntitlementPlanMutation) (generated.Value, error)
The EntitlementPlanFunc type is an adapter to allow the use of ordinary function as EntitlementPlan mutator.
type EntitlementPlanHistoryFunc ¶ added in v0.7.0
type EntitlementPlanHistoryFunc func(context.Context, *generated.EntitlementPlanHistoryMutation) (generated.Value, error)
The EntitlementPlanHistoryFunc type is an adapter to allow the use of ordinary function as EntitlementPlanHistory mutator.
type EntityFunc ¶ added in v0.7.4
The EntityFunc type is an adapter to allow the use of ordinary function as Entity mutator.
type EntityHistoryFunc ¶ added in v0.7.4
type EntityHistoryFunc func(context.Context, *generated.EntityHistoryMutation) (generated.Value, error)
The EntityHistoryFunc type is an adapter to allow the use of ordinary function as EntityHistory mutator.
type EntityTypeFunc ¶ added in v0.7.4
The EntityTypeFunc type is an adapter to allow the use of ordinary function as EntityType mutator.
type EntityTypeHistoryFunc ¶ added in v0.7.4
type EntityTypeHistoryFunc func(context.Context, *generated.EntityTypeHistoryMutation) (generated.Value, error)
The EntityTypeHistoryFunc type is an adapter to allow the use of ordinary function as EntityTypeHistory mutator.
type EventFunc ¶ added in v0.5.0
The EventFunc type is an adapter to allow the use of ordinary function as Event mutator.
type EventHistoryFunc ¶ added in v0.5.0
type EventHistoryFunc func(context.Context, *generated.EventHistoryMutation) (generated.Value, error)
The EventHistoryFunc type is an adapter to allow the use of ordinary function as EventHistory mutator.
type FeatureFunc ¶ added in v0.5.0
The FeatureFunc type is an adapter to allow the use of ordinary function as Feature mutator.
type FeatureHistoryFunc ¶ added in v0.5.0
type FeatureHistoryFunc func(context.Context, *generated.FeatureHistoryMutation) (generated.Value, error)
The FeatureHistoryFunc type is an adapter to allow the use of ordinary function as FeatureHistory mutator.
type FileFunc ¶ added in v0.5.0
The FileFunc type is an adapter to allow the use of ordinary function as File mutator.
type FileHistoryFunc ¶ added in v0.5.0
The FileHistoryFunc type is an adapter to allow the use of ordinary function as FileHistory mutator.
type GroupFunc ¶
The GroupFunc type is an adapter to allow the use of ordinary function as Group mutator.
type GroupHistoryFunc ¶ added in v0.4.5
type GroupHistoryFunc func(context.Context, *generated.GroupHistoryMutation) (generated.Value, error)
The GroupHistoryFunc type is an adapter to allow the use of ordinary function as GroupHistory mutator.
type GroupMembershipFunc ¶ added in v0.2.4
type GroupMembershipFunc func(context.Context, *generated.GroupMembershipMutation) (generated.Value, error)
The GroupMembershipFunc type is an adapter to allow the use of ordinary function as GroupMembership mutator.
type GroupMembershipHistoryFunc ¶ added in v0.4.5
type GroupMembershipHistoryFunc func(context.Context, *generated.GroupMembershipHistoryMutation) (generated.Value, error)
The GroupMembershipHistoryFunc type is an adapter to allow the use of ordinary function as GroupMembershipHistory mutator.
type GroupSettingFunc ¶
type GroupSettingFunc func(context.Context, *generated.GroupSettingMutation) (generated.Value, error)
The GroupSettingFunc type is an adapter to allow the use of ordinary function as GroupSetting mutator.
type GroupSettingHistoryFunc ¶ added in v0.4.5
type GroupSettingHistoryFunc func(context.Context, *generated.GroupSettingHistoryMutation) (generated.Value, error)
The GroupSettingHistoryFunc type is an adapter to allow the use of ordinary function as GroupSettingHistory mutator.
type HushFunc ¶ added in v0.5.0
The HushFunc type is an adapter to allow the use of ordinary function as Hush mutator.
type HushHistoryFunc ¶ added in v0.5.0
The HushHistoryFunc type is an adapter to allow the use of ordinary function as HushHistory mutator.
type IntegrationFunc ¶
The IntegrationFunc type is an adapter to allow the use of ordinary function as Integration mutator.
type IntegrationHistoryFunc ¶ added in v0.4.5
type IntegrationHistoryFunc func(context.Context, *generated.IntegrationHistoryMutation) (generated.Value, error)
The IntegrationHistoryFunc type is an adapter to allow the use of ordinary function as IntegrationHistory mutator.
type InviteFunc ¶ added in v0.2.6
The InviteFunc type is an adapter to allow the use of ordinary function as Invite mutator.
type NoteFunc ¶ added in v0.7.10
The NoteFunc type is an adapter to allow the use of ordinary function as Note mutator.
type NoteHistoryFunc ¶ added in v0.7.10
The NoteHistoryFunc type is an adapter to allow the use of ordinary function as NoteHistory mutator.
type OauthProviderFunc ¶
type OauthProviderFunc func(context.Context, *generated.OauthProviderMutation) (generated.Value, error)
The OauthProviderFunc type is an adapter to allow the use of ordinary function as OauthProvider mutator.
type OauthProviderHistoryFunc ¶ added in v0.4.5
type OauthProviderHistoryFunc func(context.Context, *generated.OauthProviderHistoryMutation) (generated.Value, error)
The OauthProviderHistoryFunc type is an adapter to allow the use of ordinary function as OauthProviderHistory mutator.
type OhAuthTooTokenFunc ¶
type OhAuthTooTokenFunc func(context.Context, *generated.OhAuthTooTokenMutation) (generated.Value, error)
The OhAuthTooTokenFunc type is an adapter to allow the use of ordinary function as OhAuthTooToken mutator.
type OrgMembershipFunc ¶ added in v0.2.4
type OrgMembershipFunc func(context.Context, *generated.OrgMembershipMutation) (generated.Value, error)
The OrgMembershipFunc type is an adapter to allow the use of ordinary function as OrgMembership mutator.
type OrgMembershipHistoryFunc ¶ added in v0.4.5
type OrgMembershipHistoryFunc func(context.Context, *generated.OrgMembershipHistoryMutation) (generated.Value, error)
The OrgMembershipHistoryFunc type is an adapter to allow the use of ordinary function as OrgMembershipHistory mutator.
type OrganizationFunc ¶
type OrganizationFunc func(context.Context, *generated.OrganizationMutation) (generated.Value, error)
The OrganizationFunc type is an adapter to allow the use of ordinary function as Organization mutator.
type OrganizationHistoryFunc ¶ added in v0.4.3
type OrganizationHistoryFunc func(context.Context, *generated.OrganizationHistoryMutation) (generated.Value, error)
The OrganizationHistoryFunc type is an adapter to allow the use of ordinary function as OrganizationHistory mutator.
type OrganizationSettingFunc ¶
type OrganizationSettingFunc func(context.Context, *generated.OrganizationSettingMutation) (generated.Value, error)
The OrganizationSettingFunc type is an adapter to allow the use of ordinary function as OrganizationSetting mutator.
type OrganizationSettingHistoryFunc ¶ added in v0.4.3
type OrganizationSettingHistoryFunc func(context.Context, *generated.OrganizationSettingHistoryMutation) (generated.Value, error)
The OrganizationSettingHistoryFunc type is an adapter to allow the use of ordinary function as OrganizationSettingHistory mutator.
type PasswordResetTokenFunc ¶ added in v0.2.3
type PasswordResetTokenFunc func(context.Context, *generated.PasswordResetTokenMutation) (generated.Value, error)
The PasswordResetTokenFunc type is an adapter to allow the use of ordinary function as PasswordResetToken mutator.
type PersonalAccessTokenFunc ¶
type PersonalAccessTokenFunc func(context.Context, *generated.PersonalAccessTokenMutation) (generated.Value, error)
The PersonalAccessTokenFunc type is an adapter to allow the use of ordinary function as PersonalAccessToken mutator.
type SubscriberFunc ¶ added in v0.3.6
The SubscriberFunc type is an adapter to allow the use of ordinary function as Subscriber mutator.
type TFASettingFunc ¶ added in v0.4.4
The TFASettingFunc type is an adapter to allow the use of ordinary function as TFASetting mutator.
type TemplateFunc ¶ added in v0.4.3
The TemplateFunc type is an adapter to allow the use of ordinary function as Template mutator.
type TemplateHistoryFunc ¶ added in v0.4.5
type TemplateHistoryFunc func(context.Context, *generated.TemplateHistoryMutation) (generated.Value, error)
The TemplateHistoryFunc type is an adapter to allow the use of ordinary function as TemplateHistory mutator.
type UserFunc ¶
The UserFunc type is an adapter to allow the use of ordinary function as User mutator.
type UserHistoryFunc ¶ added in v0.4.5
The UserHistoryFunc type is an adapter to allow the use of ordinary function as UserHistory mutator.
type UserSettingFunc ¶
The UserSettingFunc type is an adapter to allow the use of ordinary function as UserSetting mutator.
type UserSettingHistoryFunc ¶ added in v0.4.5
type UserSettingHistoryFunc func(context.Context, *generated.UserSettingHistoryMutation) (generated.Value, error)
The UserSettingHistoryFunc type is an adapter to allow the use of ordinary function as UserSettingHistory mutator.
type WebauthnFunc ¶ added in v0.3.0
The WebauthnFunc type is an adapter to allow the use of ordinary function as Webauthn mutator.
type WebhookFunc ¶ added in v0.5.0
The WebhookFunc type is an adapter to allow the use of ordinary function as Webhook mutator.
type WebhookHistoryFunc ¶ added in v0.5.0
type WebhookHistoryFunc func(context.Context, *generated.WebhookHistoryMutation) (generated.Value, error)
The WebhookHistoryFunc type is an adapter to allow the use of ordinary function as WebhookHistory mutator.