config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Columns is the number of columns in the grid layout (default: 2).
	Columns int `yaml:"columns"`

	// Modules lists which modules to display, in order.
	// If empty, a sensible default set is used.
	Modules []ModuleConfig `yaml:"modules"`
}

Config is the top-level configuration for Lattice.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration when no config file exists.

func Load

func Load() Config

Load reads the config from ~/.config/lattice/config.yaml. If the file doesn't exist, it creates it with the default config.

type ModuleConfig

type ModuleConfig struct {
	Type   string            `yaml:"type"`
	Config map[string]string `yaml:"config,omitempty"`
}

ModuleConfig configures a single module instance.

func (ModuleConfig) Get

func (mc ModuleConfig) Get(key, envVar, fallback string) string

Get retrieves a config value, falling back to an environment variable, then to a default. This lets users put secrets in env vars instead of the config file.

Jump to

Keyboard shortcuts

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