config

package
v0.1.70 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDefaultConfig added in v0.1.65

func LoadDefaultConfig(v *viper.Viper) error

LoadDefaultConfig loads in the defaults defined in this file

func LoadUserConfig added in v0.1.65

func LoadUserConfig() (*viper.Viper, error)

LoadUserConfig gets the user's config

func LoadUserConfigFromFile added in v0.1.65

func LoadUserConfigFromFile(v *viper.Viper) error

LoadUserConfigFromFile Loads the user config from their config file, creating the file as an empty config if it does not exist

Types

type AppConfig

type AppConfig struct {
	Debug      bool   `long:"debug" env:"DEBUG" default:"false"`
	Version    string `long:"version" env:"VERSION" default:"unversioned"`
	Commit     string `long:"commit" env:"COMMIT"`
	BuildDate  string `long:"build-date" env:"BUILD_DATE"`
	Name       string `long:"name" env:"NAME" default:"lazygit"`
	UserConfig *viper.Viper
}

AppConfig contains the base configuration fields required for lazygit.

func NewAppConfig added in v0.1.65

func NewAppConfig(name, version, commit, date string, debuggingFlag *bool) (*AppConfig, error)

NewAppConfig makes a new app config

func (*AppConfig) GetBuildDate

func (c *AppConfig) GetBuildDate() string

GetBuildDate returns debug flag

func (*AppConfig) GetCommit

func (c *AppConfig) GetCommit() string

GetCommit returns debug flag

func (*AppConfig) GetDebug

func (c *AppConfig) GetDebug() bool

GetDebug returns debug flag

func (*AppConfig) GetName

func (c *AppConfig) GetName() string

GetName returns debug flag

func (*AppConfig) GetUserConfig added in v0.1.65

func (c *AppConfig) GetUserConfig() *viper.Viper

GetUserConfig returns the user config

func (*AppConfig) GetVersion

func (c *AppConfig) GetVersion() string

GetVersion returns debug flag

func (*AppConfig) InsertToUserConfig added in v0.1.65

func (c *AppConfig) InsertToUserConfig(key, value string) error

InsertToUserConfig adds a key/value pair to the user's config and saves it

type AppConfigurer

type AppConfigurer interface {
	GetDebug() bool
	GetVersion() string
	GetCommit() string
	GetBuildDate() string
	GetName() string
	GetUserConfig() *viper.Viper
	InsertToUserConfig(string, string) error
}

AppConfigurer interface allows individual app config structs to inherit Fields from AppConfig and still be used by lazygit.

Jump to

Keyboard shortcuts

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