installer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package installer performs end-to-end installs: resolve, fetch, restore objects (RSTLIB/RSTOBJ) or recompile, apply DB migrations in order, validate signatures against the lock, and wire *BNDDIR and the runtime library list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrationsDir

func MigrationsDir(cacheDir, name, version string) string

MigrationsDir returns the cache directory holding a package's fetched migrations.

Types

type DeployOptions

type DeployOptions struct {
	CacheDir        string // where Install wrote artifacts
	LibraryOverride string // force a single target library (e.g. on pub400)
	WireLibList     bool   // ADDLIBLE each deployed library
	Logf            func(string, ...any)
}

DeployOptions configures deployment of cached artifacts onto an IBM i host.

type Deployed

type Deployed struct {
	Name      string
	Version   string
	Library   string
	Srvpgm    string
	Signature string
}

Deployed records one package restored to the host.

func Deploy

func Deploy(h Host, lock *manifest.Lock, opts DeployOptions) ([]Deployed, error)

Deploy restores each locked artifact onto the host, verifies its service program signature against the lock, and optionally wires the library list.

type Fetched

type Fetched struct {
	Name    string
	Version string
	Path    string
	Bytes   int
}

Fetched records one artifact written to the cache.

type HashMismatchError

type HashMismatchError struct {
	Package, Version, Want, Got string
}

HashMismatchError is returned when a fetched artifact's digest does not match the lock. Installs abort rather than deploy a tampered or corrupt artifact.

func (*HashMismatchError) Error

func (e *HashMismatchError) Error() string

type Host

type Host interface {
	builder.Host
}

Host is the slice of the SSH transport the deployer needs.

type Options

type Options struct {
	ManifestPath string // path to bindle.json
	CacheDir     string // where artifacts are written
	Update       bool   // force re-resolve and rewrite the lock
}

Options configures a local install.

type Registry

type Registry interface {
	Versions(name string) ([]resolver.Available, error)
	Fetch(artifact string) ([]byte, error)
}

Registry is what the installer needs from a registry backend: list versions (for resolution) and fetch artifact bytes.

type Result

type Result struct {
	LockPath    string
	LockWritten bool      // true if the lock was (re)generated this run
	Fetched     []Fetched // artifacts written to the cache
	Skipped     []string  // resolved packages that have no artifact to fetch
}

Result summarizes a local install.

func Install

func Install(reg Registry, opts Options) (*Result, error)

Install performs the local half of an install: resolve (or reuse the lock), write bindle.lock, then fetch and verify each artifact into the cache.

It does NOT yet deploy to an IBM i host (RSTLIB + migrations); that step will consume the verified artifacts produced here.

type SignatureMismatchError

type SignatureMismatchError struct {
	Package, Want, Got string
}

SignatureMismatchError is returned when a restored service program's signature does not match the lock. Deployment aborts rather than wire a broken binding.

func (*SignatureMismatchError) Error

func (e *SignatureMismatchError) Error() string

Jump to

Keyboard shortcuts

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