Documentation ¶
Index ¶
- func DecodeJSONBody(resp *http.Response, out interface{}) error
- func ErrorStatusCode(err error) int
- func IsStatusCodeError(err error) bool
- type Client
- func (c *Client) DeleteFixes(nspace, vuln, feat string) error
- func (c *Client) DeleteLayers(name string) error
- func (c *Client) DeleteNotifications(name string) error
- func (c *Client) DeleteVulnerbaility(nspace, vuln string) error
- func (c *Client) GetFixes(nspace, vuln string) (*FeatureEnvelope, error)
- func (c *Client) GetLayers(name string, withFeatures, withVulnerabilities bool) (*LayerEnvelope, error)
- func (c *Client) GetNamespaces() (*NamespaceEnvelope, error)
- func (c *Client) GetNotifications(name, page string, limit int) (*NotificationEnvelope, error)
- func (c *Client) GetVulnerabilities(nspace string) (*VulnerabilityEnvelope, error)
- func (c *Client) GetVulnerability(nspace, vuln string) (*VulnerabilityEnvelope, error)
- func (c *Client) PostLayers(layer *Layer) (*LayerEnvelope, error)
- func (c *Client) PostVulnerabilities(vuln *Vulnerability) (*VulnerabilityEnvelope, error)
- func (c *Client) PutFixes(vuln string, feat *Feature) (*FeatureEnvelope, error)
- func (c *Client) PutVulnerbaility(vuln *Vulnerability) (*VulnerabilityEnvelope, error)
- func (c *Client) Request(r *Request) (*http.Response, error)
- type Config
- type Error
- type Feature
- type FeatureEnvelope
- type Layer
- type LayerEnvelope
- type Namespace
- type NamespaceEnvelope
- type Notification
- type NotificationEnvelope
- type OrderedLayerName
- type Request
- type TLSConfig
- type Vulnerability
- type VulnerabilityEnvelope
- type VulnerabilityWithLayers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSONBody ¶
DecodeJSONBody decodes the body from a response into the provided interface
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct
func (*Client) DeleteFixes ¶
DeleteFixes func init
func (*Client) DeleteLayers ¶
DeleteLayers func init
func (*Client) DeleteNotifications ¶
DeleteNotifications func init
func (*Client) DeleteVulnerbaility ¶
DeleteVulnerbaility func init
func (*Client) GetFixes ¶
func (c *Client) GetFixes(nspace, vuln string) (*FeatureEnvelope, error)
GetFixes func init
func (*Client) GetLayers ¶
func (c *Client) GetLayers(name string, withFeatures, withVulnerabilities bool) (*LayerEnvelope, error)
GetLayers func init
func (*Client) GetNamespaces ¶
func (c *Client) GetNamespaces() (*NamespaceEnvelope, error)
GetNamespaces func init
func (*Client) GetNotifications ¶
func (c *Client) GetNotifications(name, page string, limit int) (*NotificationEnvelope, error)
GetNotifications func init
func (*Client) GetVulnerabilities ¶
func (c *Client) GetVulnerabilities(nspace string) (*VulnerabilityEnvelope, error)
GetVulnerabilities init
func (*Client) GetVulnerability ¶
func (c *Client) GetVulnerability(nspace, vuln string) (*VulnerabilityEnvelope, error)
GetVulnerability init
func (*Client) PostLayers ¶
func (c *Client) PostLayers(layer *Layer) (*LayerEnvelope, error)
PostLayers func init
func (*Client) PostVulnerabilities ¶
func (c *Client) PostVulnerabilities(vuln *Vulnerability) (*VulnerabilityEnvelope, error)
PostVulnerabilities init
func (*Client) PutFixes ¶
func (c *Client) PutFixes(vuln string, feat *Feature) (*FeatureEnvelope, error)
PutFixes func init
func (*Client) PutVulnerbaility ¶
func (c *Client) PutVulnerbaility(vuln *Vulnerability) (*VulnerabilityEnvelope, error)
PutVulnerbaility init
type Config ¶
Config for Clair Client
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig will return a client configuration with default values
func (*Config) ConfigureTLS ¶
ConfigureTLS will apply the provided tlsconfig to the config
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"` }
Feature struct init
type FeatureEnvelope ¶
type FeatureEnvelope struct { Feature *Feature `json:"Feature,omitempty"` Features *[]Feature `json:"Features,omitempty"` Error *Error `json:"Error,omitempty"` }
FeatureEnvelope struct init
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"` }
Layer struct init
type LayerEnvelope ¶
type LayerEnvelope struct { Layer *Layer `json:"Layer,omitempty"` Error *Error `json:"Error,omitempty"` }
LayerEnvelope struct init
type Namespace ¶
type Namespace struct { Name string `json:"Name,omitempty"` VersionFormat string `json:"VersionFormat,omitempty"` }
Namespace struct init
type NamespaceEnvelope ¶
type NamespaceEnvelope struct { Namespaces *[]Namespace `json:"Namespaces,omitempty"` Error *Error `json:"Error,omitempty"` }
NamespaceEnvelope struct init
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"` }
Notification struct init
type NotificationEnvelope ¶
type NotificationEnvelope struct { Notification *Notification `json:"Notification,omitempty"` Error *Error `json:"Error,omitempty"` }
NotificationEnvelope struct init
type OrderedLayerName ¶
OrderedLayerName struct init
type Request ¶
Request struct init
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"` }
Vulnerability struct init
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"` }
VulnerabilityEnvelope struct init
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"` }
VulnerabilityWithLayers struct init