Documentation ¶
Index ¶
- Constants
- func AlignToBlockSize(value int64, blockSize int64) (aligned int64)
- func CopyBlob(ctx context.Context, resolver remotes.Resolver, ref string, ...) error
- func CopyLocalBlob(ctx context.Context, path string, ref string, desc ocispec.Descriptor, ...) error
- func GetDockerClient(dockerHost string) (*dockerclient.Client, error)
- func NewRegistryAuthorizer(cfg *configfile.ConfigFile) docker.Authorizer
- func NewResolver(authorizer docker.Authorizer, connectTimeout int) remotes.Resolver
- func NewSecureReadCloser(srcReadCloser io.ReadCloser, opts ...SecureReadOptions) (io.ReadCloser, error)
- func ParseImageRootAsManifest(root *ImageRoot) (*ocispec.Descriptor, []*ocispec.Descriptor, error)
- func ReadBlob(ctx context.Context, provider BlobProvider, ref string, digest digest.Digest, ...) ([]byte, error)
- func ReadBlobWithReadLimit(ctx context.Context, provider BlobProvider, ref string, limit int64) ([]byte, error)
- func ReadBlobWithResolving(ctx context.Context, provider BlobProvider, ref string, size int64) ([]byte, error)
- func ReadImageManifest(ctx context.Context, provider BlobProvider, ref string, size int64) (*ocispec.Manifest, error)
- func ReadImageRoot(ctx context.Context, provider BlobProvider, ref string) (*ImageRef, *ImageRoot, *ocispec.Descriptor, error)
- func WithBlobType(ctx context.Context, blobType BlobType) context.Context
- func WithExpectedDigest(digest digest.Digest) func(opts *SecureReadParams)
- func WithExpectedSize(size int64) func(opts *SecureReadParams)
- func WithReadLimit(limit int64) func(opts *SecureReadParams)
- func WithRef(ref string) func(opts *SecureReadParams)
- type App
- type AppBundleErrs
- type AppLoader
- type AppRef
- type AppStore
- type AppTree
- type BlobInfo
- type BlobProvider
- type BlobState
- type BlobType
- type BlobsStatus
- type ErrBlobDigestMismatch
- type ErrBlobSizeLimitExceed
- type ErrBlobSizeMismatch
- type ImageRef
- type ImageRoot
- type ImageTree
- type NodeProcessor
- type SecureReadOptions
- type SecureReadParams
- type StatFS
- type TreeNode
- type UsageInfo
Constants ¶
View Source
const ( BlobStateUndefined BlobState = iota BlobOk BlobMissing BlobSizeInvalid BlobDigestInvalid BlobTypeUnknown BlobType = "unknown blob type" BlobTypeAppManifest BlobType = "app manifest" BlobTypeAppBundle BlobType = "app bundle" BlobTypeAppIndex BlobType = "app index" BlobTypeAppLayersMeta BlobType = "app meta" BlobTypeImageIndex BlobType = "index" BlobTypeSkopeoImageIndex BlobType = "skopeo index" BlobTypeImageManifest BlobType = "manifest" BlobTypeImageConfig BlobType = "config" BlobTypeImageLayer BlobType = "layer" )
View Source
const (
ImageRootMaxSize = 100 * 1024
)
View Source
const (
MaxMerkleTreeDepth = 10
)
Variables ¶
This section is empty.
Functions ¶
func AlignToBlockSize ¶
func CopyLocalBlob ¶
func GetDockerClient ¶
func GetDockerClient(dockerHost string) (*dockerclient.Client, error)
func NewRegistryAuthorizer ¶
func NewRegistryAuthorizer(cfg *configfile.ConfigFile) docker.Authorizer
func NewResolver ¶
func NewResolver(authorizer docker.Authorizer, connectTimeout int) remotes.Resolver
func NewSecureReadCloser ¶
func NewSecureReadCloser(srcReadCloser io.ReadCloser, opts ...SecureReadOptions) (io.ReadCloser, error)
func ParseImageRootAsManifest ¶
func ParseImageRootAsManifest(root *ImageRoot) (*ocispec.Descriptor, []*ocispec.Descriptor, error)
func ReadBlobWithReadLimit ¶
func ReadBlobWithResolving ¶
func ReadImageManifest ¶
func ReadImageRoot ¶
func ReadImageRoot(ctx context.Context, provider BlobProvider, ref string) (*ImageRef, *ImageRoot, *ocispec.Descriptor, error)
func WithExpectedDigest ¶
func WithExpectedDigest(digest digest.Digest) func(opts *SecureReadParams)
func WithExpectedSize ¶
func WithExpectedSize(size int64) func(opts *SecureReadParams)
func WithReadLimit ¶
func WithReadLimit(limit int64) func(opts *SecureReadParams)
func WithRef ¶
func WithRef(ref string) func(opts *SecureReadParams)
Types ¶
type App ¶
type App interface { Name() string Ref() *AppRef HasLayersMeta(arch string) bool GetBlobRuntimeSize(desc *ocispec.Descriptor, arch string, blockSize int64) int64 GetComposeRoot() *TreeNode GetCompose(ctx context.Context, provider BlobProvider) (*composetypes.Project, error) CheckComposeInstallation(ctx context.Context, provider BlobProvider, installationRootDir string) (AppBundleErrs, error) }
type AppBundleErrs ¶
type AppLoader ¶
type AppLoader interface {
LoadAppTree(context.Context, BlobProvider, platforms.MatchComparer, string) (App, *AppTree, error)
}
type AppTree ¶
type AppTree TreeNode
func (*AppTree) Walk ¶
func (t *AppTree) Walk(fn NodeProcessor) error
type BlobProvider ¶
type BlobProvider interface { content.InfoProvider GetReadCloser(ctx context.Context, opts ...SecureReadOptions) (io.ReadCloser, error) }
func NewLocalBlobProvider ¶
func NewLocalBlobProvider(fileProvider content.Store) BlobProvider
func NewMemoryBlobProvider ¶
func NewMemoryBlobProvider(blobs map[digest.Digest][]byte) BlobProvider
func NewRemoteBlobProvider ¶
func NewRemoteBlobProvider(resolver remotes.Resolver) BlobProvider
func NewStoreBlobProvider ¶
func NewStoreBlobProvider(blobRoot string) BlobProvider
type BlobState ¶
type BlobState int
func CheckBlob ¶
func CheckBlob(ctx context.Context, provider BlobProvider, dgst digest.Digest, opts ...SecureReadOptions) (BlobState, error)
func ErrToBlobState ¶
type BlobsStatus ¶
type BlobsStatus map[digest.Digest]BlobInfo
type ErrBlobDigestMismatch ¶
type ErrBlobDigestMismatch struct { Expected digest.Digest Calculated digest.Digest }
func (*ErrBlobDigestMismatch) Error ¶
func (e *ErrBlobDigestMismatch) Error() string
type ErrBlobSizeLimitExceed ¶
type ErrBlobSizeLimitExceed struct {
Limit int64
}
func (*ErrBlobSizeLimitExceed) Error ¶
func (e *ErrBlobSizeLimitExceed) Error() string
type ErrBlobSizeMismatch ¶
func (*ErrBlobSizeMismatch) Error ¶
func (e *ErrBlobSizeMismatch) Error() string
type ImageRoot ¶
type ImageRoot struct { specs.Versioned MediaType string `json:"mediaType,omitempty"` Config json.RawMessage `json:"config,omitempty"` Layers json.RawMessage `json:"layers,omitempty"` Manifests json.RawMessage `json:"manifests,omitempty"` FSLayers json.RawMessage `json:"fsLayers,omitempty"` // schema 1 Type BlobType Children []TreeNode }
type NodeProcessor ¶
type SecureReadOptions ¶
type SecureReadOptions func(opts *SecureReadParams)
type SecureReadParams ¶
type SecureReadParams struct { Ref string ExpectedDigest digest.Digest ExpectedSize int64 ReadLimit int64 }
func GetSecureReadParams ¶
func GetSecureReadParams(opts ...SecureReadOptions) (p SecureReadParams)
type TreeNode ¶
type TreeNode struct { Descriptor *ocispec.Descriptor Type BlobType Children []*TreeNode }
func LoadImageTree ¶
func LoadImageTree(ctx context.Context, provider BlobProvider, platform platforms.MatchComparer, ref string) (*TreeNode, error)
func (*TreeNode) GetImageConfigAndLayers ¶
func (t *TreeNode) GetImageConfigAndLayers() (*ocispec.Descriptor, []*ocispec.Descriptor, error)
func (TreeNode) Walk ¶
func (t TreeNode) Walk(fn NodeProcessor) error
type UsageInfo ¶
type UsageInfo struct { Path string `json:"path"` SizeB uint64 `json:"size_b"` Free uint64 `json:"free"` FreeP float32 `json:"free_p"` Reserved uint64 `json:"reserved"` ReservedP float32 `json:"reserved_p"` Available uint64 `json:"available"` AvailableP float32 `json:"available_p"` Required uint64 `json:"required"` RequiredP float32 `json:"required_p"` }
func GetUsageInfo ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.