Documentation ¶
Index ¶
- Variables
- func Allowf(format string, a ...interface{}) error
- func DecisionContext(parent context.Context, decision error) context.Context
- func Denyf(format string, a ...interface{}) error
- func Skipf(format string, a ...interface{}) error
- type ActionMutationRuleFunc
- type ActionQueryRuleFunc
- type AliasMutationRuleFunc
- type AliasQueryRuleFunc
- type AppMutationRuleFunc
- type AppQueryRuleFunc
- type BrowserMutationRuleFunc
- type BrowserQueryRuleFunc
- type CampaignMutationRuleFunc
- type CampaignQueryRuleFunc
- type ConnectivityMutationRuleFunc
- type ConnectivityQueryRuleFunc
- type DeviceMutationRuleFunc
- type DeviceQueryRuleFunc
- type EventMutationRuleFunc
- type EventQueryRuleFunc
- type ExtraMutationRuleFunc
- type ExtraQueryRuleFunc
- type GroupMutationRuleFunc
- type GroupQueryRuleFunc
- type LibraryMutationRuleFunc
- type LibraryQueryRuleFunc
- type LocationMutationRuleFunc
- type LocationQueryRuleFunc
- type MutationPolicy
- type MutationRule
- type MutationRuleFunc
- type NetworkMutationRuleFunc
- type NetworkQueryRuleFunc
- type OSContextMutationRuleFunc
- type OSContextQueryRuleFunc
- type PageMutationRuleFunc
- type PageQueryRuleFunc
- type Policy
- type QueryMutationRule
- type QueryPolicy
- type QueryRule
- type QueryRuleFunc
- type ReferrerMutationRuleFunc
- type ReferrerQueryRuleFunc
- type ScreenMutationRuleFunc
- type ScreenQueryRuleFunc
- type SessionMutationRuleFunc
- type SessionQueryRuleFunc
- type TimingMutationRuleFunc
- type TimingQueryRuleFunc
- type UserMutationRuleFunc
- type UserQueryRuleFunc
- type ViewportMutationRuleFunc
- type ViewportQueryRuleFunc
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 ¶
func DecisionContext ¶
DecisionContext creates a decision context.
Types ¶
type ActionMutationRuleFunc ¶
type ActionMutationRuleFunc func(context.Context, *ent.ActionMutation) error
The ActionMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ActionMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ActionQueryRuleFunc ¶
type ActionQueryRuleFunc func(context.Context, *ent.ActionQuery) error
The ActionQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type AliasMutationRuleFunc ¶
type AliasMutationRuleFunc func(context.Context, *ent.AliasMutation) error
The AliasMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (AliasMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type AliasQueryRuleFunc ¶
type AliasQueryRuleFunc func(context.Context, *ent.AliasQuery) error
The AliasQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type AppMutationRuleFunc ¶
type AppMutationRuleFunc func(context.Context, *ent.AppMutation) error
The AppMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (AppMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type AppQueryRuleFunc ¶
The AppQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type BrowserMutationRuleFunc ¶
type BrowserMutationRuleFunc func(context.Context, *ent.BrowserMutation) error
The BrowserMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (BrowserMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type BrowserQueryRuleFunc ¶
type BrowserQueryRuleFunc func(context.Context, *ent.BrowserQuery) error
The BrowserQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type CampaignMutationRuleFunc ¶
type CampaignMutationRuleFunc func(context.Context, *ent.CampaignMutation) error
The CampaignMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (CampaignMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type CampaignQueryRuleFunc ¶
type CampaignQueryRuleFunc func(context.Context, *ent.CampaignQuery) error
The CampaignQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type ConnectivityMutationRuleFunc ¶
type ConnectivityMutationRuleFunc func(context.Context, *ent.ConnectivityMutation) error
The ConnectivityMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ConnectivityMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ConnectivityQueryRuleFunc ¶
type ConnectivityQueryRuleFunc func(context.Context, *ent.ConnectivityQuery) error
The ConnectivityQueryRuleFunc 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 EventMutationRuleFunc ¶
type EventMutationRuleFunc func(context.Context, *ent.EventMutation) error
The EventMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (EventMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type EventQueryRuleFunc ¶
type EventQueryRuleFunc func(context.Context, *ent.EventQuery) error
The EventQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type ExtraMutationRuleFunc ¶
type ExtraMutationRuleFunc func(context.Context, *ent.ExtraMutation) error
The ExtraMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ExtraMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ExtraQueryRuleFunc ¶
type ExtraQueryRuleFunc func(context.Context, *ent.ExtraQuery) error
The ExtraQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type GroupMutationRuleFunc ¶
type GroupMutationRuleFunc func(context.Context, *ent.GroupMutation) error
The GroupMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (GroupMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type GroupQueryRuleFunc ¶
type GroupQueryRuleFunc func(context.Context, *ent.GroupQuery) error
The GroupQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type LibraryMutationRuleFunc ¶
type LibraryMutationRuleFunc func(context.Context, *ent.LibraryMutation) error
The LibraryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (LibraryMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type LibraryQueryRuleFunc ¶
type LibraryQueryRuleFunc func(context.Context, *ent.LibraryQuery) error
The LibraryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type LocationMutationRuleFunc ¶
type LocationMutationRuleFunc func(context.Context, *ent.LocationMutation) error
The LocationMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (LocationMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type LocationQueryRuleFunc ¶
type LocationQueryRuleFunc func(context.Context, *ent.LocationQuery) error
The LocationQueryRuleFunc 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.
func OnMutationOperation ¶
func OnMutationOperation(rule MutationRule, op ent.Op) MutationRule
OnMutationOperation evaluates the given rule only on a given 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 NetworkMutationRuleFunc ¶
type NetworkMutationRuleFunc func(context.Context, *ent.NetworkMutation) error
The NetworkMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (NetworkMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type NetworkQueryRuleFunc ¶
type NetworkQueryRuleFunc func(context.Context, *ent.NetworkQuery) error
The NetworkQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type OSContextMutationRuleFunc ¶
type OSContextMutationRuleFunc func(context.Context, *ent.OSContextMutation) error
The OSContextMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (OSContextMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type OSContextQueryRuleFunc ¶
type OSContextQueryRuleFunc func(context.Context, *ent.OSContextQuery) error
The OSContextQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type PageMutationRuleFunc ¶
type PageMutationRuleFunc func(context.Context, *ent.PageMutation) error
The PageMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (PageMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type PageQueryRuleFunc ¶
The PageQueryRuleFunc 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.
func ContextQueryMutationRule ¶
func ContextQueryMutationRule(eval func(context.Context) error) QueryMutationRule
ContextQueryMutationRule creates a query/mutation rule from a context eval func.
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 ReferrerMutationRuleFunc ¶
type ReferrerMutationRuleFunc func(context.Context, *ent.ReferrerMutation) error
The ReferrerMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ReferrerMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ReferrerQueryRuleFunc ¶
type ReferrerQueryRuleFunc func(context.Context, *ent.ReferrerQuery) error
The ReferrerQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type ScreenMutationRuleFunc ¶
type ScreenMutationRuleFunc func(context.Context, *ent.ScreenMutation) error
The ScreenMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ScreenMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ScreenQueryRuleFunc ¶
type ScreenQueryRuleFunc func(context.Context, *ent.ScreenQuery) error
The ScreenQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type SessionMutationRuleFunc ¶
type SessionMutationRuleFunc func(context.Context, *ent.SessionMutation) error
The SessionMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (SessionMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type SessionQueryRuleFunc ¶
type SessionQueryRuleFunc func(context.Context, *ent.SessionQuery) error
The SessionQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type TimingMutationRuleFunc ¶
type TimingMutationRuleFunc func(context.Context, *ent.TimingMutation) error
The TimingMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (TimingMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type TimingQueryRuleFunc ¶
type TimingQueryRuleFunc func(context.Context, *ent.TimingQuery) error
The TimingQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type UserMutationRuleFunc ¶
type UserMutationRuleFunc func(context.Context, *ent.UserMutation) error
The UserMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (UserMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type UserQueryRuleFunc ¶
The UserQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type ViewportMutationRuleFunc ¶
type ViewportMutationRuleFunc func(context.Context, *ent.ViewportMutation) error
The ViewportMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ViewportMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ViewportQueryRuleFunc ¶
type ViewportQueryRuleFunc func(context.Context, *ent.ViewportQuery) error
The ViewportQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.