config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config handles loading and managing msgvault configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHome

func DefaultHome() string

DefaultHome returns the default msgvault home directory. Respects MSGVAULT_HOME environment variable.

Types

type ChatConfig

type ChatConfig struct {
	Server     string `toml:"server"`      // Ollama server URL
	Model      string `toml:"model"`       // Model name
	MaxResults int    `toml:"max_results"` // Top-K messages to retrieve
}

Config represents the msgvault configuration. ChatConfig holds chat/LLM configuration.

type Config

type Config struct {
	Data  DataConfig  `toml:"data"`
	OAuth OAuthConfig `toml:"oauth"`
	Sync  SyncConfig  `toml:"sync"`
	Chat  ChatConfig  `toml:"chat"`

	// Computed paths (not from config file)
	HomeDir string `toml:"-"`
}

func Load

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

Load reads the configuration from the specified file. If path is empty, uses the default location (~/.msgvault/config.toml).

func (*Config) AnalyticsDir

func (c *Config) AnalyticsDir() string

AnalyticsDir returns the path to the Parquet analytics directory.

func (*Config) AttachmentsDir

func (c *Config) AttachmentsDir() string

AttachmentsDir returns the path to the attachments directory.

func (*Config) DatabasePath

func (c *Config) DatabasePath() string

DatabasePath returns the path to the SQLite database.

func (*Config) TokensDir

func (c *Config) TokensDir() string

TokensDir returns the path to the OAuth tokens directory.

type DataConfig

type DataConfig struct {
	DataDir     string `toml:"data_dir"`
	DatabaseURL string `toml:"database_url"`
}

DataConfig holds data storage configuration.

type OAuthConfig

type OAuthConfig struct {
	ClientSecrets string `toml:"client_secrets"`
}

OAuthConfig holds OAuth configuration.

type SyncConfig

type SyncConfig struct {
	RateLimitQPS int `toml:"rate_limit_qps"`
}

SyncConfig holds sync-related configuration.

Jump to

Keyboard shortcuts

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