Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPolicyReportClient ¶
func NewPolicyReportClient( client PolicyReportAdapter, store *report.PolicyReportStore, startUp time.Time, resultCache *cache.Cache, ) report.PolicyResultClient
NewPolicyReportClient creates a new PolicyReportClient based on the kubernetes go-client
Types ¶
type ConfigMapAdapter ¶
type ConfigMapAdapter interface { // GetConfig return a single ConfigMap by name if exist GetConfig(ctx context.Context, name string) (*apiv1.ConfigMap, error) // WatchConfigs calls its ConfigMapCallback whenever a ConfigMap was added, modified or deleted WatchConfigs(ctx context.Context, cb ConfigMapCallback) error }
ConfigMapAdapter provides simplified APIs for ConfigMap Resources
func NewConfigMapAdapter ¶
func NewConfigMapAdapter(api v1.ConfigMapInterface) ConfigMapAdapter
NewConfigMapAdapter creates a new ConfigMapClient
type ConfigMapCallback ¶
ConfigMapCallback is used by WatchConfigs
type Mapper ¶
type Mapper interface { // MapPolicyReport maps a map into a PolicyReport MapPolicyReport(reportMap map[string]interface{}) report.PolicyReport // SetPriorityMap updates the policy/status to priority mapping SetPriorityMap(map[string]string) // SyncPriorities when ConfigMap has changed SyncPriorities(ctx context.Context) error // FetchPriorities from ConfigMap FetchPriorities(ctx context.Context) error }
Mapper converts maps into report structs
type PolicyReportAdapter ¶
type PolicyReportAdapter interface { WatchPolicyReports(ctx context.Context) (chan WatchEvent, error) GetFoundResources() map[string]string }
PolicyReportAdapter translates API responses to an internal struct
func NewPolicyReportAdapter ¶
func NewPolicyReportAdapter(dynamic dynamic.Interface, mapper Mapper) PolicyReportAdapter
NewPolicyReportAdapter new Adapter for Policy Report Kubernetes API
type WatchEvent ¶
type WatchEvent struct { Report report.PolicyReport Type watch.EventType }
WatchEvent of PolicyReports
Click to show internal directories.
Click to hide internal directories.