companion

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package companion loads small, local terminal companion manifests.

Index

Constants

View Source
const (
	// BuiltinID identifies Codog's bundled terminal companion.
	BuiltinID = "codog"
	// DisabledID is the persisted value used to disable terminal companions.
	DisabledID = "off"
)

Variables

View Source
var (
	// ErrInvalidID reports an unsafe or unsupported companion identifier.
	ErrInvalidID = errors.New("invalid companion id")
	// ErrInvalidManifest reports a malformed or unsafe companion manifest.
	ErrInvalidManifest = errors.New("invalid companion manifest")
)

Functions

func WriteExample

func WriteExample(w io.Writer) error

WriteExample writes a documented custom companion manifest to w.

Types

type CatalogEntry

type CatalogEntry struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Builtin bool   `json:"builtin"`
}

CatalogEntry is the public summary used by companion pickers and reports.

func List

func List(configHome string) []CatalogEntry

List returns the built-in companion and all valid local manifests.

type Frames

type Frames struct {
	Ready   []string `json:"ready"`
	Running []string `json:"running,omitempty"`
	Waiting []string `json:"waiting,omitempty"`
	Failed  []string `json:"failed,omitempty"`
}

Frames contains the companion artwork for each runtime state. Missing state frames fall back to Ready.

type Manifest

type Manifest struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Frames Frames `json:"frames"`
}

Manifest describes one terminal companion.

func Load

func Load(configHome string, id string) (*Manifest, error)

Load resolves a built-in or local custom companion. Empty and "off" values return nil without error.

func (Manifest) Frame

func (m Manifest) Frame(state string) []string

Frame returns artwork for a normalized runtime state.

Jump to

Keyboard shortcuts

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