settings

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 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

Overview

Package settings holds the client's settings that are this computer's, with no UI: the change between this computer's maild and lodge's (docs/specs/settings-ui.md, Server pane), the Server pane's local facts, and the close-to-tray preference.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeServer added in v0.10.0

func ChangeServer(options Options, flatpak bool, next conn.AppConfig) (moved bool, err error)

ChangeServer applies the desktop mode transition, including Flatpak stop and rollback. The caller serializes changes and retargets its connection when moved is true, including after a failed local start.

func TrayPreference added in v0.10.0

func TrayPreference(configFile string) bool

TrayPreference reports the persisted close-to-tray choice on this desktop.

func WriteTrayPreference added in v0.10.0

func WriteTrayPreference(configFile string, on bool) error

WriteTrayPreference persists the close-to-tray choice next to app.json.

Types

type Options

type Options struct {
	// ConfigFile is app.json's path.
	ConfigFile string
	// LeaveLocal saves and closes what keeps this computer's maild's
	// drafts open, and returns once they have saved: a change to lodge runs
	// it before StopLocal. It may be nil.
	LeaveLocal func()
	// StopLocal stops this computer's maild and returns once it has
	// stopped: mailctl shutdown.
	StopLocal func(ctx context.Context) error
	// StartLocal starts this computer's maild and returns once it answers:
	// frostmail --start-maild. Its error is the launcher's last line.
	StartLocal func(ctx context.Context) error
}

Options are what a change of mode runs: the app's own configuration, and the steps that stop and start this computer's maild.

type ServerFacts

type ServerFacts struct {
	// Flatpak is true in this app's Flatpak: a change of mode stops or
	// starts its maild.
	Flatpak bool
	// LocalData is true when maild's data directory holds a database.
	LocalData bool
	// HostMail is true when a Frostmail installed outside Flatpak has mail
	// here, which the move note says how to bring in.
	HostMail bool
}

ServerFacts are the Server pane's local facts: no request to maild, and none to lodge, so the pane says the same while either is unreachable.

func FactsFrom

func FactsFrom(getenv func(string) string) ServerFacts

FactsFrom reads the facts from the environment, as the shell did. Only the files' metadata is read: the database belongs to maild.

Jump to

Keyboard shortcuts

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