cfg

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyRecent        = "recent"
	KeyServerPort    = "server_port"
	KeyEditorCommand = "editor_command"
	KeyUpdateChannel = "update_channel"
	KeyCacheDir      = "templates_dir"
	KeyRegistryDir   = "registry_dir"
	KeyRegistryUrl   = "registry_url"
	KeyVersion       = "version"
	KeyCommit        = "commit"
	KeyDate          = "date"
	KeyWindowHeight  = "window_height"
	KeyWindowWidth   = "window_width"
)

Variables

This section is empty.

Functions

func AllSettings

func AllSettings() map[string]interface{}

func AppendRecentEntry

func AppendRecentEntry(value string) error

AppendRecentEntry appends a new entry to the list of recent entries entries are limited to 5 the most recent entry is at the beginning of the list stores the list in the config file

func CacheDir added in v0.29.0

func CacheDir() string

func ConfigDir

func ConfigDir() string

func ConfigFileUsed

func ConfigFileUsed() string

func EditorCommand

func EditorCommand() string

func Get

func Get(key string) any

func GetBool added in v0.31.5

func GetBool(key string) bool

func GetInt added in v0.31.6

func GetInt(key string) int

func GetString

func GetString(key string) string

func IsSet

func IsSet(key string) bool

func NewConfig

func NewConfig(cfgDir string) (*viper.Viper, error)

func RecentEntries

func RecentEntries() []string

RecentEntries returns the list of recent entries

func RegistryCachePath

func RegistryCachePath() string

func RegistryDir

func RegistryDir() string

func RegistryUrl

func RegistryUrl() string

func RemoveRecentEntry

func RemoveRecentEntry(value string) error

RemoveRecentEntry removes a recent entry from the list

func ServerPort

func ServerPort() string

func Set

func Set(key string, value any)

func SetBool added in v0.31.5

func SetBool(key string, value bool)

func SetBuildInfo

func SetBuildInfo(name string, info BuildInfo)

func SetConfig

func SetConfig(c *viper.Viper)

func UpdateChannel

func UpdateChannel() string

func WriteConfig

func WriteConfig() error

Types

type BuildInfo added in v0.35.0

type BuildInfo struct {
	Version string `yaml:"version"`
	Commit  string `yaml:"commit"`
	Date    string `yaml:"date"`
}

BuildInfo contains information about the build it is stored under a key named "build" in the config file with the name (e.g. cli, studio) as sub-key

func GetBuildInfo added in v0.35.0

func GetBuildInfo(name string) BuildInfo

Jump to

Keyboard shortcuts

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