config

package
v0.0.0-...-c5aa536 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigPath = func() string {
	home, err := os.UserHomeDir()
	if err != nil {

		return filepath.Join(xdg.ConfigHome, "notebridge", "config.json")
	}
	return filepath.Join(home, ".config", "notebridge", "config.json")
}

ConfigPath returns the path to the config file Uses ~/.config on all platforms for consistency Can be overridden for testing

View Source
var StateFilePath = func() string {
	return filepath.Join(xdg.DataHome, "notebridge", "state.json")
}

StateFilePath returns the path to the state file Uses platform-specific XDG data directory Can be overridden for testing

Functions

This section is empty.

Types

type Config

type Config struct {
	OrgDir             string        `json:"org_dir"`
	ObsidianDir        string        `json:"obsidian_dir"`
	LogFile            string        `json:"log_file"`
	Interval           time.Duration `json:"-"` // Custom JSON handling below
	ResolutionStrategy string        `json:"resolution_strategy,omitempty"`
	ExcludePatterns    []string      `json:"exclude_patterns,omitempty"`
}

Config represents the notebridge configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default configuration

func Load

func Load() (*Config, error)

Load reads configuration from the XDG config directory

func (*Config) ExpandPaths

func (c *Config) ExpandPaths() error

ExpandPaths expands any ~ or relative paths to absolute paths

func (*Config) Save

func (c *Config) Save() error

Save writes configuration to the XDG config directory

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration is valid

Jump to

Keyboard shortcuts

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