vaultcopy

package
v1.4.2 Latest Latest
Warning

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

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

Documentation

Overview

Package vaultcopy implements a backend-agnostic copy of a vault's contents (teams, bots, assets and their versions, installation scopes, audit history, and usage history) from one vault into another. It is the engine behind `sx vault copy`.

Everything is read through the vault.Vault interface (plus a couple of optional capability interfaces), so any source/destination combination of path, git, and skills.new vaults works. The copy is best-effort at the item level: a failure copying one team/asset/etc. is recorded as a warning and the copy continues, so a single bad item never aborts a whole migration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Teams  bool
	Bots   bool
	Assets bool
	Audit  bool
	Usage  bool
	DryRun bool
}

Options selects which categories to copy and whether to run read-only.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions copies everything.

type Report

type Report struct {
	Teams           int
	Bots            int
	Assets          int
	Versions        int
	SkippedVersions int
	Scopes          int
	AuditEvents     int
	UsageEvents     int
	Warnings        []string
}

Report summarizes what a copy did (or would do, for a dry run).

func Copy

func Copy(ctx context.Context, src, dst vault.Vault, opts Options) (*Report, error)

Copy migrates the selected categories from src into dst. Each category is independent: a category-level failure is recorded as a warning and the copy moves on to the next, so one broken category (e.g. audit) never costs the others (e.g. usage). Always returns a Report for partial-progress reporting.

Jump to

Keyboard shortcuts

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