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 AddressFunc
- 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 ConversationFunc
- type InvoiceFunc
- type InvoiceHistoryFunc
- type InvoiceStatusCodeFunc
- type MessageFunc
- type OrderFunc
- type OrderHistoryFunc
- type OrderItemFunc
- type OrderStatusCodeFunc
- type PersonAddressFunc
- type PersonFunc
- type ProductColorFunc
- type ProductImageFunc
- type ProductInfoFunc
- type ProductQtyFunc
- type ProductTagFunc
- type ShipmentFunc
- type ShipmentHistoryFunc
- type ShipmentItemFunc
- type ShipmentStatusCodeFunc
- type TagFunc
- type WarehouseAssignmentFunc
- type WorkUnitInfoFunc
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 AddressFunc ¶
The AddressFunc type is an adapter to allow the use of ordinary function as Address 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 ConversationFunc ¶
The ConversationFunc type is an adapter to allow the use of ordinary function as Conversation mutator.
type InvoiceFunc ¶
The InvoiceFunc type is an adapter to allow the use of ordinary function as Invoice mutator.
type InvoiceHistoryFunc ¶
The InvoiceHistoryFunc type is an adapter to allow the use of ordinary function as InvoiceHistory mutator.
type InvoiceStatusCodeFunc ¶
The InvoiceStatusCodeFunc type is an adapter to allow the use of ordinary function as InvoiceStatusCode mutator.
type MessageFunc ¶
The MessageFunc type is an adapter to allow the use of ordinary function as Message mutator.
type OrderFunc ¶
The OrderFunc type is an adapter to allow the use of ordinary function as Order mutator.
type OrderHistoryFunc ¶
The OrderHistoryFunc type is an adapter to allow the use of ordinary function as OrderHistory mutator.
type OrderItemFunc ¶
The OrderItemFunc type is an adapter to allow the use of ordinary function as OrderItem mutator.
type OrderStatusCodeFunc ¶
The OrderStatusCodeFunc type is an adapter to allow the use of ordinary function as OrderStatusCode mutator.
type PersonAddressFunc ¶
The PersonAddressFunc type is an adapter to allow the use of ordinary function as PersonAddress mutator.
type PersonFunc ¶
The PersonFunc type is an adapter to allow the use of ordinary function as Person mutator.
type ProductColorFunc ¶
The ProductColorFunc type is an adapter to allow the use of ordinary function as ProductColor mutator.
type ProductImageFunc ¶
The ProductImageFunc type is an adapter to allow the use of ordinary function as ProductImage mutator.
type ProductInfoFunc ¶
The ProductInfoFunc type is an adapter to allow the use of ordinary function as ProductInfo mutator.
type ProductQtyFunc ¶
The ProductQtyFunc type is an adapter to allow the use of ordinary function as ProductQty mutator.
type ProductTagFunc ¶
The ProductTagFunc type is an adapter to allow the use of ordinary function as ProductTag mutator.
type ShipmentFunc ¶
The ShipmentFunc type is an adapter to allow the use of ordinary function as Shipment mutator.
type ShipmentHistoryFunc ¶
The ShipmentHistoryFunc type is an adapter to allow the use of ordinary function as ShipmentHistory mutator.
type ShipmentItemFunc ¶
The ShipmentItemFunc type is an adapter to allow the use of ordinary function as ShipmentItem mutator.
type ShipmentStatusCodeFunc ¶
type ShipmentStatusCodeFunc func(context.Context, *ent.ShipmentStatusCodeMutation) (ent.Value, error)
The ShipmentStatusCodeFunc type is an adapter to allow the use of ordinary function as ShipmentStatusCode mutator.
type WarehouseAssignmentFunc ¶
type WarehouseAssignmentFunc func(context.Context, *ent.WarehouseAssignmentMutation) (ent.Value, error)
The WarehouseAssignmentFunc type is an adapter to allow the use of ordinary function as WarehouseAssignment mutator.
type WorkUnitInfoFunc ¶
The WorkUnitInfoFunc type is an adapter to allow the use of ordinary function as WorkUnitInfo mutator.