Documentation ¶
Index ¶
- type ClientImpl
- func (g *ClientImpl) GetImage(ctx context.Context, digest types.Digest) ([]byte, error)
- func (g *ClientImpl) LoadKnownDigests(ctx context.Context, w io.Writer) error
- func (g *ClientImpl) Options() GCSClientOptions
- func (g *ClientImpl) WriteKnownDigests(ctx context.Context, digests types.DigestSlice) error
- type GCSClient
- type GCSClientOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientImpl ¶
type ClientImpl struct {
// contains filtered or unexported fields
}
ClientImpl implements the GCSClient interface.
func NewGCSClient ¶
func NewGCSClient(ctx context.Context, client *http.Client, options GCSClientOptions) (*ClientImpl, error)
NewGCSClient creates a new instance of ClientImpl. The various output paths are set in GCSClientOptions.
func (*ClientImpl) GetImage ¶
GetImage downloads the bytes and returns them for the given image. It returns an error if the image is not found.
func (*ClientImpl) LoadKnownDigests ¶
LoadKnownDigests fulfills the GCSClient interface. It does no caching of the result.
func (*ClientImpl) Options ¶
func (g *ClientImpl) Options() GCSClientOptions
Options implements the GCSClient interface.
func (*ClientImpl) WriteKnownDigests ¶
func (g *ClientImpl) WriteKnownDigests(ctx context.Context, digests types.DigestSlice) error
WriteKnownDigests fulfills the GCSClient interface.
type GCSClient ¶
type GCSClient interface { // WriteKnownDigests writes the given list of digests to GCS as newline separated strings. WriteKnownDigests(ctx context.Context, digests types.DigestSlice) error // LoadKnownDigests loads the digests that have previously been written // to GS via WriteKnownDigests. The digests should be copied to the // provided writer 'w'. LoadKnownDigests(ctx context.Context, w io.Writer) error // GetImage returns the raw bytes of an image with the corresponding Digest. GetImage(ctx context.Context, digest types.Digest) ([]byte, error) // Options returns the options that were used to initialize the client Options() GCSClientOptions }
GCSClient provides an abstraction around read/writes to Google storage.
type GCSClientOptions ¶
type GCSClientOptions struct { // Bucket is the name of the GCS bucket we store to. Bucket string // KnownHashesGCSPath is the bucket and path for storing the list of known digests. KnownHashesGCSPath string // If DryRun is true, don't actually write the files (e.g. running locally) Dryrun bool }
GCSClientOptions is used to define input parameters to the GCSClient.
Click to show internal directories.
Click to hide internal directories.