Documentation ¶
Index ¶
- Constants
- Variables
- func NewAPIError(statusCode int, url, method string, data []byte) error
- type APIError
- type APIService
- type Client
- func (g *Client) AddAttestationToImage(ctx context.Context, ref reference.Canonical, payload voucher.Attestation) (voucher.SignedAttestation, error)
- func (g *Client) CanAttest() bool
- func (g *Client) Close()
- func (g *Client) GetAttestations(ctx context.Context, ref reference.Canonical) ([]voucher.SignedAttestation, error)
- func (g *Client) GetBuildDetail(ctx context.Context, ref reference.Canonical) (repository.BuildDetail, error)
- func (g *Client) GetVulnerabilities(ctx context.Context, ref reference.Canonical) (items []voucher.Vulnerability, err error)
- func (g *Client) NewPayloadBody(ref reference.Canonical) (string, error)
Constants ¶
const DeploymentType voucher.MetadataType = "deployment"
DeploymentType is a Grafeas specific type which refers to MetadataItems containing deployment data.
const DiscoveryType voucher.MetadataType = "discovery"
DiscoveryType is a Grafeas specific type which refers to MetadataItems containing metadata discovery status.
const ImageType voucher.MetadataType = "image"
ImageType is a Grafeas specific type which refers to MetadataItems containing Image information.
const PackageType voucher.MetadataType = "package"
PackageType is a Grafeas specific type which refers to MetadataItems containing package information.
Variables ¶
var (
ErrTimeout = errors.New("timeout error when getting REST data")
)
GrafeasAPIService vars
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
// contains filtered or unexported fields
}
APIError to store grafeas API errors
type APIService ¶
type APIService interface { CreateOccurrence(context.Context, string, objects.Occurrence) (objects.Occurrence, error) ListNotes(context.Context, string, *objects.ListOpts) (objects.ListNotesResponse, error) ListOccurrences(context.Context, string, *objects.ListOpts) (objects.ListOccurrencesResponse, error) }
APIService is the interface for communicating with Grafeas
func NewAPIService ¶
func NewAPIService(basePath, versionPath string) APIService
NewAPIService creates new GrafeasAPIService
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client implements voucher.MetadataClient, connecting to Grafeas.
func NewClient ¶
func NewClient(ctx context.Context, binauthProject, vulProject string, keyring signer.AttestationSigner, service APIService) (*Client, error)
NewClient creates a new Grafeas Client.
func (*Client) AddAttestationToImage ¶
func (g *Client) AddAttestationToImage(ctx context.Context, ref reference.Canonical, payload voucher.Attestation) (voucher.SignedAttestation, error)
AddAttestationToImage adds a new attestation with the passed Attestation to the image described by ImageData.
func (*Client) GetAttestations ¶
func (g *Client) GetAttestations(ctx context.Context, ref reference.Canonical) ([]voucher.SignedAttestation, error)
GetAttestations returns all of the attestations associated with an image
func (*Client) GetBuildDetail ¶
func (g *Client) GetBuildDetail(ctx context.Context, ref reference.Canonical) (repository.BuildDetail, error)
GetBuildDetail gets BuildDetails for the passed image.
func (*Client) GetVulnerabilities ¶
func (g *Client) GetVulnerabilities(ctx context.Context, ref reference.Canonical) (items []voucher.Vulnerability, err error)
GetVulnerabilities returns the detected vulnerabilities for the Image described by voucher.ImageData.