Documentation ¶
Index ¶
- func LoadDefaultConfig(v *viper.Viper) error
- func LoadUserConfig() (*viper.Viper, error)
- func LoadUserConfigFromFile(v *viper.Viper) error
- type AppConfig
- func (c *AppConfig) GetBuildDate() string
- func (c *AppConfig) GetCommit() string
- func (c *AppConfig) GetDebug() bool
- func (c *AppConfig) GetName() string
- func (c *AppConfig) GetUserConfig() *viper.Viper
- func (c *AppConfig) GetVersion() string
- func (c *AppConfig) InsertToUserConfig(key, value string) error
- type AppConfigurer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadDefaultConfig ¶ added in v0.1.65
LoadDefaultConfig loads in the defaults defined in this file
func LoadUserConfig ¶ added in v0.1.65
LoadUserConfig gets the user's config
func LoadUserConfigFromFile ¶ added in v0.1.65
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
NewAppConfig makes a new app config
func (*AppConfig) GetBuildDate ¶
GetBuildDate returns debug flag
func (*AppConfig) GetUserConfig ¶ added in v0.1.65
GetUserConfig returns the user config
func (*AppConfig) GetVersion ¶
GetVersion returns debug flag
func (*AppConfig) InsertToUserConfig ¶ added in v0.1.65
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.
Click to show internal directories.
Click to hide internal directories.