config

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Configuration file in ~/.config/CONFIG_DIR/CONFIG_FILE
	CONFIG_FILE = "thoughtsync"
	CONFIG_DIR  = "thoughtsync"

	// Keys in the config file with default values
	// Vault path
	VAULT_KEY                     = "vault.path"
	DEFAULT_VAULT_PATH            = "$HOME/thoughtsync-vault"
	VAULT_NOTES_EXTENSION_KEY     = "vault.extension"
	DEFAULT_VAULT_NOTES_EXTENSION = ".md"

	// Journal note format
	JOURNAL_NOTE_FORMAT_KEY = "journal.format"
	DEFAULT_JOURNAL_FORMAT  = "YYYY-MM-DD"

	// Journal directory
	JOURNAL_DIRECTORY_KEY     = "journal.directory"
	DEFAULT_JOURNAL_DIRECTORY = "journal"

	// Git syncing
	GIT_SYNC_ENABLED_KEY       = "git.enable"
	DEFAULT_GIT_SYNC_ENABLED   = false
	GIT_COMMIT_MESSAGE_KEY     = "git.commit-message"
	DEFAULT_GIT_COMMIT_MESSAGE = "thoughtsync: Synced with git"
	GIT_REMOTE_ENABLED_KEY     = "git.remote"
	DEFAULT_GIT_REMOTE_ENABLED = false
	GIT_AUTH_SSH_KEY           = "git.ssh"
	DEFAULT_GIT_AUTH_SSH       = false
	GIT_REMOTE_NAME_KEY        = "git.remote-name"
	DEFAULT_GIT_REMOTE_NAME    = "origin"

	// Inbox catch-all note
	INBOX_NOTE_KEY     = "vault.inbox"
	DEFAULT_INBOX_NOTE = "inbox"
)

Variables

This section is empty.

Functions

func GetAllConfigKeys added in v1.3.1

func GetAllConfigKeys() []string

func InitConfig

func InitConfig()

InitConfig Loads in ThoughtSync config and sets up default values

func SetConfig added in v1.3.1

func SetConfig(configKey, configValue string)

Types

type Config added in v1.3.1

type Config struct {
	VaultPath        string `mapstructure:"vault.path"`
	NotesExtension   string `mapstructure:"vault.extension"`
	JournalFormat    string `mapstructure:"journal.format"`
	JournalDirectory string `mapstructure:"journal.directory"`
	GitCommitMessage string `mapstructure:"git.commit-message"`
	GitRemoteName    string `mapstructure:"git.remote-name"`
	GitSyncEnabled   bool   `mapstructure:"git.enable"`
	GitRemoteEnabled bool   `mapstructure:"git.remote"`
	GitAuthSSH       bool   `mapstructure:"git.ssh"`
}

func GetConfig added in v1.3.1

func GetConfig() *Config

Jump to

Keyboard shortcuts

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