Documentation ¶
Overview ¶
Package v1 implements the first version of the Clair API.
Index ¶
- func NewRouter(ctx *context.RouteContext) *httprouter.Router
- type Error
- type Feature
- type FeatureEnvelope
- type Layer
- type LayerEnvelope
- type Namespace
- type NamespaceEnvelope
- type Notification
- type NotificationEnvelope
- type OrderedLayerName
- type Vulnerability
- type VulnerabilityEnvelope
- type VulnerabilityWithLayers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouter ¶
func NewRouter(ctx *context.RouteContext) *httprouter.Router
NewRouter creates an HTTP router for version 1 of the Clair API.
Types ¶
type Feature ¶
type Feature struct { Name string `json:"Name,omitempty"` NamespaceName string `json:"NamespaceName,omitempty"` VersionFormat string `json:"VersionFormat,omitempty"` Version string `json:"Version,omitempty"` Vulnerabilities []Vulnerability `json:"Vulnerabilities,omitempty"` AddedBy string `json:"AddedBy,omitempty"` }
func FeatureFromDatabaseModel ¶
func FeatureFromDatabaseModel(dbFeatureVersion database.FeatureVersion) Feature
func (Feature) DatabaseModel ¶
func (f Feature) DatabaseModel() (fv database.FeatureVersion, err error)
type FeatureEnvelope ¶
type Layer ¶
type Layer struct { Name string `json:"Name,omitempty"` NamespaceName string `json:"NamespaceName,omitempty"` Path string `json:"Path,omitempty"` Headers map[string]string `json:"Headers,omitempty"` ParentName string `json:"ParentName,omitempty"` Format string `json:"Format,omitempty"` IndexedByVersion int `json:"IndexedByVersion,omitempty"` Features []Feature `json:"Features,omitempty"` }
type LayerEnvelope ¶
type NamespaceEnvelope ¶
type Notification ¶
type Notification struct { Name string `json:"Name,omitempty"` Created string `json:"Created,omitempty"` Notified string `json:"Notified,omitempty"` Deleted string `json:"Deleted,omitempty"` Limit int `json:"Limit,omitempty"` Page string `json:"Page,omitempty"` NextPage string `json:"NextPage,omitempty"` Old *VulnerabilityWithLayers `json:"Old,omitempty"` New *VulnerabilityWithLayers `json:"New,omitempty"` }
func NotificationFromDatabaseModel ¶
func NotificationFromDatabaseModel(dbNotification database.VulnerabilityNotification, limit int, pageToken string, nextPage database.VulnerabilityNotificationPageNumber, key string) Notification
type NotificationEnvelope ¶
type NotificationEnvelope struct { Notification *Notification `json:"Notification,omitempty"` Error *Error `json:"Error,omitempty"` }
type OrderedLayerName ¶
type Vulnerability ¶
type Vulnerability struct { Name string `json:"Name,omitempty"` NamespaceName string `json:"NamespaceName,omitempty"` Description string `json:"Description,omitempty"` Link string `json:"Link,omitempty"` Severity string `json:"Severity,omitempty"` Metadata map[string]interface{} `json:"Metadata,omitempty"` FixedBy string `json:"FixedBy,omitempty"` FixedIn []Feature `json:"FixedIn,omitempty"` }
func VulnerabilityFromDatabaseModel ¶
func VulnerabilityFromDatabaseModel(dbVuln database.Vulnerability, withFixedIn bool) Vulnerability
func (Vulnerability) DatabaseModel ¶
func (v Vulnerability) DatabaseModel() (database.Vulnerability, error)
type VulnerabilityEnvelope ¶
type VulnerabilityEnvelope struct { Vulnerability *Vulnerability `json:"Vulnerability,omitempty"` Vulnerabilities *[]Vulnerability `json:"Vulnerabilities,omitempty"` NextPage string `json:"NextPage,omitempty"` Error *Error `json:"Error,omitempty"` }
type VulnerabilityWithLayers ¶
type VulnerabilityWithLayers struct { Vulnerability *Vulnerability `json:"Vulnerability,omitempty"` // This field is guaranteed to be in order only for pagination. // Indices from different notifications may not be comparable. OrderedLayersIntroducingVulnerability []OrderedLayerName `json:"OrderedLayersIntroducingVulnerability,omitempty"` // This field is deprecated. LayersIntroducingVulnerability []string `json:"LayersIntroducingVulnerability,omitempty"` }
func VulnerabilityWithLayersFromDatabaseModel ¶
func VulnerabilityWithLayersFromDatabaseModel(dbVuln database.Vulnerability) VulnerabilityWithLayers
Click to show internal directories.
Click to hide internal directories.