config

package
v0.1.79 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: MIT Imports: 3 Imported by: 3 modules, 5 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

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