config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigDirPerm is the permission for the config directory (0700 = rwx------)
	// Restrictive permissions protect the directory from being accessed by other users
	ConfigDirPerm os.FileMode = 0700
	// ConfigFilePerm is the permission for the config file (0600 = rw-------)
	// Restrictive permissions protect the API key from being read by other users
	ConfigFilePerm os.FileMode = 0600
)

Variables

This section is empty.

Functions

func Get

func Get(key string) interface{}

func Save

func Save(cfg *Config) error

func Set

func Set(key, value string) error

Types

type Config

type Config struct {
	APIKey              string `mapstructure:"api_key"`
	Model               string `mapstructure:"model"`
	Theme               string `mapstructure:"theme"`
	ShowDiff            bool   `mapstructure:"show_diff"`
	AutoCopy            bool   `mapstructure:"auto_copy"`
	Mode                string `mapstructure:"mode"`
	Language            string `mapstructure:"language"`
	TranslationLanguage string `mapstructure:"translation_language"`
	CacheEnabled        bool   `mapstructure:"cache_enabled"`
	CacheTTLDays        int    `mapstructure:"cache_ttl_days"`
}

func Load

func Load() (*Config, error)

Jump to

Keyboard shortcuts

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