config

package
v0.0.0-...-3b42088 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const FileExtension string = "json"
View Source
const FileName string = "tstoy.config"

Variables

View Source
var AppFolder string = filepath.Join("TailSpinToys", "tstoy")
View Source
var Default = Options{
	Updates: Updates{
		Automatic:      false,
		CheckFrequency: 90,
	},
}
View Source
var MachineFolder string = getConfigFolder(Machine)
View Source
var UserFolder string = getConfigFolder(User)

Functions

This section is empty.

Types

type Options

type Options struct {
	Updates Updates `mapstructure:"updates,omitempty"`
}

func FromMap

func FromMap(data map[string]any) Options

Converts the viper map of settings to an instance of Options. This is required for handling how viper fully downcases keys. It ensures that the show command can display a consistent set of values from the configuration options.

func (*Options) ToJson

func (o *Options) ToJson() ([]byte, error)

func (*Options) ToMap

func (o *Options) ToMap() map[string]any

type Scope

type Scope int
const (
	Machine Scope = iota
	User
)

type Updates

type Updates struct {
	Automatic      bool `mapstructure:"automatic,omitempty"`
	CheckFrequency int  `mapstructure:"checkFrequency,omitempty"`
}

Jump to

Keyboard shortcuts

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