config

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists() bool

Exists checks if the configuration file exists.

func GetConversationDirectory

func GetConversationDirectory() string

func GetHomeDir

func GetHomeDir() string

GetHomeDir returns the user's home directory.

func GetKnowledgeDirectory added in v0.3.2

func GetKnowledgeDirectory() string

func GetModuleDirectory

func GetModuleDirectory(subdir string) string

GetModuleDirectory returns the specified subdirectory under the data directory.

func GetProgramDirectory

func GetProgramDirectory() string

GetProgramDirectory returns the application's data directory e.g., ~/.nomi on Unix systems.

func GetPromptDirectory

func GetPromptDirectory() string

func SaveConfig

func SaveConfig(cfg *Config) error

SaveConfig saves the configuration to the YAML file.

Types

type Config

type Config struct {
	Input     InputConfig  `yaml:"input"      json:"input"`
	Output    OutputConfig `yaml:"output"     json:"output"`
	DevMode   bool         `yaml:"dev_mode"   json:"dev_mode"`
	PlaySound bool         `yaml:"play_sound" json:"play_sound"`
}

func DefaultConfig

func DefaultConfig() Config

defaultConfig returns the default configuration.

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads the configuration from the YAML file or creates a default one if it doesn't exist.

type InputConfig

type InputConfig struct {
	Voice VoiceConfig `yaml:"voice" json:"voice"`
}

Manage the input sources

type OutputConfig

type OutputConfig struct {
	Sqlite SqliteConfig `yaml:"sqlite" json:"sqlite"`
	Speech SpeechConfig `yaml:"speech" json:"speech"`
}

type SpeechConfig added in v0.2.3

type SpeechConfig struct {
	Enabled bool `yaml:"enabled" json:"enabled"`
}

type SqliteConfig added in v0.2.3

type SqliteConfig struct {
	Enabled bool   `yaml:"enabled" json:"enabled"`
	Path    string `yaml:"path"    json:"path"`
}

type VoiceConfig

type VoiceConfig struct {
	Enabled  bool   `yaml:"enabled"  json:"enabled"`
	Language string `yaml:"language" json:"language"`
	KeyCode  uint16 `yaml:"keyCode"  json:"keyCode"`
}

Jump to

Keyboard shortcuts

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