Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Mgr = New()
Mgr is a global instance of policy manager
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter interface { // Build filter from the given policy schema BuildFrom(pl *policy.Schema) Filter // Filter the inputting candidates and return the matched ones. Filter(candidates []*selector.Candidate) ([]*selector.Candidate, error) }
Filter defines the filter operations of the preheat policy.
type Manager ¶
type Manager interface { // Count returns the total count of policies according to the query Count(ctx context.Context, query *q.Query) (total int64, err error) // Create the policy schema Create(ctx context.Context, schema *policy.Schema) (id int64, err error) // Update the policy schema, Only the properties specified by "props" will be updated if it is set Update(ctx context.Context, schema *policy.Schema, props ...string) (err error) // Get the policy schema by id Get(ctx context.Context, id int64) (schema *policy.Schema, err error) // GetByName the policy schema by project ID and name GetByName(ctx context.Context, projectID int64, name string) (schema *policy.Schema, err error) // Delete the policy schema by id Delete(ctx context.Context, id int64) (err error) // List policy schemas by query ListPolicies(ctx context.Context, query *q.Query) (schemas []*policy.Schema, err error) // list policy schema under project ListPoliciesByProject(ctx context.Context, project int64, query *q.Query) (schemas []*policy.Schema, err error) }
Manager manages the policy
Click to show internal directories.
Click to hide internal directories.