config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Appearance settings
	Theme       string `json:"theme"`
	AccentColor string `json:"accentColor"`

	// Viewer settings
	DefaultZoom      int    `json:"defaultZoom"`
	ShowLeftSidebar  bool   `json:"showLeftSidebar"`
	ShowRightSidebar bool   `json:"showRightSidebar"`
	DefaultViewMode  string `json:"defaultViewMode"` // "single" or "scroll"

	// File settings
	RecentFilesLength int `json:"recentFilesLength"`
	AutosaveInterval  int `json:"autosaveInterval"`

	// Certificate settings
	CertificateStores []string `json:"certificateStores"`
	TokenLibraries    []string `json:"tokenLibraries"`

	// Advanced settings
	DebugMode     bool `json:"debugMode"`
	HardwareAccel bool `json:"hardwareAccel"`
}

Config holds all application settings persisted to disk.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service provides thread-safe access to application configuration.

func NewService

func NewService() (*Service, error)

NewService creates a config service using the default config directory.

func NewServiceWithDir

func NewServiceWithDir(configDir string) (*Service, error)

NewServiceWithDir creates a config service using a custom directory.

func (*Service) Get

func (s *Service) Get() *Config

Get returns a copy of the current configuration.

func (*Service) Load

func (s *Service) Load() error

Load reads configuration from disk into memory.

func (*Service) Reset

func (s *Service) Reset() error

Reset restores default settings and saves to disk.

func (*Service) Save

func (s *Service) Save() error

Save writes the current configuration to disk atomically.

func (*Service) Update

func (s *Service) Update(config *Config) error

Update replaces the configuration and saves it to disk.

Jump to

Keyboard shortcuts

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