Documentation ¶
Index ¶
- Variables
- func Allowf(format string, a ...interface{}) error
- func DecisionContext(parent context.Context, decision error) context.Context
- func DecisionFromContext(ctx context.Context) (error, bool)
- func Denyf(format string, a ...interface{}) error
- func Skipf(format string, a ...interface{}) error
- type DiscordAccountMutationRuleFunc
- type DiscordAccountQueryRuleFunc
- type DiscordBotMutationRuleFunc
- type DiscordBotQueryRuleFunc
- type GithubAccountMutationRuleFunc
- type GithubAccountQueryRuleFunc
- type GithubOrganizationMemberMutationRuleFunc
- type GithubOrganizationMemberQueryRuleFunc
- type GithubOrganizationMutationRuleFunc
- type GithubOrganizationQueryRuleFunc
- type MutationPolicy
- type MutationRule
- type MutationRuleFunc
- type Policy
- type ProjectAssociationMutationRuleFunc
- type ProjectAssociationQueryRuleFunc
- type ProjectContributorMutationRuleFunc
- type ProjectContributorQueryRuleFunc
- type ProjectMutationRuleFunc
- type ProjectQueryRuleFunc
- type ProjectTechnologyMutationRuleFunc
- type ProjectTechnologyQueryRuleFunc
- type QueryMutationRule
- type QueryPolicy
- type QueryRule
- type QueryRuleFunc
- type RepositoryMutationRuleFunc
- type RepositoryQueryRuleFunc
- type RepositoryTechnologyMutationRuleFunc
- type RepositoryTechnologyQueryRuleFunc
- type SiteMutationRuleFunc
- type SiteQueryRuleFunc
- type TechnologyAssociationMutationRuleFunc
- type TechnologyAssociationQueryRuleFunc
- type TechnologyMutationRuleFunc
- type TechnologyQueryRuleFunc
- type UserMutationRuleFunc
- type UserQueryRuleFunc
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 DiscordAccountMutationRuleFunc ¶
type DiscordAccountMutationRuleFunc func(context.Context, *ent.DiscordAccountMutation) error
The DiscordAccountMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (DiscordAccountMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type DiscordAccountQueryRuleFunc ¶
type DiscordAccountQueryRuleFunc func(context.Context, *ent.DiscordAccountQuery) error
The DiscordAccountQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type DiscordBotMutationRuleFunc ¶
type DiscordBotMutationRuleFunc func(context.Context, *ent.DiscordBotMutation) error
The DiscordBotMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (DiscordBotMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type DiscordBotQueryRuleFunc ¶
type DiscordBotQueryRuleFunc func(context.Context, *ent.DiscordBotQuery) error
The DiscordBotQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type GithubAccountMutationRuleFunc ¶
type GithubAccountMutationRuleFunc func(context.Context, *ent.GithubAccountMutation) error
The GithubAccountMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (GithubAccountMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type GithubAccountQueryRuleFunc ¶
type GithubAccountQueryRuleFunc func(context.Context, *ent.GithubAccountQuery) error
The GithubAccountQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type GithubOrganizationMemberMutationRuleFunc ¶
type GithubOrganizationMemberMutationRuleFunc func(context.Context, *ent.GithubOrganizationMemberMutation) error
The GithubOrganizationMemberMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (GithubOrganizationMemberMutationRuleFunc) EvalMutation ¶
func (f GithubOrganizationMemberMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error
EvalMutation calls f(ctx, m).
type GithubOrganizationMemberQueryRuleFunc ¶
type GithubOrganizationMemberQueryRuleFunc func(context.Context, *ent.GithubOrganizationMemberQuery) error
The GithubOrganizationMemberQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type GithubOrganizationMutationRuleFunc ¶
type GithubOrganizationMutationRuleFunc func(context.Context, *ent.GithubOrganizationMutation) error
The GithubOrganizationMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (GithubOrganizationMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type GithubOrganizationQueryRuleFunc ¶
type GithubOrganizationQueryRuleFunc func(context.Context, *ent.GithubOrganizationQuery) error
The GithubOrganizationQueryRuleFunc 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 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 which allows the use of ordinary functions as mutation rules.
func (MutationRuleFunc) EvalMutation ¶
EvalMutation returns f(ctx, m).
type ProjectAssociationMutationRuleFunc ¶
type ProjectAssociationMutationRuleFunc func(context.Context, *ent.ProjectAssociationMutation) error
The ProjectAssociationMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ProjectAssociationMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ProjectAssociationQueryRuleFunc ¶
type ProjectAssociationQueryRuleFunc func(context.Context, *ent.ProjectAssociationQuery) error
The ProjectAssociationQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type ProjectContributorMutationRuleFunc ¶
type ProjectContributorMutationRuleFunc func(context.Context, *ent.ProjectContributorMutation) error
The ProjectContributorMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ProjectContributorMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ProjectContributorQueryRuleFunc ¶
type ProjectContributorQueryRuleFunc func(context.Context, *ent.ProjectContributorQuery) error
The ProjectContributorQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type ProjectMutationRuleFunc ¶
type ProjectMutationRuleFunc func(context.Context, *ent.ProjectMutation) error
The ProjectMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ProjectMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ProjectQueryRuleFunc ¶
type ProjectQueryRuleFunc func(context.Context, *ent.ProjectQuery) error
The ProjectQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type ProjectTechnologyMutationRuleFunc ¶
type ProjectTechnologyMutationRuleFunc func(context.Context, *ent.ProjectTechnologyMutation) error
The ProjectTechnologyMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (ProjectTechnologyMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type ProjectTechnologyQueryRuleFunc ¶
type ProjectTechnologyQueryRuleFunc func(context.Context, *ent.ProjectTechnologyQuery) error
The ProjectTechnologyQueryRuleFunc 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 RepositoryMutationRuleFunc ¶
type RepositoryMutationRuleFunc func(context.Context, *ent.RepositoryMutation) error
The RepositoryMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (RepositoryMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type RepositoryQueryRuleFunc ¶
type RepositoryQueryRuleFunc func(context.Context, *ent.RepositoryQuery) error
The RepositoryQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type RepositoryTechnologyMutationRuleFunc ¶
type RepositoryTechnologyMutationRuleFunc func(context.Context, *ent.RepositoryTechnologyMutation) error
The RepositoryTechnologyMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (RepositoryTechnologyMutationRuleFunc) EvalMutation ¶
func (f RepositoryTechnologyMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error
EvalMutation calls f(ctx, m).
type RepositoryTechnologyQueryRuleFunc ¶
type RepositoryTechnologyQueryRuleFunc func(context.Context, *ent.RepositoryTechnologyQuery) error
The RepositoryTechnologyQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type SiteMutationRuleFunc ¶
type SiteMutationRuleFunc func(context.Context, *ent.SiteMutation) error
The SiteMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (SiteMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type SiteQueryRuleFunc ¶
The SiteQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type TechnologyAssociationMutationRuleFunc ¶
type TechnologyAssociationMutationRuleFunc func(context.Context, *ent.TechnologyAssociationMutation) error
The TechnologyAssociationMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (TechnologyAssociationMutationRuleFunc) EvalMutation ¶
func (f TechnologyAssociationMutationRuleFunc) EvalMutation(ctx context.Context, m ent.Mutation) error
EvalMutation calls f(ctx, m).
type TechnologyAssociationQueryRuleFunc ¶
type TechnologyAssociationQueryRuleFunc func(context.Context, *ent.TechnologyAssociationQuery) error
The TechnologyAssociationQueryRuleFunc type is an adapter to allow the use of ordinary functions as a query rule.
type TechnologyMutationRuleFunc ¶
type TechnologyMutationRuleFunc func(context.Context, *ent.TechnologyMutation) error
The TechnologyMutationRuleFunc type is an adapter to allow the use of ordinary functions as a mutation rule.
func (TechnologyMutationRuleFunc) EvalMutation ¶
EvalMutation calls f(ctx, m).
type TechnologyQueryRuleFunc ¶
type TechnologyQueryRuleFunc func(context.Context, *ent.TechnologyQuery) error
The TechnologyQueryRuleFunc 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.