config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPath

func DefaultPath() string

Types

type Config

type Config struct {
	Mark    *MarkSpec             `yaml:"mark,omitempty"`
	Layout  layout.Node           `yaml:"layout"`
	Modules map[string]ModuleSpec `yaml:"modules"`
	// contains filtered or unexported fields
}

func Default added in v0.1.1

func Default() *Config

Default returns a built-in config used when no config file is present. It bundles a small set of safe builtins and a randomly-chosen animal mark inlined as text, so it works even with no marks on disk.

func Load

func Load(path string) (*Config, error)

func (*Config) BuildModules

func (c *Config) BuildModules() (map[string]module.Module, error)

BuildModules constructs Module values from the config.

func (*Config) ModuleSpec

func (c *Config) ModuleSpec(name string) (ModuleSpec, bool)

type MarkSpec

type MarkSpec struct {
	Animal string `yaml:"animal,omitempty"`
	File   string `yaml:"file,omitempty"`
	Text   string `yaml:"text,omitempty"`
}

type ModuleSpec

type ModuleSpec struct {
	Builtin     string         `yaml:"builtin,omitempty"`
	Command     string         `yaml:"command,omitempty"`
	CommandFull string         `yaml:"command_full,omitempty"`
	File        string         `yaml:"file,omitempty"`
	Text        string         `yaml:"text,omitempty"`
	Cache       string         `yaml:"cache,omitempty"`
	Timeout     string         `yaml:"timeout,omitempty"`
	Always      bool           `yaml:"always,omitempty"`
	OKText      string         `yaml:"ok_text,omitempty"`
	Raw         map[string]any `yaml:",inline"`
}

Jump to

Keyboard shortcuts

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