Documentation
¶
Index ¶
- Variables
- func Allowf(format string, a ...any) error
- func DecisionContext(parent context.Context, decision error) context.Context
- func DecisionFromContext(ctx context.Context) (error, bool)
- func Denyf(format string, a ...any) error
- func Skipf(format string, a ...any) error
- type CurrencyMutationRuleFunc
- type CurrencyQueryRuleFunc
- type Filter
- type FilterFunc
- type MarketMutationRuleFunc
- type MarketQueryRuleFunc
- type MutationPolicy
- type MutationRule
- type MutationRuleFunc
- type OutboxMutationRuleFunc
- type OutboxQueryRuleFunc
- type Policy
- type QueryMutationRule
- type QueryPolicy
- type QueryRule
- type QueryRuleFunc
- type TickerMutationRuleFunc
- type TickerQueryRuleFunc
- type TradingPairMutationRuleFunc
- type TradingPairQueryRuleFunc
- type VenueMutationRuleFunc
- type VenueQueryRuleFunc
Constants ¶
This section is empty.
Variables ¶
var ( // Allow may be returned by rules to indicate that the policy // evaluation should terminate with allow decision. Allow = privacy.Allow // Deny may be returned by rules to indicate that the policy // evaluation should terminate with deny decision. Deny = privacy.Deny // Skip may be returned by rules to indicate that the policy // evaluation should continue to the next rule. Skip = privacy.Skip )
Functions ¶
func DecisionContext ¶
DecisionContext creates a new context from the given parent context with a policy decision attach to it.
func DecisionFromContext ¶
DecisionFromContext retrieves the policy decision from the context.
Types ¶
type CurrencyMutationRuleFunc ¶
type CurrencyMutationRuleFunc func(context.Context, *entities.CurrencyMutation) error
The CurrencyMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (CurrencyMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type CurrencyQueryRuleFunc ¶
type CurrencyQueryRuleFunc func(context.Context, *entities.CurrencyQuery) error
The CurrencyQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type Filter ¶
Filter is the interface that wraps the Where function for filtering nodes in queries and mutations.
type FilterFunc ¶
The FilterFunc type is an adapter that allows the use of ordinary functions as filters for query and mutation types.
func (FilterFunc) EvalMutation ¶
EvalMutation calls f(ctx, q) if the mutation implements the Filter interface, otherwise it is denied.
type MarketMutationRuleFunc ¶
type MarketMutationRuleFunc func(context.Context, *entities.MarketMutation) error
The MarketMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (MarketMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type MarketQueryRuleFunc ¶
type MarketQueryRuleFunc func(context.Context, *entities.MarketQuery) error
The MarketQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type MutationPolicy ¶
type MutationPolicy = privacy.MutationPolicy
MutationPolicy combines multiple mutation rules into a single policy.
type MutationRule ¶
type MutationRule = privacy.MutationRule
MutationRule defines the interface which decides whether a mutation is allowed and optionally modifies it.
func DenyMutationOperationRule ¶
func DenyMutationOperationRule(op entities.Op) MutationRule
DenyMutationOperationRule returns a rule denying specified mutation operation.
func OnMutationOperation ¶
func OnMutationOperation(rule MutationRule, op entities.Op) MutationRule
OnMutationOperation evaluates the given rule only on a given mutation operation.
type MutationRuleFunc ¶
MutationRuleFunc type is an adapter which allows the use of ordinary functions as mutation rules.
func (MutationRuleFunc) EvalMutation ¶
EvalMutation returns f(ctx, m).
type OutboxMutationRuleFunc ¶
type OutboxMutationRuleFunc func(context.Context, *entities.OutboxMutation) error
The OutboxMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (OutboxMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type OutboxQueryRuleFunc ¶
type OutboxQueryRuleFunc func(context.Context, *entities.OutboxQuery) error
The OutboxQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type QueryMutationRule ¶
type QueryMutationRule interface { QueryRule MutationRule }
QueryMutationRule is an interface which 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 = privacy.QueryPolicy
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 TickerMutationRuleFunc ¶
type TickerMutationRuleFunc func(context.Context, *entities.TickerMutation) error
The TickerMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (TickerMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type TickerQueryRuleFunc ¶
type TickerQueryRuleFunc func(context.Context, *entities.TickerQuery) error
The TickerQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type TradingPairMutationRuleFunc ¶
type TradingPairMutationRuleFunc func(context.Context, *entities.TradingPairMutation) error
The TradingPairMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (TradingPairMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type TradingPairQueryRuleFunc ¶
type TradingPairQueryRuleFunc func(context.Context, *entities.TradingPairQuery) error
The TradingPairQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type VenueMutationRuleFunc ¶
type VenueMutationRuleFunc func(context.Context, *entities.VenueMutation) error
The VenueMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (VenueMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type VenueQueryRuleFunc ¶
type VenueQueryRuleFunc func(context.Context, *entities.VenueQuery) error
The VenueQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.