Documentation
¶
Overview ¶
Package client provides an HTTP client for selected Khulnasoft Enterprise API endpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type Authorization ¶
type Authorization struct {
Basic *UsernameAndPassword
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents Khulnasoft API client.
Currently it is not possible to generate API clientset from Swagger / Open API specs, but if that was possible this implementations would be deprecated.
func NewClient ¶
func NewClient(baseURL string, authorization Authorization) (*Client, error)
NewClient constructs a new API client with the specified base URL and authorization details.
func (*Client) Images ¶
func (c *Client) Images() ImagesInterface
func (*Client) Registries ¶
func (c *Client) Registries() RegistriesInterface
type Clientset ¶
type Clientset interface {
Registries() RegistriesInterface
Images() ImagesInterface
}
Clientset defines methods of the Khulnasoft API client.
type Images ¶
type Images struct {
// contains filtered or unexported fields
}
func (*Images) Vulnerabilities ¶
func (i *Images) Vulnerabilities(registry, repo, tag string) (VulnerabilitiesResponse, error)
type ImagesInterface ¶
type ImagesInterface interface {
Vulnerabilities(registry, repo, tag string) (VulnerabilitiesResponse, error)
}
type Registries ¶
type Registries struct {
// contains filtered or unexported fields
}
func (*Registries) List ¶
func (r *Registries) List() ([]RegistryResponse, error)
type RegistriesInterface ¶
type RegistriesInterface interface {
List() ([]RegistryResponse, error)
}
type RegistryResponse ¶
type UsernameAndPassword ¶
type VulnerabilitiesResponse ¶
type VulnerabilitiesResponse struct {
Count int `json:"count"`
Results []VulnerabilitiesResponseResult `json:"result"`
}
type VulnerabilitiesResponseResult ¶
type VulnerabilitiesResponseResult struct {
Registry string `json:"registry"`
ImageRepositoryName string `json:"image_repository_name"`
Resource Resource `json:"resource"`
Name string `json:"name"` // e.g. CVE-2020-3910
Description string `json:"description"`
KhulnasoftSeverity string `json:"khulnasoft_severity"`
KhulnasoftVectors string `json:"khulnasoft_vectors"`
KhulnasoftScoringSystem string `json:"khulnasoft_scoring_system"`
FixVersion string `json:"fix_version"`
}
Click to show internal directories.
Click to hide internal directories.