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 ProxyAdsFunc
- type ProxyAnnouncementFunc
- type ProxyAuthMethodFunc
- type ProxyCouponFunc
- type ProxyDocumentFunc
- type ProxyGroupHistoryDetailFunc
- type ProxyGroupHistoryFunc
- type ProxyNodeFunc
- type ProxyOrderFunc
- type ProxyPaymentFunc
- type ProxyRedemptionCodeFunc
- type ProxyRedemptionRecordFunc
- type ProxySchemaMigrationsFunc
- type ProxyServerFunc
- type ProxyServerGroupFunc
- type ProxySubscribeApplicationFunc
- type ProxySubscribeFunc
- type ProxySubscribeGroupFunc
- type ProxySystemFunc
- type ProxySystemLogFunc
- type ProxyTaskFunc
- type ProxyTicketFollowFunc
- type ProxyTicketFunc
- type ProxyTrafficLogFunc
- type ProxyUserAuthMethodFunc
- type ProxyUserDeviceFunc
- type ProxyUserDeviceOnlineRecordFunc
- type ProxyUserFunc
- type ProxyUserSubscribeFunc
- type ProxyUserWithdrawalFunc
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 ProxyAdsFunc ¶
The ProxyAdsFunc type is an adapter to allow the use of ordinary function as ProxyAds mutator.
type ProxyAnnouncementFunc ¶
The ProxyAnnouncementFunc type is an adapter to allow the use of ordinary function as ProxyAnnouncement mutator.
type ProxyAuthMethodFunc ¶
The ProxyAuthMethodFunc type is an adapter to allow the use of ordinary function as ProxyAuthMethod mutator.
type ProxyCouponFunc ¶
The ProxyCouponFunc type is an adapter to allow the use of ordinary function as ProxyCoupon mutator.
type ProxyDocumentFunc ¶
The ProxyDocumentFunc type is an adapter to allow the use of ordinary function as ProxyDocument mutator.
type ProxyGroupHistoryDetailFunc ¶
type ProxyGroupHistoryDetailFunc func(context.Context, *ent.ProxyGroupHistoryDetailMutation) (ent.Value, error)
The ProxyGroupHistoryDetailFunc type is an adapter to allow the use of ordinary function as ProxyGroupHistoryDetail mutator.
type ProxyGroupHistoryFunc ¶
The ProxyGroupHistoryFunc type is an adapter to allow the use of ordinary function as ProxyGroupHistory mutator.
type ProxyNodeFunc ¶
The ProxyNodeFunc type is an adapter to allow the use of ordinary function as ProxyNode mutator.
type ProxyOrderFunc ¶
The ProxyOrderFunc type is an adapter to allow the use of ordinary function as ProxyOrder mutator.
type ProxyPaymentFunc ¶
The ProxyPaymentFunc type is an adapter to allow the use of ordinary function as ProxyPayment mutator.
type ProxyRedemptionCodeFunc ¶
type ProxyRedemptionCodeFunc func(context.Context, *ent.ProxyRedemptionCodeMutation) (ent.Value, error)
The ProxyRedemptionCodeFunc type is an adapter to allow the use of ordinary function as ProxyRedemptionCode mutator.
type ProxyRedemptionRecordFunc ¶
type ProxyRedemptionRecordFunc func(context.Context, *ent.ProxyRedemptionRecordMutation) (ent.Value, error)
The ProxyRedemptionRecordFunc type is an adapter to allow the use of ordinary function as ProxyRedemptionRecord mutator.
type ProxySchemaMigrationsFunc ¶
type ProxySchemaMigrationsFunc func(context.Context, *ent.ProxySchemaMigrationsMutation) (ent.Value, error)
The ProxySchemaMigrationsFunc type is an adapter to allow the use of ordinary function as ProxySchemaMigrations mutator.
type ProxyServerFunc ¶
The ProxyServerFunc type is an adapter to allow the use of ordinary function as ProxyServer mutator.
type ProxyServerGroupFunc ¶
The ProxyServerGroupFunc type is an adapter to allow the use of ordinary function as ProxyServerGroup mutator.
type ProxySubscribeApplicationFunc ¶
type ProxySubscribeApplicationFunc func(context.Context, *ent.ProxySubscribeApplicationMutation) (ent.Value, error)
The ProxySubscribeApplicationFunc type is an adapter to allow the use of ordinary function as ProxySubscribeApplication mutator.
type ProxySubscribeFunc ¶
The ProxySubscribeFunc type is an adapter to allow the use of ordinary function as ProxySubscribe mutator.
type ProxySubscribeGroupFunc ¶
type ProxySubscribeGroupFunc func(context.Context, *ent.ProxySubscribeGroupMutation) (ent.Value, error)
The ProxySubscribeGroupFunc type is an adapter to allow the use of ordinary function as ProxySubscribeGroup mutator.
type ProxySystemFunc ¶
The ProxySystemFunc type is an adapter to allow the use of ordinary function as ProxySystem mutator.
type ProxySystemLogFunc ¶
The ProxySystemLogFunc type is an adapter to allow the use of ordinary function as ProxySystemLog mutator.
type ProxyTaskFunc ¶
The ProxyTaskFunc type is an adapter to allow the use of ordinary function as ProxyTask mutator.
type ProxyTicketFollowFunc ¶
The ProxyTicketFollowFunc type is an adapter to allow the use of ordinary function as ProxyTicketFollow mutator.
type ProxyTicketFunc ¶
The ProxyTicketFunc type is an adapter to allow the use of ordinary function as ProxyTicket mutator.
type ProxyTrafficLogFunc ¶
The ProxyTrafficLogFunc type is an adapter to allow the use of ordinary function as ProxyTrafficLog mutator.
type ProxyUserAuthMethodFunc ¶
type ProxyUserAuthMethodFunc func(context.Context, *ent.ProxyUserAuthMethodMutation) (ent.Value, error)
The ProxyUserAuthMethodFunc type is an adapter to allow the use of ordinary function as ProxyUserAuthMethod mutator.
type ProxyUserDeviceFunc ¶
The ProxyUserDeviceFunc type is an adapter to allow the use of ordinary function as ProxyUserDevice mutator.
type ProxyUserDeviceOnlineRecordFunc ¶
type ProxyUserDeviceOnlineRecordFunc func(context.Context, *ent.ProxyUserDeviceOnlineRecordMutation) (ent.Value, error)
The ProxyUserDeviceOnlineRecordFunc type is an adapter to allow the use of ordinary function as ProxyUserDeviceOnlineRecord mutator.
type ProxyUserFunc ¶
The ProxyUserFunc type is an adapter to allow the use of ordinary function as ProxyUser mutator.
type ProxyUserSubscribeFunc ¶
type ProxyUserSubscribeFunc func(context.Context, *ent.ProxyUserSubscribeMutation) (ent.Value, error)
The ProxyUserSubscribeFunc type is an adapter to allow the use of ordinary function as ProxyUserSubscribe mutator.
type ProxyUserWithdrawalFunc ¶
type ProxyUserWithdrawalFunc func(context.Context, *ent.ProxyUserWithdrawalMutation) (ent.Value, error)
The ProxyUserWithdrawalFunc type is an adapter to allow the use of ordinary function as ProxyUserWithdrawal mutator.