Documentation
¶
Overview ¶
Package wisp provides utilities for working with the .beads-wisp directory. This file implements wisp-based config storage for transient/local settings.
Package wisp provides utilities for working with the .beads directory.
This package was originally for "hook files" but those are now deprecated in favor of pinned beads. The remaining utilities help with directory management for the beads system.
Index ¶
- Constants
- func EnsureDir(root string) (string, error)
- func WispPath(root, filename string) string
- type Config
- func (c *Config) All() map[string]interface{}
- func (c *Config) Block(key string) error
- func (c *Config) BlockedKeys() []string
- func (c *Config) Clear() error
- func (c *Config) ConfigPath() string
- func (c *Config) Get(key string) interface{}
- func (c *Config) GetBool(key string) bool
- func (c *Config) GetString(key string) string
- func (c *Config) IsBlocked(key string) bool
- func (c *Config) Keys() []string
- func (c *Config) Set(key string, value interface{}) error
- func (c *Config) Unset(key string) error
- type ConfigFile
Constants ¶
const ConfigSubdir = "config"
ConfigSubdir is the subdirectory within WispConfigDir for config files.
const WispConfigDir = ".beads-wisp"
WispConfigDir is the directory for wisp config storage (never synced via git).
const WispDir = ".beads"
WispDir is the directory where beads data is stored.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config provides access to wisp-based config storage for a specific rig. This storage is local-only and never synced via git.
func NewConfig ¶
NewConfig creates a new Config for the given rig. townRoot is the path to the town directory (e.g., ~/gt). rigName is the rig identifier (e.g., "gastown").
func (*Config) Block ¶
Block marks a key as blocked (equivalent to NullValue). Blocked keys return nil on Get and cannot be Set.
func (*Config) BlockedKeys ¶
BlockedKeys returns a copy of all blocked keys.
func (*Config) ConfigPath ¶
ConfigPath returns the path to the config file.
func (*Config) Get ¶
Get returns the value for the given key, or nil if not set. Returns nil for blocked keys.
func (*Config) GetBool ¶
GetBool returns the value for the given key as a bool. Returns false if not set, not a bool, or blocked.
func (*Config) GetString ¶
GetString returns the value for the given key as a string. Returns empty string if not set, not a string, or blocked.
type ConfigFile ¶
type ConfigFile struct {
Rig string `json:"rig"`
Values map[string]interface{} `json:"values"`
Blocked []string `json:"blocked"`
}
ConfigFile represents the JSON structure for wisp config storage. Storage location: .beads-wisp/config/<rig>.json