merge

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: 6 Imported by: 0

Documentation

Overview

Package merge reads scratchpad files with automatic decryption fallback and merges entries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBlobLabelMap

func BuildBlobLabelMap(entries []string) map[string]string

BuildBlobLabelMap creates a map of blob labels to their full entry strings.

Parameters:

  • entries: scratchpad entries to scan.

Returns:

  • map[string]string: blob label to full entry string.

func HasBinaryEntries

func HasBinaryEntries(entries []string) bool

HasBinaryEntries checks if any entries contain non-UTF-8 bytes.

Parameters:

  • entries: the parsed entries to check.

Returns:

  • bool: true if any entry contains non-UTF-8 data.

func HasBlobConflict

func HasBlobConflict(entry string, blobLabels map[string]string) (bool, string)

HasBlobConflict checks if a blob entry has the same label as an existing blob but different content. Updates the label map with the new entry.

Parameters:

  • entry: the new entry to check.
  • blobLabels: map of existing blob labels to their full entry strings.

Returns:

  • bool: true if a conflict was detected.
  • string: the conflicting label (empty if no conflict).

func LoadMergeKey

func LoadMergeKey(keyFile string) []byte

LoadMergeKey loads the encryption key for merge input decryption.

Parameters:

  • keyFile: explicit key file path (empty string = use project key).

Returns:

  • []byte: the loaded key, or nil if no key is available.

func ReadFileEntries

func ReadFileEntries(path string, key []byte) ([]string, error)

ReadFileEntries reads a scratchpad file, attempting decryption first.

Parameters:

  • path: path to the scratchpad file.
  • key: encryption key (nil to skip the decryption attempt).

Returns:

  • []string: parsed entries.
  • error: non-nil if the file cannot be read.

Types

This section is empty.

Jump to

Keyboard shortcuts

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