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 AddonAssociationFunc
- type AddonFunc
- type AlertLogsFunc
- type AuthFunc
- type BillingSequenceFunc
- 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 ConnectionFunc
- type CostsheetFunc
- type CouponApplicationFunc
- type CouponAssociationFunc
- type CouponFunc
- type CreditGrantApplicationFunc
- type CreditGrantFunc
- type CreditNoteFunc
- type CreditNoteLineItemFunc
- type CustomerFunc
- type EntitlementFunc
- type EntityIntegrationMappingFunc
- type EnvironmentFunc
- type FeatureFunc
- type GroupFunc
- type InvoiceFunc
- type InvoiceLineItemFunc
- type InvoiceSequenceFunc
- type MeterFunc
- type PaymentAttemptFunc
- type PaymentFunc
- type PlanFunc
- type PriceFunc
- type PriceUnitFunc
- type ScheduledTaskFunc
- type SecretFunc
- type SettingsFunc
- type SubscriptionFunc
- type SubscriptionLineItemFunc
- type SubscriptionPauseFunc
- type SubscriptionScheduleFunc
- type SubscriptionSchedulePhaseFunc
- type TaskFunc
- type TaxAppliedFunc
- type TaxAssociationFunc
- type TaxRateFunc
- type TenantFunc
- type UserFunc
- type WalletFunc
- type WalletTransactionFunc
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 AddonAssociationFunc ¶ added in v1.0.21
The AddonAssociationFunc type is an adapter to allow the use of ordinary function as AddonAssociation mutator.
type AddonFunc ¶ added in v1.0.21
The AddonFunc type is an adapter to allow the use of ordinary function as Addon mutator.
type AlertLogsFunc ¶ added in v1.0.29
The AlertLogsFunc type is an adapter to allow the use of ordinary function as AlertLogs mutator.
type AuthFunc ¶
The AuthFunc type is an adapter to allow the use of ordinary function as Auth mutator.
type BillingSequenceFunc ¶
The BillingSequenceFunc type is an adapter to allow the use of ordinary function as BillingSequence 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 ConnectionFunc ¶ added in v1.0.21
The ConnectionFunc type is an adapter to allow the use of ordinary function as Connection mutator.
type CostsheetFunc ¶ added in v1.0.18
The CostsheetFunc type is an adapter to allow the use of ordinary function as Costsheet mutator.
type CouponApplicationFunc ¶ added in v1.0.21
The CouponApplicationFunc type is an adapter to allow the use of ordinary function as CouponApplication mutator.
type CouponAssociationFunc ¶ added in v1.0.21
The CouponAssociationFunc type is an adapter to allow the use of ordinary function as CouponAssociation mutator.
type CouponFunc ¶ added in v1.0.21
The CouponFunc type is an adapter to allow the use of ordinary function as Coupon mutator.
type CreditGrantApplicationFunc ¶ added in v1.0.18
type CreditGrantApplicationFunc func(context.Context, *ent.CreditGrantApplicationMutation) (ent.Value, error)
The CreditGrantApplicationFunc type is an adapter to allow the use of ordinary function as CreditGrantApplication mutator.
type CreditGrantFunc ¶ added in v1.0.18
The CreditGrantFunc type is an adapter to allow the use of ordinary function as CreditGrant mutator.
type CreditNoteFunc ¶ added in v1.0.18
The CreditNoteFunc type is an adapter to allow the use of ordinary function as CreditNote mutator.
type CreditNoteLineItemFunc ¶ added in v1.0.18
type CreditNoteLineItemFunc func(context.Context, *ent.CreditNoteLineItemMutation) (ent.Value, error)
The CreditNoteLineItemFunc type is an adapter to allow the use of ordinary function as CreditNoteLineItem mutator.
type CustomerFunc ¶
The CustomerFunc type is an adapter to allow the use of ordinary function as Customer mutator.
type EntitlementFunc ¶
The EntitlementFunc type is an adapter to allow the use of ordinary function as Entitlement mutator.
type EntityIntegrationMappingFunc ¶ added in v1.0.21
type EntityIntegrationMappingFunc func(context.Context, *ent.EntityIntegrationMappingMutation) (ent.Value, error)
The EntityIntegrationMappingFunc type is an adapter to allow the use of ordinary function as EntityIntegrationMapping mutator.
type EnvironmentFunc ¶
The EnvironmentFunc type is an adapter to allow the use of ordinary function as Environment mutator.
type FeatureFunc ¶
The FeatureFunc type is an adapter to allow the use of ordinary function as Feature mutator.
type GroupFunc ¶ added in v1.0.34
The GroupFunc type is an adapter to allow the use of ordinary function as Group mutator.
type InvoiceFunc ¶
The InvoiceFunc type is an adapter to allow the use of ordinary function as Invoice mutator.
type InvoiceLineItemFunc ¶
The InvoiceLineItemFunc type is an adapter to allow the use of ordinary function as InvoiceLineItem mutator.
type InvoiceSequenceFunc ¶
The InvoiceSequenceFunc type is an adapter to allow the use of ordinary function as InvoiceSequence mutator.
type MeterFunc ¶
The MeterFunc type is an adapter to allow the use of ordinary function as Meter mutator.
type PaymentAttemptFunc ¶
The PaymentAttemptFunc type is an adapter to allow the use of ordinary function as PaymentAttempt mutator.
type PaymentFunc ¶
The PaymentFunc type is an adapter to allow the use of ordinary function as Payment mutator.
type PlanFunc ¶
The PlanFunc type is an adapter to allow the use of ordinary function as Plan mutator.
type PriceFunc ¶
The PriceFunc type is an adapter to allow the use of ordinary function as Price mutator.
type PriceUnitFunc ¶ added in v1.0.21
The PriceUnitFunc type is an adapter to allow the use of ordinary function as PriceUnit mutator.
type ScheduledTaskFunc ¶ added in v1.0.32
The ScheduledTaskFunc type is an adapter to allow the use of ordinary function as ScheduledTask mutator.
type SecretFunc ¶
The SecretFunc type is an adapter to allow the use of ordinary function as Secret mutator.
type SettingsFunc ¶ added in v1.0.22
The SettingsFunc type is an adapter to allow the use of ordinary function as Settings mutator.
type SubscriptionFunc ¶
The SubscriptionFunc type is an adapter to allow the use of ordinary function as Subscription mutator.
type SubscriptionLineItemFunc ¶
type SubscriptionLineItemFunc func(context.Context, *ent.SubscriptionLineItemMutation) (ent.Value, error)
The SubscriptionLineItemFunc type is an adapter to allow the use of ordinary function as SubscriptionLineItem mutator.
type SubscriptionPauseFunc ¶
The SubscriptionPauseFunc type is an adapter to allow the use of ordinary function as SubscriptionPause mutator.
type SubscriptionScheduleFunc ¶ added in v1.0.18
type SubscriptionScheduleFunc func(context.Context, *ent.SubscriptionScheduleMutation) (ent.Value, error)
The SubscriptionScheduleFunc type is an adapter to allow the use of ordinary function as SubscriptionSchedule mutator.
type SubscriptionSchedulePhaseFunc ¶ added in v1.0.18
type SubscriptionSchedulePhaseFunc func(context.Context, *ent.SubscriptionSchedulePhaseMutation) (ent.Value, error)
The SubscriptionSchedulePhaseFunc type is an adapter to allow the use of ordinary function as SubscriptionSchedulePhase mutator.
type TaskFunc ¶
The TaskFunc type is an adapter to allow the use of ordinary function as Task mutator.
type TaxAppliedFunc ¶ added in v1.0.21
The TaxAppliedFunc type is an adapter to allow the use of ordinary function as TaxApplied mutator.
type TaxAssociationFunc ¶ added in v1.0.21
The TaxAssociationFunc type is an adapter to allow the use of ordinary function as TaxAssociation mutator.
type TaxRateFunc ¶ added in v1.0.21
The TaxRateFunc type is an adapter to allow the use of ordinary function as TaxRate mutator.
type TenantFunc ¶
The TenantFunc type is an adapter to allow the use of ordinary function as Tenant mutator.
type UserFunc ¶
The UserFunc type is an adapter to allow the use of ordinary function as User mutator.
type WalletFunc ¶
The WalletFunc type is an adapter to allow the use of ordinary function as Wallet mutator.
type WalletTransactionFunc ¶
The WalletTransactionFunc type is an adapter to allow the use of ordinary function as WalletTransaction mutator.