defaults

package
v3.4.9 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MPL-2.0 Imports: 5 Imported by: ? 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

Index

Constants

View Source
const (
	KeyProject = "project"
)

Variables

View Source
var (
	ConfigFile   = "defaults.json"
	ConfigFolder = client.CacheFolder

	DefaultKeys = []string{KeyProject}
)

Functions

func IsSupportedKey

func IsSupportedKey(key string) bool

IsSupportedKey returns true if the given key is supported

Types

type Defaults

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

Defaults holds the default values

func NewFromPath

func NewFromPath(folderPath string, fileName string) (*Defaults, error)

NewFromPath creates a new defaults instance from the given path

func (*Defaults) Get

func (d *Defaults) Get(key string, fallback string) (string, error)

Get returns the value for the given key

func (*Defaults) Set

func (d *Defaults) Set(key string, value string) error

Set sets the given key to the given value and persists the defaults on disk

Jump to

Keyboard shortcuts

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