wisp

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 5 Imported by: 0

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

View Source
const ConfigSubdir = "config"

ConfigSubdir is the subdirectory within WispConfigDir for config files.

View Source
const WispConfigDir = ".beads-wisp"

WispConfigDir is the directory for wisp config storage (never synced via git).

View Source
const WispDir = ".beads"

WispDir is the directory where beads data is stored.

Variables

This section is empty.

Functions

func EnsureDir

func EnsureDir(root string) (string, error)

EnsureDir ensures the .beads directory exists in the given root.

func WispPath

func WispPath(root, filename string) string

WispPath returns the full path to a file in the beads directory.

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

func NewConfig(townRoot, rigName string) *Config

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) All

func (c *Config) All() map[string]interface{}

All returns a copy of all values (excludes blocked keys).

func (*Config) Block

func (c *Config) Block(key string) error

Block marks a key as blocked (equivalent to NullValue). Blocked keys return nil on Get and cannot be Set.

func (*Config) BlockedKeys

func (c *Config) BlockedKeys() []string

BlockedKeys returns a copy of all blocked keys.

func (*Config) Clear

func (c *Config) Clear() error

Clear removes all values and blocked keys.

func (*Config) ConfigPath

func (c *Config) ConfigPath() string

ConfigPath returns the path to the config file.

func (*Config) Get

func (c *Config) Get(key string) interface{}

Get returns the value for the given key, or nil if not set. Returns nil for blocked keys.

func (*Config) GetBool

func (c *Config) GetBool(key string) bool

GetBool returns the value for the given key as a bool. Returns false if not set, not a bool, or blocked.

func (*Config) GetString

func (c *Config) GetString(key string) string

GetString returns the value for the given key as a string. Returns empty string if not set, not a string, or blocked.

func (*Config) IsBlocked

func (c *Config) IsBlocked(key string) bool

IsBlocked returns true if the key is blocked.

func (*Config) Keys

func (c *Config) Keys() []string

Keys returns all keys (both set and blocked).

func (*Config) Set

func (c *Config) Set(key string, value interface{}) error

Set stores a value for the given key. Setting a blocked key has no effect (the block takes precedence).

func (*Config) Unset

func (c *Config) Unset(key string) error

Unset removes a key from both values and blocked lists.

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

Jump to

Keyboard shortcuts

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