settings

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package settings provides access to persistent user settings.

Index

Constants

View Source
const (
	DefaultIMAPPort = "1143"
	DefaultSMTPPort = "1025"
	DefaultAPIPort  = "1042"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key added in v2.4.0

type Key string
const (
	FirstStartKey          Key = "first_time_start"
	FirstStartGUIKey       Key = "first_time_start_gui"
	LastHeartbeatKey       Key = "last_heartbeat"
	APIPortKey             Key = "user_port_api"
	IMAPPortKey            Key = "user_port_imap"
	SMTPPortKey            Key = "user_port_smtp"
	SMTPSSLKey             Key = "user_ssl_smtp"
	AllowProxyKey          Key = "allow_proxy"
	AutostartKey           Key = "autostart"
	AutoUpdateKey          Key = "autoupdate"
	CookiesKey             Key = "cookies"
	LastVersionKey         Key = "last_used_version"
	UpdateChannelKey       Key = "update_channel"
	RolloutKey             Key = "rollout"
	PreferredKeychainKey   Key = "preferred_keychain"
	CacheEnabledKey        Key = "cache_enabled"
	CacheCompressionKey    Key = "cache_compression"
	CacheLocationKey       Key = "cache_location"
	CacheMinFreeAbsKey     Key = "cache_min_free_abs"
	CacheMinFreeRatKey     Key = "cache_min_free_rat"
	CacheConcurrencyRead   Key = "cache_concurrent_read"
	CacheConcurrencyWrite  Key = "cache_concurrent_write"
	IMAPWorkers            Key = "imap_workers"
	FetchWorkers           Key = "fetch_workers"
	AttachmentWorkers      Key = "attachment_workers"
	ColorScheme            Key = "color_scheme"
	RebrandingMigrationKey Key = "rebranding_migrated"
	IsAllMailVisible       Key = "is_all_mail_visible"
)

Keys of preferences in JSON file.

type Settings

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

func New

func New(settingsPath string) *Settings

func (Settings) Get

func (p Settings) Get(key Key) string

func (Settings) GetBool

func (p Settings) GetBool(key Key) bool

func (Settings) GetFloat64

func (p Settings) GetFloat64(key Key) float64

func (Settings) GetInt

func (p Settings) GetInt(key Key) int

func (Settings) Set

func (p Settings) Set(key Key, value string)

func (Settings) SetBool

func (p Settings) SetBool(key Key, value bool)

func (Settings) SetFloat64

func (p Settings) SetFloat64(key Key, value float64)

func (Settings) SetInt

func (p Settings) SetInt(key Key, value int)

Jump to

Keyboard shortcuts

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