continuity

package module
v0.0.0-...-83fe70d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

README

continuity

A transport-agnostic, filesystem metadata manifest system

This project is a staging area for experiments in providing transport agnostic metadata storage.

Please see https://github.com/opencontainers/specs/issues/11 for more details.

Building Proto Package

If you change the proto file you will need to rebuild the generated Go with go generate.

go generate ./proto

Documentation

Index

Constants

View Source
const (
	XATTR_NOFOLLOW = iota << 1
	XATTR_CREATE
	XATTR_REPLACE
)

Variables

View Source
var (
	ErrNotFound = fmt.Errorf("not found")
)

Functions

func ApplyManifest

func ApplyManifest(root string, manifest *pb.Manifest) error

func BuildManifest

func BuildManifest(ctx Context) (*pb.Manifest, error)

BuildManifest creates the manifest for the given context

func Getxattr

func Getxattr(path, attr string) ([]byte, error)

func Listxattr

func Listxattr(path string) ([]string, error)

func Setxattr

func Setxattr(path, name string, data []byte) error

Types

type Context

type Context interface {
	Apply(Resource) error
	Verify(Resource) error
	Resource(string, os.FileInfo) (Resource, error)
	Sanitize(string) (string, error)
	Walk(filepath.WalkFunc) error
	Digest(string) (digest.Digest, error)
}

func NewContext

func NewContext(root string) (Context, error)

NewContext returns a Context associated with root.

type Device

type Device interface {
	Resource

	Major() uint64
	Minor() uint64
}

type Directory

type Directory interface {
	Resource
	XAttrer

	// Directory is a no-op method to identify directory objects by interface.
	Directory()
}

type NamedPipe

type NamedPipe interface {
	Resource

	// Pipe is a no-op method to allow consistent resolution of NamedPipe
	// interface.
	Pipe()
}

type RegularFile

type RegularFile interface {
	Resource
	XAttrer

	// Paths returns all paths of the regular file, including the primary path
	// returned by Resource.Path. If len(Paths()) > 1, the resource is a hard
	// link.
	Paths() []string

	Size() int64
	Digests() []digest.Digest
}

func Merge

func Merge(fs ...RegularFile) (RegularFile, error)

Merge two or more RegularFile fs into new file. Typically, this should be used to merge regular files as hardlinks. If the files are not identical, other than Paths and Digests, the merge will fail and an error will be returned.

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() string
	GID() string
}
type SymLink interface {
	Resource

	// Target returns the target of the symlink contained in the .
	Target() string
}

type XAttrer

type XAttrer interface {
	XAttrs() map[string][]byte
}

Directories

Path Synopsis
cmd
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL