Documentation ¶
Index ¶
- func IndexFunction(data interface{}) map[string][]string
- type ConfigIndex
- func (ci *ConfigIndex) ListAll() (policyIDs []string)
- func (ci *ConfigIndex) LookupPolicy(policyID string) (found bool, data *policymodel.Policy)
- func (ci *ConfigIndex) LookupPolicyByLabelSelector(policyLabelSelector string) (policyIDs []string)
- func (ci *ConfigIndex) LookupPolicyByNSLabelSelector(policyNSLabelSelector string) (policyIDs []string)
- func (ci *ConfigIndex) RegisterPolicy(policyID string, data *policymodel.Policy)
- func (ci *ConfigIndex) UnregisterPolicy(policyID string) (found bool, data *policymodel.Policy)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IndexFunction ¶
IndexFunction creates secondary indexes.
Types ¶
type ConfigIndex ¶
type ConfigIndex struct {
// contains filtered or unexported fields
}
ConfigIndex implements a cache for configured policies. Primary index is policyID.
func NewConfigIndex ¶
func NewConfigIndex(logger logging.Logger, owner core.PluginName, title string) *ConfigIndex
NewConfigIndex creates new instance of ConfigIndex
func (*ConfigIndex) ListAll ¶
func (ci *ConfigIndex) ListAll() (policyIDs []string)
ListAll returns all registered names in the mapping.
func (*ConfigIndex) LookupPolicy ¶
func (ci *ConfigIndex) LookupPolicy(policyID string) (found bool, data *policymodel.Policy)
LookupPolicy looks up a Policy entry given a policyID.
func (*ConfigIndex) LookupPolicyByLabelSelector ¶
func (ci *ConfigIndex) LookupPolicyByLabelSelector(policyLabelSelector string) (policyIDs []string)
LookupPolicyByLabelSelector performs lookup based on secondary index policyLabelSelector.
func (*ConfigIndex) LookupPolicyByNSLabelSelector ¶
func (ci *ConfigIndex) LookupPolicyByNSLabelSelector(policyNSLabelSelector string) (policyIDs []string)
LookupPolicyByNSLabelSelector performs lookup based on secondary index namespace/policyNSLabelSelector.
func (*ConfigIndex) RegisterPolicy ¶
func (ci *ConfigIndex) RegisterPolicy(policyID string, data *policymodel.Policy)
RegisterPolicy adds new Policy entry into the Policy mapping
func (*ConfigIndex) UnregisterPolicy ¶
func (ci *ConfigIndex) UnregisterPolicy(policyID string) (found bool, data *policymodel.Policy)
UnregisterPolicy removes a Policy entry from the Policy mapping given a policyID
Click to show internal directories.
Click to hide internal directories.