Documentation
¶
Overview ¶
Package pad provides error constructors for encrypted scratchpad operations.
Index ¶
- func BlobAppendNotAllowed() error
- func BlobPrependNotAllowed() error
- func EditBlobTextConflict() error
- func EditNoMode() error
- func EditTextConflict() error
- func EntryRange(n, total int) error
- func FileTooLarge(size, max int) error
- func InvalidIndex(value string) error
- func NoConflictFiles(filename string) error
- func NotBlobEntry(n int) error
- func OutFlagRequiresBlob() error
- func ReadScratchpad(cause error) error
- func ResolveNotEncrypted() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BlobAppendNotAllowed ¶
func BlobAppendNotAllowed() error
BlobAppendNotAllowed returns an error for appending to a blob entry.
Returns:
- error: "cannot append to a blob entry"
func BlobPrependNotAllowed ¶
func BlobPrependNotAllowed() error
BlobPrependNotAllowed returns an error for prepending to a blob entry.
Returns:
- error: "cannot prepend to a blob entry"
func EditBlobTextConflict ¶
func EditBlobTextConflict() error
EditBlobTextConflict returns an error when --file/--label and text editing flags are used together.
Returns:
- error: describing the mutual exclusivity
func EditNoMode ¶
func EditNoMode() error
EditNoMode returns an error when no editing mode was specified.
Returns:
- error: prompting for a mode
func EditTextConflict ¶
func EditTextConflict() error
EditTextConflict returns an error when multiple text editing modes are used together.
Returns:
- error: describing the mutual exclusivity
func EntryRange ¶
EntryRange returns an error for an out-of-range scratchpad entry.
Parameters:
- n: the requested entry number.
- total: the total number of entries.
Returns:
- error: "entry <n> does not exist, scratchpad has <total> entries"
func FileTooLarge ¶
FileTooLarge returns an error for a file exceeding the size limit.
Parameters:
- size: actual file size in bytes.
- max: maximum allowed size in bytes.
Returns:
- error: "file too large: <size> bytes (max <max>)"
func InvalidIndex ¶
InvalidIndex returns an error for a non-numeric entry index.
Parameters:
- value: the invalid index string.
Returns:
- error: "invalid index: <value>"
func NoConflictFiles ¶
NoConflictFiles returns an error when no merge conflict files are found.
Parameters:
- filename: the base scratchpad filename.
Returns:
- error: "no conflict files found (<filename>.ours / <filename>.theirs)"
func NotBlobEntry ¶
NotBlobEntry returns an error when a blob operation targets a non-blob.
Parameters:
- n: the 1-based entry index.
Returns:
- error: "entry <n> is not a blob entry"
func OutFlagRequiresBlob ¶
func OutFlagRequiresBlob() error
OutFlagRequiresBlob returns an error when --out is used on a non-blob entry.
Returns:
- error: "--out can only be used with blob entries"
func ReadScratchpad ¶
ReadScratchpad wraps a scratchpad read failure.
Parameters:
- cause: the underlying read error.
Returns:
- error: "read scratchpad: <cause>"
func ResolveNotEncrypted ¶
func ResolveNotEncrypted() error
ResolveNotEncrypted returns an error when resolve is used on an unencrypted scratchpad.
Returns:
- error: "resolve is only needed for encrypted scratchpads"
Types ¶
This section is empty.