pad

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package pad provides error constructors for encrypted scratchpad operations.

Index

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

func EntryRange(n, total int) error

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

func FileTooLarge(size, max int) error

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

func InvalidIndex(value string) error

InvalidIndex returns an error for a non-numeric entry index.

Parameters:

  • value: the invalid index string.

Returns:

  • error: "invalid index: <value>"

func NoConflictFiles

func NoConflictFiles(filename string) error

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

func NotBlobEntry(n int) error

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

func ReadScratchpad(cause error) error

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.

Jump to

Keyboard shortcuts

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