Documentation ¶
Index ¶
- Variables
- func Allowf(format string, a ...interface{}) error
- func Denyf(format string, a ...interface{}) error
- func Skipf(format string, a ...interface{}) error
- type JiangHuRenMutationRuleFunc
- type JiangHuRenQueryRuleFunc
- type MenPaiMutationRuleFunc
- type MenPaiQueryRuleFunc
- type MutationPolicy
- type MutationRule
- type MutationRuleFunc
- type Policy
- type QueryMutationRule
- type QueryPolicy
- type QueryRule
- type QueryRuleFunc
- type WeaponMutationRuleFunc
- type WeaponQueryRuleFunc
- type WuGongMutationRuleFunc
- type WuGongQueryRuleFunc
Constants ¶
This section is empty.
Variables ¶
var ( // Allow may be returned by rules to indicate that the policy // evaluation should terminate with an allow decision. Allow = errors.New("ent/privacy: allow rule") // Deny may be returned by rules to indicate that the policy // evaluation should terminate with an deny decision. Deny = errors.New("ent/privacy: deny rule") // Skip may be returned by rules to indicate that the policy // evaluation should continue to the next rule. Skip = errors.New("ent/privacy: skip rule") )
Functions ¶
Types ¶
type JiangHuRenMutationRuleFunc ¶
type JiangHuRenMutationRuleFunc func(context.Context, *ent.JiangHuRenMutation) error
The JiangHuRenMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (JiangHuRenMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type JiangHuRenQueryRuleFunc ¶
type JiangHuRenQueryRuleFunc func(context.Context, *ent.JiangHuRenQuery) error
The JiangHuRenQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type MenPaiMutationRuleFunc ¶
type MenPaiMutationRuleFunc func(context.Context, *ent.MenPaiMutation) error
The MenPaiMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (MenPaiMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type MenPaiQueryRuleFunc ¶
type MenPaiQueryRuleFunc func(context.Context, *ent.MenPaiQuery) error
The MenPaiQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type MutationPolicy ¶
type MutationPolicy []MutationRule
MutationPolicy combines multiple mutation rules into a single policy.
func (MutationPolicy) EvalMutation ¶
EvalMutation evaluates a mutation against a mutation policy.
type MutationRule ¶
MutationRule defines the interface deciding whether a mutation is allowed and optionally modify it.
type MutationRuleFunc ¶
MutationRuleFunc type is an adapter to allow the use of ordinary functions as mutation rules.
func (MutationRuleFunc) EvalMutation ¶
EvalMutation returns f(ctx, m).
type Policy ¶
type Policy struct { Query QueryPolicy Mutation MutationPolicy }
Policy groups query and mutation policies.
func (Policy) EvalMutation ¶
EvalMutation forwards evaluation to mutation policy.
type QueryMutationRule ¶
type QueryMutationRule interface { QueryRule MutationRule }
QueryMutationRule is the interface that groups query and mutation rules.
func AlwaysAllowRule ¶
func AlwaysAllowRule() QueryMutationRule
AlwaysAllowRule returns a rule that returns an allow decision.
func AlwaysDenyRule ¶
func AlwaysDenyRule() QueryMutationRule
AlwaysDenyRule returns a rule that returns a deny decision.
type QueryPolicy ¶
type QueryPolicy []QueryRule
QueryPolicy combines multiple query rules into a single policy.
type QueryRule ¶
QueryRule defines the interface deciding whether a query is allowed and optionally modify it.
type QueryRuleFunc ¶
QueryRuleFunc type is an adapter to allow the use of ordinary functions as query rules.
type WeaponMutationRuleFunc ¶
type WeaponMutationRuleFunc func(context.Context, *ent.WeaponMutation) error
The WeaponMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (WeaponMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type WeaponQueryRuleFunc ¶
type WeaponQueryRuleFunc func(context.Context, *ent.WeaponQuery) error
The WeaponQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type WuGongMutationRuleFunc ¶
type WuGongMutationRuleFunc func(context.Context, *ent.WuGongMutation) error
The WuGongMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (WuGongMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type WuGongQueryRuleFunc ¶
type WuGongQueryRuleFunc func(context.Context, *ent.WuGongQuery) error
The WuGongQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.