config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(path string, cfg *Config) error

Types

type Config

type Config struct {
	Version       int         `json:"version"`
	Servers       []Server    `json:"servers"`
	DefaultServer string      `json:"defaultServer"`
	Preferences   Preferences `json:"preferences"`
}

func Default

func Default() Config

func LoadOrInit

func LoadOrInit(customPath string) (Config, string, error)

func (*Config) CurrentServer

func (c *Config) CurrentServer() *Server

func (*Config) OverrideURL

func (c *Config) OverrideURL(url string)

func (*Config) OverrideVerifyTLS

func (c *Config) OverrideVerifyTLS(v bool)

func (*Config) Validate

func (c *Config) Validate() error

type Preferences

type Preferences struct {
	AutosaveEnabled    bool   `json:"autosaveEnabled"`
	AutosaveDebounceMs int    `json:"autosaveDebounceMs"`
	Theme              string `json:"theme"` // "dark" or "light"
}

type Server

type Server struct {
	Name      string `json:"name"`
	URL       string `json:"url"`
	VerifyTLS bool   `json:"verifyTLS"`
}

Jump to

Keyboard shortcuts

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