defaults

package
v0.20.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyProject = "project"
)

Variables

View Source
var (
	ConfigFile   = "defaults.json"
	ConfigFolder = platform.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