Skip to content

Commit

Permalink
Merge pull request #9 from polarsquad/config
Browse files Browse the repository at this point in the history
Adding generic env vars to config
  • Loading branch information
mikat-polarsquad authored Oct 2, 2019
2 parents b48aed2 + ea220cc commit fdeb00b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
// Config Has mainly API configurations, and maybe some global config values
type Config struct {
API API `json:"api"`
Env Env `json:"env"`
}

// API struct holds authentication information for Harvest REST API,
Expand All @@ -20,6 +21,11 @@ type API struct {
BaseURL string `json:"base_url"`
}

// Env has generic variables for configuration, eg. date formatter string, etc...
type Env struct {
DateFormatter string `json:"date_formatter"`
}

// LoadConfig loads the file and parses it to struct
func LoadConfig(file string) *Config {
c := new(Config)
Expand Down

0 comments on commit fdeb00b

Please sign in to comment.