Documentation ¶
Overview ¶
Package blob is the underlying type for pushing and pulling blobs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BCommon ¶ added in v0.5.2
type BCommon struct {
// contains filtered or unexported fields
}
BCommon is a common struct for all blobs which includes various shared methods.
func (*BCommon) GetDescriptor ¶ added in v0.5.2
func (c *BCommon) GetDescriptor() descriptor.Descriptor
GetDescriptor returns the descriptor associated with the blob.
func (*BCommon) RawHeaders ¶ added in v0.5.2
RawHeaders returns the headers received from the registry.
type BOCIConfig ¶ added in v0.5.2
type BOCIConfig struct { BCommon // contains filtered or unexported fields }
BOCIConfig includes an OCI Image Config struct that may be extracted from or pushed to a blob.
func NewOCIConfig ¶
func NewOCIConfig(opts ...Opts) *BOCIConfig
NewOCIConfig creates a new BOCIConfig. When created from an existing blob, a BOCIConfig will be created using BReader.ToOCIConfig().
func (*BOCIConfig) GetConfig ¶ added in v0.5.2
func (oc *BOCIConfig) GetConfig() v1.Image
GetConfig returns OCI config.
func (*BOCIConfig) MarshalJSON ¶ added in v0.5.2
func (oc *BOCIConfig) MarshalJSON() ([]byte, error)
MarshalJSON passes through the marshalling to the underlying image if rawBody is not available.
func (*BOCIConfig) RawBody ¶ added in v0.5.2
func (oc *BOCIConfig) RawBody() ([]byte, error)
RawBody returns the original body from the request.
func (*BOCIConfig) SetConfig ¶ added in v0.5.2
func (oc *BOCIConfig) SetConfig(image v1.Image)
SetConfig updates the config, including raw body and descriptor.
func (*BOCIConfig) UnmarshalJSON ¶ added in v0.5.2
func (oc *BOCIConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON extracts json content and populates the content.
type BReader ¶ added in v0.5.2
type BReader struct { BCommon // contains filtered or unexported fields }
BReader is used to read blobs.
func (*BReader) Close ¶ added in v0.5.2
Close attempts to close the reader and populates/validates the digest.
func (*BReader) Read ¶ added in v0.5.2
Read passes through the read operation while computing the digest and tracking the size.
func (*BReader) Seek ¶ added in v0.5.2
Seek passes through the seek operation, reseting or invalidating the digest
func (*BReader) ToOCIConfig ¶ added in v0.5.2
func (r *BReader) ToOCIConfig() (*BOCIConfig, error)
ToOCIConfig converts a BReader to a BOCIConfig.
func (*BReader) ToTarReader ¶ added in v0.5.2
func (r *BReader) ToTarReader() (*BTarReader, error)
ToTarReader converts a BReader to a BTarReader
type BTarReader ¶ added in v0.5.2
type BTarReader struct { BCommon // contains filtered or unexported fields }
BTarReader is used to read individual files from an image layer.
func NewTarReader ¶ added in v0.4.5
func NewTarReader(opts ...Opts) *BTarReader
NewTarReader creates a BTarReader. Typically a BTarReader will be created using BReader.ToTarReader().
func (*BTarReader) Close ¶ added in v0.5.2
func (tr *BTarReader) Close() error
Close attempts to close the reader and populates/validates the digest.
func (*BTarReader) GetTarReader ¶ added in v0.5.2
func (tr *BTarReader) GetTarReader() (*tar.Reader, error)
GetTarReader returns the tar.Reader for the blob.
func (*BTarReader) RawBody ¶ added in v0.5.2
func (tr *BTarReader) RawBody() ([]byte, error)
RawBody returns the original body from the request.
type Blob ¶
type Blob interface { // GetDescriptor returns the descriptor associated with the blob. GetDescriptor() descriptor.Descriptor // RawBody returns the raw content of the blob. RawBody() ([]byte, error) // RawHeaders returns the headers received from the registry. RawHeaders() http.Header // Response returns the response associated with the blob. Response() *http.Response // Digest returns the provided or calculated digest of the blob. // // Deprecated: Digest should be replaced by GetDescriptor().Digest. Digest() digest.Digest // Length returns the provided or calculated length of the blob. // // Deprecated: Length should be replaced by GetDescriptor().Size. Length() int64 // MediaType returns the Content-Type header received from the registry. // // Deprecated: MediaType should be replaced by GetDescriptor().MediaType. MediaType() string }
Blob interface is used for returning blobs.
type Common ¶
type Common = *BCommon
Common was previously an interface. A type alias is provided for upgrades.
type OCIConfig ¶
type OCIConfig = *BOCIConfig
OCIConfig was previously an interface. A type alias is provided for upgrading.
type Opts ¶
type Opts func(*blobConfig)
Opts is used for options to create a new blob.
func WithDesc ¶
func WithDesc(d descriptor.Descriptor) Opts
WithDesc specifies the descriptor associated with the blob.
func WithHeader ¶
WithHeader defines the headers received when pulling a blob.
func WithRawBody ¶
WithRawBody defines the raw blob contents for OCIConfig.
type Reader ¶
type Reader = *BReader
Reader was previously an interface. A type alias is provided for upgrading.
type TarReader ¶ added in v0.4.5
type TarReader = *BTarReader
TarReader was previously an interface. A type alias is provided for upgrading.