Documentation ¶
Index ¶
- Variables
- func ApplyManifest(ctx Context, manifest *Manifest) error
- func AtomicWriteFile(filename string, data []byte, perm os.FileMode) error
- func Marshal(m *Manifest) ([]byte, error)
- func MarshalText(w io.Writer, m *Manifest) error
- func VerifyManifest(ctx Context, manifest *Manifest) error
- type ByPath
- type ContentProvider
- type Context
- type ContextOptions
- type Device
- type Digester
- type Directory
- type Hardlinkable
- type Manifest
- type NamedPipe
- type RegularFile
- type Resource
- type SymLink
- type SymlinkPath
- type XAttrer
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound represents the resource not found ErrNotFound = fmt.Errorf("not found") // ErrNotSupported represents the resource not supported ErrNotSupported = fmt.Errorf("not supported") )
Functions ¶
func ApplyManifest ¶
ApplyManifest applies on the resources in a manifest to the given context.
func AtomicWriteFile ¶
AtomicWriteFile atomically writes data to a file by first writing to a temp file and calling rename.
func VerifyManifest ¶
VerifyManifest verifies all the resources in a manifest against files from the given context.
Types ¶
type ByPath ¶
type ByPath []Resource
ByPath provides the canonical sort order for a set of resources. Use with sort.Stable for deterministic sorting.
type ContentProvider ¶
type ContentProvider interface {
Reader(digest.Digest) (io.ReadCloser, error)
}
ContentProvider produces a read stream for a given digest
type Context ¶
type Context interface { Apply(Resource) error Verify(Resource) error Resource(string, os.FileInfo) (Resource, error) Walk(filepath.WalkFunc) error }
Context represents a file system context for accessing resources. The responsibility of the context is to convert system specific resources to generic Resource objects. Most of this is safe path manipulation, as well as extraction of resource details.
func NewContext ¶
NewContext returns a Context associated with root. The default driver will be used, as returned by NewDriver.
func NewContextWithOptions ¶
func NewContextWithOptions(root string, options ContextOptions) (Context, error)
NewContextWithOptions returns a Context associate with the root.
type ContextOptions ¶
type ContextOptions struct { Digester Digester Driver driverpkg.Driver PathDriver pathdriver.PathDriver Provider ContentProvider }
ContextOptions represents options to create a new context.
type Hardlinkable ¶
type Hardlinkable interface { // Paths returns all paths of the resource, including the primary path // returned by Resource.Path. If len(Paths()) > 1, the resource is a hard // link. Paths() []string }
Hardlinkable is an interface that a resource type satisfies if it can be a hardlink target.
type Manifest ¶
type Manifest struct { // Resources specifies all the resources for a manifest in order by path. Resources []Resource }
Manifest provides the contents of a manifest. Users of this struct should not typically modify any fields directly.
func BuildManifest ¶
BuildManifest creates the manifest for the given context
type NamedPipe ¶
type NamedPipe interface { Resource Hardlinkable XAttrer // Pipe is a no-op method to allow consistent resolution of NamedPipe // interface. Pipe() }
type RegularFile ¶
type RegularFile interface { Resource XAttrer Hardlinkable Size() int64 Digests() []digest.Digest }
type Resource ¶
type Resource interface { // Path provides the primary resource path relative to the bundle root. In // cases where resources have more than one path, such as with hard links, // this will return the primary path, which is often just the first entry. Path() string // Mode returns the Mode() os.FileMode UID() int64 GID() int64 }
type SymlinkPath ¶
SymlinkPath is intended to give the symlink target value in a root context. Target and linkname are absolute paths not under the given root.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package proto is a generated protocol buffer package.
|
Package proto is a generated protocol buffer package. |