settings

package
v0.0.0-...-e8b1e36 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSecret

func GetSecret(name string) ([]byte, error)

Get a secret, returning nil if it doesn't exist

Note that the name is used as the filename of the secret file, so it must not contain special characters.

func MaybeMoveDeprecatedUserSettingsDir

func MaybeMoveDeprecatedUserSettingsDir() error

func SetSecret

func SetSecret(name string, data []byte) error

SetSecret writes a secret to the local secrets directory.

Note that the name is used as the filename of the secret file, so it must not contain special characters.

func UserSettingsDir

func UserSettingsDir() (string, error)

Types

type UserSettings

type UserSettings struct {
	FirstRun         bool   `json:"first_run"` // Set after first run
	AnalyticsEnabled bool   `json:"analytics_enabled"`
	AnalyticsID      string `json:"analytics_id"`
}

UserSettings represents global user settings that span multiple projects

func LoadUserSettings

func LoadUserSettings() (*UserSettings, error)

LoadUserSettings loads the global user settings from disk, returning default struct if no file exists

func (*UserSettings) Save

func (s *UserSettings) Save() error

Save saves global user settings to disk

Jump to

Keyboard shortcuts

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