Documentation ¶
Index ¶
- func ParseClairSev(clairSev string) models.Severity
- func TransformVuln(clairVuln *models.ClairLayerEnvelope) (*models.ComponentsOverview, models.Severity)
- func UpdateScanOverview(digest, layerName string, clairEndpoint string, l ...*log.Logger) error
- type Client
- func (c *Client) DeleteNotification(id string) error
- func (c *Client) GetNotification(id string) (*models.ClairNotification, error)
- func (c *Client) GetResult(layerName string) (*models.ClairLayerEnvelope, error)
- func (c *Client) ListNamespaces() ([]string, error)
- func (c *Client) ScanLayer(l models.ClairLayer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseClairSev ¶
ParseClairSev parse the severity of clair to Harbor's Severity type if the string is not recognized the value will be set to unknown.
func TransformVuln ¶
func TransformVuln(clairVuln *models.ClairLayerEnvelope) (*models.ComponentsOverview, models.Severity)
TransformVuln is for running scanning job in both job service V1 and V2.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client communicates with clair endpoint to scan image and get detailed scan result
func NewClient ¶
NewClient creates a new instance of client, set the logger as the job's logger if it's used in a job handler.
func (*Client) DeleteNotification ¶
DeleteNotification deletes a notification record from Clair
func (*Client) GetNotification ¶
func (c *Client) GetNotification(id string) (*models.ClairNotification, error)
GetNotification calls Clair's API to get details of notification
func (*Client) GetResult ¶
func (c *Client) GetResult(layerName string) (*models.ClairLayerEnvelope, error)
GetResult calls Clair's API to get layers with detailed vulnerability list
func (*Client) ListNamespaces ¶
ListNamespaces list the namespaces in Clair
Click to show internal directories.
Click to hide internal directories.