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
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
TrayPreference reports the persisted close-to-tray choice on this desktop.
func WriteTrayPreference ¶ added in v0.10.0
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.