settings

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package settings persists small, single-purpose CLI preferences to the user config dir (~/.config/swarmcli): the version at which the user dismissed the startup update notice, and whether the phone-app notice has been shown.

Every writer loads, changes its own field and saves, because Save writes the whole file and a fresh Settings{} would erase the other fields.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Settings

type Settings struct {
	// DismissedUpdateVersion is the latest-release version at which the user
	// ticked "do not show again for this version" in the startup update
	// notice. A different latest version re-shows the notice.
	DismissedUpdateVersion string `json:"dismissedUpdateVersion,omitempty"`

	// ConnectAppNoticeShown records that the one-time "press c" line about the
	// phone app has been on the stack bar once, so it is not shown again.
	ConnectAppNoticeShown bool `json:"connectAppNoticeShown,omitempty"`
}

Settings is the persisted CLI preference state.

func Load

func Load() Settings

Load reads the settings file. A missing or unreadable/corrupt file is not an error — it yields the zero value.

func (Settings) Save

func (s Settings) Save() error

Save writes the settings file (0644), creating ~/.config/swarmcli if needed.

Jump to

Keyboard shortcuts

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