config

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const S_HOME = "HOME"

Variables

This section is empty.

Functions

func EnsureExists

func EnsureExists(conf *Config) error

func GetCacheDir

func GetCacheDir() string

func GetConfigDir

func GetConfigDir() string

func Path

func Path() string

func Save

func Save(conf *Config) error

Types

type Config

type Config struct {
	Logging struct {
		NoColor bool   `toml:"no_color"`
		Level   string `toml:"level"`
	} `toml:"logging"`

	DirectoryList []string `toml:"directory_list"`

	SqlDictList []string `toml:"sql_dict_list"`

	Style string `toml:"style"`

	ArticleStyle string `toml:"article_style"`

	FontFamily string `toml:"font_family"`
	FontSize   int    `toml:"font_size"`

	SearchOnType          bool `toml:"search_on_type"`
	SearchOnTypeMinLength int  `toml:"search_on_type_min_length"`

	HeaderTemplate string `toml:"header_template"`
	HeaderWordWrap bool   `toml:"header_word_wrap"`

	HistoryDisable  bool `toml:"history_disable"`
	HistoryAutoSave bool `toml:"history_auto_save"`
	HistoryMaxSize  int  `toml:"history_max_size"`

	MostFrequentDisable  bool `toml:"most_frequent_disable"`
	MostFrequentAutoSave bool `toml:"most_frequent_auto_save"`
	MostFrequentMaxSize  int  `toml:"most_frequent_max_size"`

	FavoritesAutoSave bool `toml:"favorites_auto_save"`

	MaxResultsTotal int `toml:"max_results_total"`

	Audio bool `toml:"audio"`

	AudioMPV bool `toml:"audio_mpv"`

	AudioDownloadTimeout time.Duration `toml:"audio_download_timeout"`

	AudioAutoPlay int `toml:"audio_auto_play"`

	AudioAutoPlayWaitBetween time.Duration `toml:"audio_auto_play_wait_between"`

	EmbedExternalStylesheet bool `toml:"embed_external_stylesheet"`

	ColorMapping map[string]string `toml:"color_mapping"`

	PopupStyleStr string `toml:"popup_style_str"`

	ArticleZoomFactor float64 `toml:"article_zoom_factor"`

	ArticleArrowKeys bool `toml:"article_arrow_keys"`

	ReduceMinimumWindowWidth bool `toml:"reduce_minimum_window_width"`

	LocalServerPorts []string `toml:"local_server_ports"`

	LocalClientTimeout time.Duration `toml:"local_client_timeout"`

	WebEnable bool `toml:"web_enable"`
	WebExpose bool `toml:"web_expose"`

	WebShowPoweredBy bool `toml:"web_show_powered_by"`

	SearchWorkerCount int `toml:"search_worker_count"`

	SearchTimeout time.Duration `toml:"search_timeout"`
}

func Default

func Default() *Config

func Load

func Load() (*Config, error)

func MustLoad

func MustLoad() *Config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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