missionpkg

package
v0.0.23 Latest Latest
Warning

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

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

Documentation

Overview

Package missionpkg defines the mission pack archive format: a zip containing world.yaml, index.json, optional logs.txt, and optional artifacts/<id> entries. Index fields are all optional. Consumers branch on presence or absence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	ID   string
	Data []byte
}

type Diagnostic

type Diagnostic struct {
	Timestamp   string   `json:"timestamp"`
	Hostname    string   `json:"hostname"`
	OS          string   `json:"os"`
	OSVersion   string   `json:"os_version,omitempty"`
	Arch        string   `json:"arch"`
	Version     string   `json:"version"`
	NodeID      string   `json:"node_id,omitempty"`
	EntityCount int      `json:"entity_count"`
	Args        []string `json:"args"`
	Uptime      string   `json:"uptime"`
	Goroutines  int      `json:"goroutines"`
	UserNote    string   `json:"user_note,omitempty"`
}

type Index

type Index struct {
	MissionKit *MissionKit     `json:"missionkit,omitempty"`
	ViewState  json.RawMessage `json:"view_state,omitempty"`
	Diagnostic *Diagnostic     `json:"diagnostic,omitempty"`
	Manifest   *Manifest       `json:"manifest,omitempty"`
}

type Manifest

type Manifest struct {
	EntityCount       int      `json:"entity_count"`
	EntityIDs         []string `json:"entity_ids,omitempty"`
	LayoutNames       []string `json:"layout_names,omitempty"`
	MissionKitPresent bool     `json:"mission_kit_present"`
	ViewStatePresent  bool     `json:"view_state_present"`
	HydrisVersion     string   `json:"hydris_version,omitempty"`
}

Manifest records what the packer packed. Receivers compare against observed state after apply to verify the import landed completely.

type MissionKit

type MissionKit struct {
	Layouts map[string]string `json:"layouts,omitempty"`
}

type Packer

type Packer struct {
	// contains filtered or unexported fields
}

Packer writes a mission pack: a zip containing world.yaml, index.json, an optional logs.txt, and optional artifacts/<id> entries. Write methods are best-effort and silent; the first error is held until Close returns it.

func NewPacker

func NewPacker(w io.Writer, modTime time.Time) *Packer

func (*Packer) Close

func (p *Packer) Close() error

func (*Packer) WriteArtifact

func (p *Packer) WriteArtifact(id string, body io.Reader)

func (*Packer) WriteIndex

func (p *Packer) WriteIndex(idx Index)

func (*Packer) WriteLogs

func (p *Packer) WriteLogs(src io.WriterTo)

func (*Packer) WriteWorld

func (p *Packer) WriteWorld(yaml []byte)

type Unpacked

type Unpacked struct {
	World     []byte
	Index     Index
	Logs      []byte
	Artifacts []Artifact
}

func Unpack

func Unpack(ctx context.Context, r io.ReaderAt, size int64) (Unpacked, error)

Jump to

Keyboard shortcuts

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