Skip to content

Commit

Permalink
Ammend http config and fix unmarshalling
Browse files Browse the repository at this point in the history
  • Loading branch information
cluttrdev committed Feb 25, 2024
1 parent 68778f6 commit 4e20117
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ type ProjectCatchUp struct {
}

type HTTP struct {
Host string `default:"127.0.0.1" yaml:"host"`
Port string `default:"8080" yaml:"port"`
Enabled bool `default:"true" yaml:"enabled"`
Host string `default:"127.0.0.1" yaml:"host"`
Port string `default:"9100" yaml:"port"`
Debug bool `default:"false" yaml:"debug"`
}

type Log struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/config/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (c *Config) UnmarshalYAML(v *yaml.Node) error {

Projects []yaml.Node `yaml:"projects"`

HTTP HTTP `yaml:"server"`
HTTP HTTP `yaml:"http"`

Log Log `yaml:"log"`
}
Expand Down
4 changes: 3 additions & 1 deletion test/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ func defaultConfig() config.Config {

cfg.Projects = []config.Project{}

cfg.HTTP.Enabled = true
cfg.HTTP.Host = "127.0.0.1"
cfg.HTTP.Port = "8080"
cfg.HTTP.Port = "9100"
cfg.HTTP.Debug = false

cfg.Log.Level = "info"
cfg.Log.Format = "text"
Expand Down

0 comments on commit 4e20117

Please sign in to comment.