Help us shape the future of Go! Take the 2026 Go Developer Survey

nself

package
v1.4.15 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package nself registers the portable-bundle importer: the re-import half of `nself db export`. Purpose: validate a v1 bundle and stage it unchanged so the shared loader and verifier run on it. Inputs: the bundle directory (Values["dir"]). Outputs: a staged byte-identical bundle. Constraints: the bundle is never modified; errors carry the portable reader's text (member paths and manifest values), which the shared run filters before it reaches the user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct{}

Source imports a directory written by `nself db export` (or kept by --keep-stage).

func (Source) Detect

Detect reads the manifest, checks the Postgres major against the target and reports the bundle's schemas and user count so --plan runs the same target preflights as the real run.

func (Source) Extract

func (Source) Extract(ctx context.Context, in importer.Input, stage string) (importer.Extracted, error)

Extract copies the verified bundle into stage byte for byte. A hard link would be refused by the reader (members must be singly linked), so every member is copied through a checking reader. The staged copy is opened again and its manifest must equal the one verified from the source, so a bundle that changes while it is staged is refused (E516) rather than loaded.

func (Source) Flags

func (Source) Flags() []importer.FlagSpec

Flags declares the bundle directory. The command takes it as its one positional argument and stores it under this name (cmd/commands/db_import_src_nself.go).

func (Source) Name

func (Source) Name() string

Jump to

Keyboard shortcuts

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