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 AbilityBonusFunc
- type AbilityScoreFunc
- type ArmorClassFunc
- type ArmorFunc
- type Chain
- type ClassEquipmentFunc
- type ClassFunc
- type CoinFunc
- 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 DamageTypeFunc
- type EquipmentCategoryFunc
- type EquipmentChoiceFunc
- type EquipmentCostFunc
- type EquipmentFunc
- type GearFunc
- type LanguageFunc
- type MagicSchoolFunc
- type ProficiencyChoiceFunc
- type ProficiencyFunc
- type RaceFunc
- type RuleFunc
- type RuleSectionFunc
- type SkillFunc
- type SubraceFunc
- type ToolFunc
- type TraitFunc
- type VehicleFunc
- type WeaponDamageFunc
- type WeaponFunc
- type WeaponPropertyFunc
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 AbilityBonusFunc ¶
The AbilityBonusFunc type is an adapter to allow the use of ordinary function as AbilityBonus mutator.
type AbilityScoreFunc ¶
The AbilityScoreFunc type is an adapter to allow the use of ordinary function as AbilityScore mutator.
type ArmorClassFunc ¶
The ArmorClassFunc type is an adapter to allow the use of ordinary function as ArmorClass mutator.
type ArmorFunc ¶
The ArmorFunc type is an adapter to allow the use of ordinary function as Armor 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 ClassEquipmentFunc ¶
The ClassEquipmentFunc type is an adapter to allow the use of ordinary function as ClassEquipment mutator.
type ClassFunc ¶
The ClassFunc type is an adapter to allow the use of ordinary function as Class mutator.
type CoinFunc ¶
The CoinFunc type is an adapter to allow the use of ordinary function as Coin mutator.
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 DamageTypeFunc ¶
The DamageTypeFunc type is an adapter to allow the use of ordinary function as DamageType mutator.
type EquipmentCategoryFunc ¶
The EquipmentCategoryFunc type is an adapter to allow the use of ordinary function as EquipmentCategory mutator.
type EquipmentChoiceFunc ¶
The EquipmentChoiceFunc type is an adapter to allow the use of ordinary function as EquipmentChoice mutator.
type EquipmentCostFunc ¶
The EquipmentCostFunc type is an adapter to allow the use of ordinary function as EquipmentCost mutator.
type EquipmentFunc ¶
The EquipmentFunc type is an adapter to allow the use of ordinary function as Equipment mutator.
type GearFunc ¶
The GearFunc type is an adapter to allow the use of ordinary function as Gear mutator.
type LanguageFunc ¶
The LanguageFunc type is an adapter to allow the use of ordinary function as Language mutator.
type MagicSchoolFunc ¶
The MagicSchoolFunc type is an adapter to allow the use of ordinary function as MagicSchool mutator.
type ProficiencyChoiceFunc ¶
The ProficiencyChoiceFunc type is an adapter to allow the use of ordinary function as ProficiencyChoice mutator.
type ProficiencyFunc ¶
The ProficiencyFunc type is an adapter to allow the use of ordinary function as Proficiency mutator.
type RaceFunc ¶
The RaceFunc type is an adapter to allow the use of ordinary function as Race mutator.
type RuleFunc ¶
The RuleFunc type is an adapter to allow the use of ordinary function as Rule mutator.
type RuleSectionFunc ¶
The RuleSectionFunc type is an adapter to allow the use of ordinary function as RuleSection mutator.
type SkillFunc ¶
The SkillFunc type is an adapter to allow the use of ordinary function as Skill mutator.
type SubraceFunc ¶
The SubraceFunc type is an adapter to allow the use of ordinary function as Subrace mutator.
type ToolFunc ¶
The ToolFunc type is an adapter to allow the use of ordinary function as Tool mutator.
type TraitFunc ¶
The TraitFunc type is an adapter to allow the use of ordinary function as Trait mutator.
type VehicleFunc ¶
The VehicleFunc type is an adapter to allow the use of ordinary function as Vehicle mutator.
type WeaponDamageFunc ¶
The WeaponDamageFunc type is an adapter to allow the use of ordinary function as WeaponDamage mutator.
type WeaponFunc ¶
The WeaponFunc type is an adapter to allow the use of ordinary function as Weapon mutator.
type WeaponPropertyFunc ¶
The WeaponPropertyFunc type is an adapter to allow the use of ordinary function as WeaponProperty mutator.