summaryrefslogtreecommitdiffstats
path: root/pkg/config
diff options
context:
space:
mode:
authorAndrei Miulescu <lusu777@gmail.com>2018-08-12 19:31:27 +1000
committerAndrei Miulescu <lusu777@gmail.com>2018-08-12 19:31:27 +1000
commitdcd461d29f21a9626d5298a03283b6d8b46312c3 (patch)
tree42f43f27eb7403c60cc05805fc627debff76417b /pkg/config
parent98c22a36fdaf8806f8fafe8f1e23e53f8e97658d (diff)
Restrucure project in a way where it is more modular
Diffstat (limited to 'pkg/config')
-rw-r--r--pkg/config/app_config.go45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go
new file mode 100644
index 000000000..98e56dea2
--- /dev/null
+++ b/pkg/config/app_config.go
@@ -0,0 +1,45 @@
+package config
+
+// AppConfig contains the base configuration fields required for lazygit.
+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"`
+}
+
+// AppConfigurer interface allows individual app config structs to inherit Fields
+// from AppConfig and still be used by lazygit.
+type AppConfigurer interface {
+ GetDebug() bool
+ GetVersion() string
+ GetCommit() string
+ GetBuildDate() string
+ GetName() string
+}
+
+// GetDebug returns debug flag
+func (c *AppConfig) GetDebug() bool {
+ return c.Debug
+}
+
+// GetVersion returns debug flag
+func (c *AppConfig) GetVersion() string {
+ return c.Version
+}
+
+// GetCommit returns debug flag
+func (c *AppConfig) GetCommit() string {
+ return c.Commit
+}
+
+// GetBuildDate returns debug flag
+func (c *AppConfig) GetBuildDate() string {
+ return c.BuildDate
+}
+
+// GetName returns debug flag
+func (c *AppConfig) GetName() string {
+ return c.Name
+}