config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVaultPath       = "~/.vault/notes"
	DefaultEditor          = "nvim"
	DefaultTemplateDir     = "~/.vault/templates"
	DefaultDefaultTemplate = "blank"
	DefaultSyncInterval    = 60
	DefaultConflictStrat   = "ask"
	DefaultQueueRetryLimit = 5
	DefaultTheme           = "dark"
	DefaultDateFormat      = "2006-01-02"
	DefaultListSort        = "modified"
	DefaultMaxResults      = 50
	DefaultFuzzy           = true
	DefaultHighlight       = true

	DefaultObsidianSubfolder = "VaultSync"
	DefaultObsidianWikilinks = true

	DefaultGitAutoCommit    = false
	DefaultGitCommitMessage = "vault: sync {filename}"
)

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() (string, error)

func ConfigPath

func ConfigPath() (string, error)

func Save

func Save(cfg *Config) error

func VaultDir

func VaultDir() (string, error)

Types

type BackendsConfig

type BackendsConfig struct {
	Notion   NotionConfig   `mapstructure:"notion"`
	Obsidian ObsidianConfig `mapstructure:"obsidian"`
	Git      GitConfig      `mapstructure:"git"`
}

type Config

type Config struct {
	Vault         VaultConfig         `mapstructure:"vault"`
	Sync          SyncConfig          `mapstructure:"sync"`
	Backends      BackendsConfig      `mapstructure:"backends"`
	TUI           TUIConfig           `mapstructure:"tui"`
	Search        SearchConfig        `mapstructure:"search"`
	Notifications NotificationsConfig `mapstructure:"notifications"`
	Hooks         HooksConfig         `mapstructure:"hooks"`
}

func DefaultConfig

func DefaultConfig() Config

func Load

func Load() (*Config, error)

type GitConfig

type GitConfig struct {
	Enabled       bool   `mapstructure:"enabled"`
	RepoPath      string `mapstructure:"repo_path"`
	AutoCommit    bool   `mapstructure:"auto_commit"`
	CommitMessage string `mapstructure:"commit_message"`
	Remote        string `mapstructure:"remote"`
}

type HooksConfig

type HooksConfig struct {
	PreSync    string `mapstructure:"pre_sync"`
	PostSync   string `mapstructure:"post_sync"`
	OnConflict string `mapstructure:"on_conflict"`
}

type NotificationsConfig

type NotificationsConfig struct {
	SyncSuccess      bool `mapstructure:"sync_success"`
	SyncFailure      bool `mapstructure:"sync_failure"`
	ConflictDetected bool `mapstructure:"conflict_detected"`
}

type NotionConfig

type NotionConfig struct {
	Enabled       bool   `mapstructure:"enabled"`
	Token         string `mapstructure:"token"`
	WorkspaceID   string `mapstructure:"workspace_id"`
	TargetPageID  string `mapstructure:"target_page_id"`
	DatabaseID    string `mapstructure:"database_id"`
	SyncDirection string `mapstructure:"sync_direction"`
}

type ObsidianConfig

type ObsidianConfig struct {
	Enabled       bool   `mapstructure:"enabled"`
	VaultPath     string `mapstructure:"vault_path"`
	Subfolder     string `mapstructure:"subfolder"`
	SyncDirection string `mapstructure:"sync_direction"`
	Wikilinks     bool   `mapstructure:"wikilinks"`
}

type SearchConfig

type SearchConfig struct {
	Fuzzy      bool `mapstructure:"fuzzy"`
	MaxResults int  `mapstructure:"max_results"`
	Highlight  bool `mapstructure:"highlight"`
}

type SyncConfig

type SyncConfig struct {
	AutoSync          bool   `mapstructure:"auto_sync"`
	SyncInterval      int    `mapstructure:"sync_interval"`
	ConflictStrategy  string `mapstructure:"conflict_strategy"`
	QueueRetryLimit   int    `mapstructure:"queue_retry_limit"`
	QueueRetryBackoff string `mapstructure:"queue_retry_backoff"`
}

type TUIConfig

type TUIConfig struct {
	Theme        string `mapstructure:"theme"`
	DateFormat   string `mapstructure:"date_format"`
	ListSort     string `mapstructure:"list_sort"`
	PreviewWidth int    `mapstructure:"preview_width"`
}

type VaultConfig

type VaultConfig struct {
	Path                 string `mapstructure:"path"`
	Editor               string `mapstructure:"editor"`
	AutoDaily            bool   `mapstructure:"auto_daily"`
	TemplateDir          string `mapstructure:"template_dir"`
	DefaultTemplate      string `mapstructure:"default_template"`
	WordCountInStatusbar bool   `mapstructure:"word_count_in_statusbar"`
}

Jump to

Keyboard shortcuts

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