Documentation
¶
Overview ¶
Package types contains the public data contracts used by ACFS and its command-line protocol.
Index ¶
- Constants
- type ApplyChange
- type ApplyError
- type ApplyManifest
- type ApplyOperation
- type ApplyResponse
- type CopyOptions
- type CopyResult
- type Entry
- type ErrorCode
- type ErrorResponse
- type ListOptions
- type ListResponse
- type ListResult
- type MirrorOptions
- type StatOptions
- type StatResponse
- type VersionResponse
- type WalkOptions
- type WalkRecord
- type WalkResult
Constants ¶
const ( ErrorInvalidPath ErrorCode = "invalid_path" ErrorOutsideRoot ErrorCode = "outside_root" ErrorSymlink ErrorCode = "symlink" ErrorSymlinkLoop ErrorCode = "symlink_loop" ErrorNotFound ErrorCode = "not_found" ErrorAlreadyExist ErrorCode = "already_exists" ErrorNotDirectory ErrorCode = "not_directory" ErrorNotFile ErrorCode = "not_file" ErrorNotEmpty ErrorCode = "not_empty" ErrorIsDirectory ErrorCode = "is_directory" ErrorSizeMismatch ErrorCode = "size_mismatch" ErrorRootRemoval ErrorCode = "root_removal" ErrorInternal ErrorCode = "internal" ApplyCreateFile ApplyOperation = "create_file" ApplyUpdateFile ApplyOperation = "update_file" ApplyCreateFolder ApplyOperation = "create_folder" ApplyRename ApplyOperation = "rename" ApplyMove ApplyOperation = "move" ApplyDelete ApplyOperation = "delete" )
const (
// ProtocolVersion is the current acfs wire protocol version.
ProtocolVersion = 2
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyChange ¶
type ApplyChange struct {
Operation ApplyOperation `json:"operation"`
Path string `json:"path"`
TargetPath string `json:"targetPath,omitempty"`
StagedName string `json:"stagedName,omitempty"`
Size int64 `json:"size,omitempty"`
Recursive bool `json:"recursive,omitempty"`
}
ApplyChange describes one ordered root-confined filesystem mutation.
type ApplyError ¶
type ApplyError struct {
Err error
Operation ApplyOperation
Path string
Index int
}
ApplyError identifies the manifest change that failed.
func (*ApplyError) Error ¶
func (e *ApplyError) Error() string
func (*ApplyError) Unwrap ¶
func (e *ApplyError) Unwrap() error
type ApplyManifest ¶
type ApplyManifest struct {
Changes []ApplyChange `json:"changes"`
Version int `json:"version"`
}
ApplyManifest is the versioned input consumed by acfs apply.
type ApplyOperation ¶
type ApplyOperation string
ApplyOperation identifies one ordered filesystem mutation.
type ApplyResponse ¶
ApplyResponse confirms that every mutation in a manifest was applied.
type CopyOptions ¶
type CopyOptions struct {
// TolerateUnreadable skips files and whole subdirectories that cannot be
// read because of a permission error, or that vanished mid-walk, instead
// of aborting the copy. Every other error still aborts.
TolerateUnreadable bool
}
CopyOptions configures a directory copy.
type CopyResult ¶
type CopyResult struct {
// Skipped lists the source-relative paths that were not copied, sorted.
// It always includes sockets, FIFOs, and device nodes, which have no
// copyable content, and additionally includes unreadable entries when
// CopyOptions.TolerateUnreadable is set.
Skipped []string
// Copied counts the regular files written to the destination.
Copied int
}
CopyResult summarizes a completed directory copy.
type Entry ¶
type Entry struct {
ModTime time.Time `json:"modTime"`
Name string `json:"name"`
Path string `json:"path"`
Mode string `json:"mode"`
LinkTarget string `json:"linkTarget,omitempty"`
ModTimeUnixNano int64 `json:"modTimeUnixNano"`
Size int64 `json:"size"`
// Device and Inode identify the file like os.SameFile; zero where the
// platform has no Stat_t.
Device uint64 `json:"device"`
Inode uint64 `json:"inode"`
// UID and GID are the numeric owner; zero where the platform has no
// Stat_t. They are never omitted, since 0 is root.
UID int `json:"uid"`
GID int `json:"gid"`
// UnixMode carries the raw os.FileMode bits of the entry, so callers can
// compare or reapply them. Mode is a human-readable rendering meant for
// display only.
UnixMode uint32 `json:"unixMode"`
IsDirectory bool `json:"isDirectory"`
IsSymlink bool `json:"isSymlink"`
}
Entry describes a filesystem entry relative to a workspace root.
type ErrorCode ¶
type ErrorCode string
ErrorCode is a stable machine-readable ACFS failure category.
type ErrorResponse ¶
type ErrorResponse struct {
ChangeIndex *int `json:"changeIndex,omitempty"`
Code ErrorCode `json:"code"`
Message string `json:"message"`
Operation string `json:"operation,omitempty"`
Path string `json:"path,omitempty"`
Version int `json:"version"`
}
ErrorResponse is emitted as one JSON line on stderr when a command fails.
type ListOptions ¶ added in v0.10.2
type ListOptions struct {
MaxEntries int
}
ListOptions bounds a directory listing. Zero values are unlimited.
type ListResponse ¶
type ListResponse struct {
Entries []Entry `json:"entries"`
Truncated bool `json:"truncated,omitempty"`
Version int `json:"version"`
}
ListResponse is the versioned response emitted by the list command.
type ListResult ¶ added in v0.10.2
ListResult summarizes a bounded directory listing. Truncated reports that the directory held more than MaxEntries visible names.
type MirrorOptions ¶
type MirrorOptions struct {
// Preserve lists destination-relative paths that must survive the mirror
// even though the source omits them, along with any parent directory that
// still contains one. It is how a restore keeps files the backup could not
// read.
Preserve []string
}
MirrorOptions configures a directory mirror.
type StatOptions ¶
type StatOptions struct {
// FollowFinal resolves a final symbolic link; the returned Entry.Path is
// then the fully resolved logical path, so Stat doubles as a root-confined
// symlink resolver.
FollowFinal bool
}
StatOptions configures Root.Stat. The zero value describes a final symbolic link itself rather than its target.
type StatResponse ¶
StatResponse is the versioned response emitted by the stat command.
type VersionResponse ¶
type VersionResponse struct {
Version string `json:"version"`
Revision string `json:"revision"`
BuildTime string `json:"buildTime"`
Protocol int `json:"protocol"`
}
VersionResponse describes an acfs build and its supported protocol.
type WalkOptions ¶
WalkOptions bounds a recursive traversal. Zero values are unlimited.
type WalkRecord ¶
type WalkRecord struct {
Entry *Entry `json:"entry,omitempty"`
End bool `json:"end,omitempty"`
Truncated bool `json:"truncated,omitempty"`
Count int `json:"count,omitempty"`
Version int `json:"version"`
}
WalkRecord is one versioned record emitted by the walk command.
type WalkResult ¶
WalkResult summarizes a bounded recursive traversal.