Documentation ¶
Index ¶
- func CreateImageAnnotations(obj interface{}, name string, count int) map[string]string
- func CreateImageLabels(obj interface{}, name string, count int) map[string]string
- func CreatePodAnnotations(obj interface{}) map[string]string
- func CreatePodLabels(obj interface{}) map[string]string
- func RemoveRegistryInfo(d string) string
- func ShortenLabelContent(data string) string
- func StringMapContains(bigMap map[string]string, subset map[string]string) bool
- type ImageAnnotationData
- func (iad *ImageAnnotationData) GetComponentsURL() string
- func (iad *ImageAnnotationData) GetOverallStatus() string
- func (iad *ImageAnnotationData) GetPolicyViolationCount() int
- func (iad *ImageAnnotationData) GetScanClientVersion() string
- func (iad *ImageAnnotationData) GetServerVersion() string
- func (iad *ImageAnnotationData) GetVulnerabilityCount() int
- func (iad *ImageAnnotationData) HasPolicyViolations() bool
- func (iad *ImageAnnotationData) HasVulnerabilities() bool
- type ImageAnnotatorHandler
- type ImageAnnotatorHandlerFuncs
- type MapCompareHandler
- type MapCompareHandlerFuncs
- type PodAnnotationData
- func (pad *PodAnnotationData) GetHubVersion() string
- func (pad *PodAnnotationData) GetOverallStatus() string
- func (pad *PodAnnotationData) GetPolicyViolationCount() int
- func (pad *PodAnnotationData) GetScanClientVersion() string
- func (pad *PodAnnotationData) GetVulnerabilityCount() int
- func (pad *PodAnnotationData) HasPolicyViolations() bool
- func (pad *PodAnnotationData) HasVulnerabilities() bool
- type PodAnnotatorHandler
- type PodAnnotatorHandlerFuncs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateImageAnnotations ¶
CreateImageAnnotations returns a map of annotations from a ImageAnnotationData object
func CreateImageLabels ¶
CreateImageLabels returns a map of labels from a ImageAnnotationData object
func CreatePodAnnotations ¶
CreatePodAnnotations returns a map of annotations from a PodAnnotationData object
func CreatePodLabels ¶
CreatePodLabels returns a map of labels from a PodAnnotationData object
func RemoveRegistryInfo ¶
RemoveRegistryInfo will take a string and return a string that removes any registry name information and replaces all / with .
func ShortenLabelContent ¶
ShortenLabelContent will ensure the data is less than the 63 character limit and doesn't contain any characters that are not allowed
Types ¶
type ImageAnnotationData ¶
type ImageAnnotationData struct {
// contains filtered or unexported fields
}
ImageAnnotationData describes the data model for image annotation
func NewImageAnnotationData ¶
func NewImageAnnotationData(policyViolationCount int, vulnerabilityCount int, overallStatus string, url string, serverVersion string, scVersion string) *ImageAnnotationData
NewImageAnnotationData creates a new ImageAnnotationData object
func (*ImageAnnotationData) GetComponentsURL ¶
func (iad *ImageAnnotationData) GetComponentsURL() string
GetComponentsURL returns the image components URL
func (*ImageAnnotationData) GetOverallStatus ¶
func (iad *ImageAnnotationData) GetOverallStatus() string
GetOverallStatus returns the image overall status
func (*ImageAnnotationData) GetPolicyViolationCount ¶
func (iad *ImageAnnotationData) GetPolicyViolationCount() int
GetPolicyViolationCount returns the number of image policy violations
func (*ImageAnnotationData) GetScanClientVersion ¶
func (iad *ImageAnnotationData) GetScanClientVersion() string
GetScanClientVersion returns the version of the scan client used to scan the image
func (*ImageAnnotationData) GetServerVersion ¶
func (iad *ImageAnnotationData) GetServerVersion() string
GetServerVersion returns the version of the hub that provided the information
func (*ImageAnnotationData) GetVulnerabilityCount ¶
func (iad *ImageAnnotationData) GetVulnerabilityCount() int
GetVulnerabilityCount returns the number of image vulnerabilities
func (*ImageAnnotationData) HasPolicyViolations ¶
func (iad *ImageAnnotationData) HasPolicyViolations() bool
HasPolicyViolations returns true if the image has any policy violations
func (*ImageAnnotationData) HasVulnerabilities ¶
func (iad *ImageAnnotationData) HasVulnerabilities() bool
HasVulnerabilities returns true if the image has any vulnerabilities
type ImageAnnotatorHandler ¶
type ImageAnnotatorHandler interface { MapCompareHandler CreateImageLabels(interface{}, string, int) map[string]string CreateImageAnnotations(interface{}, string, int) map[string]string }
ImageAnnotatorHandler provides the functions needed to annotate images
type ImageAnnotatorHandlerFuncs ¶
type ImageAnnotatorHandlerFuncs struct { MapCompareHandlerFuncs ImageLabelCreationFunc func(interface{}, string, int) map[string]string ImageAnnotationCreationFunc func(interface{}, string, int) map[string]string }
ImageAnnotatorHandlerFuncs is an adapter to let you easily define as many of the image annotation functions as desired while still implementing ImageAnnotatorHandler
func (ImageAnnotatorHandlerFuncs) CreateImageAnnotations ¶
func (i ImageAnnotatorHandlerFuncs) CreateImageAnnotations(data interface{}, name string, count int) map[string]string
CreateImageAnnotations calls AnnotationCreationFunc if it is not null
func (ImageAnnotatorHandlerFuncs) CreateImageLabels ¶
func (i ImageAnnotatorHandlerFuncs) CreateImageLabels(data interface{}, name string, count int) map[string]string
CreateImageLabels calls LabelCreationFunc if it is not null
type MapCompareHandler ¶
MapCompareHandler handles comparing 2 maps
type MapCompareHandlerFuncs ¶
type MapCompareHandlerFuncs struct {
MapCompareFunc func(map[string]string, map[string]string) bool
}
MapCompareHandlerFuncs is an adapter to let you easily define a function to use to compare 2 maps if desired while still implementing MapCompareHandler
func (MapCompareHandlerFuncs) CompareMaps ¶
func (m MapCompareHandlerFuncs) CompareMaps(bigMap map[string]string, subset map[string]string) bool
CompareMaps calls MapCompareFunc if it is not null
type PodAnnotationData ¶
type PodAnnotationData struct {
// contains filtered or unexported fields
}
PodAnnotationData describes the data model for pod annotation
func NewPodAnnotationData ¶
func NewPodAnnotationData(policyViolationCount int, vulnerabilityCount int, overallStatus string, hubVersion string, scVersion string) *PodAnnotationData
NewPodAnnotationData creates a new PodAnnotationData object
func (*PodAnnotationData) GetHubVersion ¶
func (pad *PodAnnotationData) GetHubVersion() string
GetHubVersion returns the version of the hub that provided the information
func (*PodAnnotationData) GetOverallStatus ¶
func (pad *PodAnnotationData) GetOverallStatus() string
GetOverallStatus returns the pod overall status
func (*PodAnnotationData) GetPolicyViolationCount ¶
func (pad *PodAnnotationData) GetPolicyViolationCount() int
GetPolicyViolationCount returns the number of pod policy violations
func (*PodAnnotationData) GetScanClientVersion ¶
func (pad *PodAnnotationData) GetScanClientVersion() string
GetScanClientVersion returns the version of the scan client used to scan the images
func (*PodAnnotationData) GetVulnerabilityCount ¶
func (pad *PodAnnotationData) GetVulnerabilityCount() int
GetVulnerabilityCount returns the number of pod vulnerabilities
func (*PodAnnotationData) HasPolicyViolations ¶
func (pad *PodAnnotationData) HasPolicyViolations() bool
HasPolicyViolations returns true if the pod has any policy violations
func (*PodAnnotationData) HasVulnerabilities ¶
func (pad *PodAnnotationData) HasVulnerabilities() bool
HasVulnerabilities returns true if the pod has any vulnerabilities
type PodAnnotatorHandler ¶
type PodAnnotatorHandler interface { ImageAnnotatorHandler CreatePodLabels(interface{}) map[string]string CreatePodAnnotations(interface{}) map[string]string }
PodAnnotatorHandler provides the functions needed to annotate pods
type PodAnnotatorHandlerFuncs ¶
type PodAnnotatorHandlerFuncs struct { ImageAnnotatorHandlerFuncs PodLabelCreationFunc func(interface{}) map[string]string PodAnnotationCreationFunc func(interface{}) map[string]string }
PodAnnotatorHandlerFuncs is an adapter to let you easily define as many of the pod annotation functions as desired while still implementing PodAnnotatorHandler
func (PodAnnotatorHandlerFuncs) CreatePodAnnotations ¶
func (p PodAnnotatorHandlerFuncs) CreatePodAnnotations(data interface{}) map[string]string
CreatePodAnnotations calls AnnotationCreationFunc if it is not null
func (PodAnnotatorHandlerFuncs) CreatePodLabels ¶
func (p PodAnnotatorHandlerFuncs) CreatePodLabels(data interface{}) map[string]string
CreatePodLabels calls LabelCreationFunc if it is not null