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 AccountMutationRuleFunc
- type AccountQueryRuleFunc
- type AnswerMutationRuleFunc
- type AnswerQueryRuleFunc
- type ContactMutationRuleFunc
- type ContactQueryRuleFunc
- type DeviceMutationRuleFunc
- type DeviceQueryRuleFunc
- type DomainMutationRuleFunc
- type DomainQueryRuleFunc
- type FlowMutationRuleFunc
- type FlowQueryRuleFunc
- type IPMutationRuleFunc
- type IPQueryRuleFunc
- type InputMutationRuleFunc
- type InputQueryRuleFunc
- type MutationPolicy
- type MutationRule
- type MutationRuleFunc
- type PersonMutationRuleFunc
- type PersonQueryRuleFunc
- type Policy
- type QueryMutationRule
- type QueryPolicy
- type QueryRule
- type QueryRuleFunc
- type QuestionMutationRuleFunc
- type QuestionQueryRuleFunc
- type ShortMutationRuleFunc
- type ShortQueryRuleFunc
- type SurveyMutationRuleFunc
- type SurveyQueryRuleFunc
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 AccountMutationRuleFunc ¶
type AccountMutationRuleFunc func(context.Context, *ent.AccountMutation) error
The AccountMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (AccountMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type AccountQueryRuleFunc ¶
type AccountQueryRuleFunc func(context.Context, *ent.AccountQuery) error
The AccountQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type AnswerMutationRuleFunc ¶
type AnswerMutationRuleFunc func(context.Context, *ent.AnswerMutation) error
The AnswerMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (AnswerMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type AnswerQueryRuleFunc ¶
type AnswerQueryRuleFunc func(context.Context, *ent.AnswerQuery) error
The AnswerQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type ContactMutationRuleFunc ¶
type ContactMutationRuleFunc func(context.Context, *ent.ContactMutation) error
The ContactMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ContactMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ContactQueryRuleFunc ¶
type ContactQueryRuleFunc func(context.Context, *ent.ContactQuery) error
The ContactQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type DeviceMutationRuleFunc ¶
type DeviceMutationRuleFunc func(context.Context, *ent.DeviceMutation) error
The DeviceMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (DeviceMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type DeviceQueryRuleFunc ¶
type DeviceQueryRuleFunc func(context.Context, *ent.DeviceQuery) error
The DeviceQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type DomainMutationRuleFunc ¶
type DomainMutationRuleFunc func(context.Context, *ent.DomainMutation) error
The DomainMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (DomainMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type DomainQueryRuleFunc ¶
type DomainQueryRuleFunc func(context.Context, *ent.DomainQuery) error
The DomainQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type FlowMutationRuleFunc ¶
type FlowMutationRuleFunc func(context.Context, *ent.FlowMutation) error
The FlowMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (FlowMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type FlowQueryRuleFunc ¶
The FlowQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type IPMutationRuleFunc ¶
type IPMutationRuleFunc func(context.Context, *ent.IPMutation) error
The IPMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (IPMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type IPQueryRuleFunc ¶
The IPQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type InputMutationRuleFunc ¶
type InputMutationRuleFunc func(context.Context, *ent.InputMutation) error
The InputMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (InputMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type InputQueryRuleFunc ¶
type InputQueryRuleFunc func(context.Context, *ent.InputQuery) error
The InputQueryRuleFunc 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.
func DenyMutationOperationRule ¶
func DenyMutationOperationRule(op ent.Op) MutationRule
DenyMutationOperationRule returns a rule denying specified mutation operation.
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 PersonMutationRuleFunc ¶
type PersonMutationRuleFunc func(context.Context, *ent.PersonMutation) error
The PersonMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (PersonMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type PersonQueryRuleFunc ¶
type PersonQueryRuleFunc func(context.Context, *ent.PersonQuery) error
The PersonQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
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 QuestionMutationRuleFunc ¶
type QuestionMutationRuleFunc func(context.Context, *ent.QuestionMutation) error
The QuestionMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (QuestionMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type QuestionQueryRuleFunc ¶
type QuestionQueryRuleFunc func(context.Context, *ent.QuestionQuery) error
The QuestionQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type ShortMutationRuleFunc ¶
type ShortMutationRuleFunc func(context.Context, *ent.ShortMutation) error
The ShortMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ShortMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ShortQueryRuleFunc ¶
type ShortQueryRuleFunc func(context.Context, *ent.ShortQuery) error
The ShortQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type SurveyMutationRuleFunc ¶
type SurveyMutationRuleFunc func(context.Context, *ent.SurveyMutation) error
The SurveyMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (SurveyMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type SurveyQueryRuleFunc ¶
type SurveyQueryRuleFunc func(context.Context, *ent.SurveyQuery) error
The SurveyQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.