Documentation
¶
Index ¶
- func GetDefaultConfig() []byte
- func GetPlatformDefaultConfig() []byte
- func LoadAndMergeFile(v *viper.Viper, filename string) (string, error)
- func LoadConfig(filename string, withDefaults bool) (*viper.Viper, string, error)
- func LoadDefaults(v *viper.Viper, defaults []byte) error
- type AppConfig
- func (c *AppConfig) GetAppState() *AppState
- func (c *AppConfig) GetBuildDate() string
- func (c *AppConfig) GetBuildSource() string
- func (c *AppConfig) GetCommit() string
- func (c *AppConfig) GetDebug() bool
- func (c *AppConfig) GetIsNewRepo() bool
- func (c *AppConfig) GetName() string
- func (c *AppConfig) GetUserConfig() *viper.Viper
- func (c *AppConfig) GetUserConfigDir() string
- func (c *AppConfig) GetVersion() string
- func (c *AppConfig) LoadAppState() error
- func (c *AppConfig) SaveAppState() error
- func (c *AppConfig) SetIsNewRepo(toSet bool)
- func (c *AppConfig) WriteToUserConfig(key string, value interface{}) error
- type AppConfigurer
- type AppState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultConfig ¶ added in v0.2.0
func GetDefaultConfig() []byte
GetDefaultConfig returns the application default configuration
func GetPlatformDefaultConfig ¶ added in v0.2.2
func GetPlatformDefaultConfig() []byte
GetPlatformDefaultConfig gets the defaults for the platform
func LoadAndMergeFile ¶ added in v0.2.0
LoadAndMergeFile Loads the config/state file, creating the file has an empty one if it does not exist
func LoadConfig ¶ added in v0.2.0
LoadConfig gets the user's config
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"`
BuildSource string `long:"build-source" env:"BUILD_SOURCE" default:""`
UserConfig *viper.Viper
UserConfigDir string
AppState *AppState
IsNewRepo bool
}
AppConfig contains the base configuration fields required for lazygit.
func NewAppConfig ¶ added in v0.1.65
func NewAppConfig(name, version, commit, date string, buildSource string, debuggingFlag bool) (*AppConfig, error)
NewAppConfig makes a new app config
func (*AppConfig) GetAppState ¶ added in v0.2.0
GetAppState returns the app state
func (*AppConfig) GetBuildDate ¶
GetBuildDate returns debug flag
func (*AppConfig) GetBuildSource ¶ added in v0.2.0
GetBuildSource returns the source of the build. For builds from goreleaser this will be binaryBuild
func (*AppConfig) GetIsNewRepo ¶ added in v0.7.1
GetIsNewRepo returns known repo boolean
func (*AppConfig) GetUserConfig ¶ added in v0.1.65
GetUserConfig returns the user config
func (*AppConfig) GetUserConfigDir ¶ added in v0.10.1
func (*AppConfig) GetVersion ¶
GetVersion returns debug flag
func (*AppConfig) LoadAppState ¶ added in v0.2.0
LoadAppState loads recorded AppState from file
func (*AppConfig) SaveAppState ¶ added in v0.2.0
SaveAppState marshalls the AppState struct and writes it to the disk
func (*AppConfig) SetIsNewRepo ¶ added in v0.7.1
SetIsNewRepo set if the current repo is known
func (*AppConfig) WriteToUserConfig ¶ added in v0.2.0
WriteToUserConfig 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
GetBuildSource() string
GetUserConfig() *viper.Viper
GetUserConfigDir() string
GetAppState() *AppState
WriteToUserConfig(string, interface{}) error
SaveAppState() error
LoadAppState() error
SetIsNewRepo(bool)
GetIsNewRepo() bool
}
AppConfigurer interface allows individual app config structs to inherit Fields from AppConfig and still be used by lazygit.