bundle

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package bundle implements PawnKit server bundles.

Index

Constants

View Source
const ManifestName = "pawn-bundle.json"

ManifestName is the bundle manifest filename.

Variables

This section is empty.

Functions

func Extract

func Extract(archive, destination string) error

Extract unpacks a bundle into destination.

func Install

func Install(archive, destination, platform string) error

Install verifies and atomically replaces an installation.

func Pack

func Pack(root, destination string) error

Pack creates a deterministic bundle archive from root.

func Rollback

func Rollback(destination string) error

Rollback restores the previous installation.

func WriteManifest

func WriteManifest(path string, manifest Manifest) error

WriteManifest writes a formatted manifest with its checksum.

Types

type Artifact

type Artifact struct {
	Name     string `json:"name,omitempty"`
	Path     string `json:"path"`
	Checksum string `json:"checksum"`
	Platform string `json:"platform"`
}

Artifact is a checksum-verified platform file.

type Config

type Config struct {
	Path   string `json:"path"`
	Schema string `json:"schema,omitempty"`
}

Config identifies the server configuration file.

type EntryPoints

type EntryPoints struct {
	Gamemode      string   `json:"gamemode"`
	Filterscripts []string `json:"filterscripts,omitempty"`
}

EntryPoints lists the scripts loaded by the server.

type Health

type Health struct {
	CheckCommand string  `json:"checkCommand,omitempty"`
	CheckPort    int     `json:"checkPort,omitempty"`
	Timeout      float64 `json:"timeout,omitempty"`
}

Health describes an optional runtime health check.

type InstallPlan

type InstallPlan struct {
	Destination string `json:"destination"`
	Name        string `json:"name"`
	Version     string `json:"version"`
	Replaces    bool   `json:"replaces"`
}

func PlanInstall

func PlanInstall(archive, destination, platform string) (InstallPlan, error)

PlanInstall verifies an archive and describes its destination.

type Manifest

type Manifest struct {
	SchemaVersion  int          `json:"schemaVersion"`
	Name           string       `json:"name"`
	Version        string       `json:"version"`
	RuntimeProfile string       `json:"runtimeProfile"`
	Server         Server       `json:"server"`
	EntryPoints    EntryPoints  `json:"entryPoints"`
	Plugins        []Artifact   `json:"plugins,omitempty"`
	Components     []Artifact   `json:"components,omitempty"`
	Configuration  *Config      `json:"configuration,omitempty"`
	Services       []Service    `json:"services,omitempty"`
	Migrations     []Migration  `json:"migrations,omitempty"`
	Persistence    *Persistence `json:"persistence,omitempty"`
	Health         *Health      `json:"health,omitempty"`
	Checksum       string       `json:"checksum"`
}

Manifest describes a reproducible server bundle.

func Load

func Load(data []byte) (Manifest, error)

Load decodes and validates a manifest.

func Verify

func Verify(path, platform string) (Manifest, error)

Verify checks a bundle directory or archive.

func VerifyDirectory

func VerifyDirectory(root, platform string) (Manifest, error)

VerifyDirectory checks a bundle directory for the selected platform.

func (Manifest) CanonicalChecksum

func (m Manifest) CanonicalChecksum() (string, error)

CanonicalChecksum returns the checksum with Checksum cleared.

func (Manifest) Validate

func (m Manifest) Validate() error

Validate checks manifest identity, checksums, and paths.

type Migration

type Migration struct {
	ID               string `json:"id"`
	Description      string `json:"description"`
	AppliesToVersion string `json:"appliesToVersion,omitempty"`
}

Migration describes a persistence migration supplied by an operator.

type Persistence

type Persistence struct {
	Paths []string `json:"paths,omitempty"`
}

Persistence lists paths kept outside bundle replacement.

type Server

type Server struct {
	Version string     `json:"version"`
	Binary  []Artifact `json:"binary"`
}

Server identifies the runtime and its platform binaries.

type Service

type Service struct {
	Name     string `json:"name"`
	Kind     string `json:"kind"`
	Required bool   `json:"required"`
}

Service is an external dependency declared by a bundle.

Jump to

Keyboard shortcuts

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