Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read config #55

Merged
merged 4 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
rename Config struct to ServerConfig
Signed-off-by: Maxim Sukharev <[email protected]>
  • Loading branch information
smacker committed Jul 25, 2018
commit b3ee2b0ec801a830a094501102593b28b2e45f7b
2 changes: 1 addition & 1 deletion cmd/lookout/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type ServeCommand struct {
}

func (c *ServeCommand) Execute(args []string) error {
var conf lookout.Config
var conf lookout.ServerConfig
configData, err := ioutil.ReadFile(c.ConfigFile)
if err != nil {
return fmt.Errorf("Can't open configuration file: %s", err)
Expand Down
6 changes: 3 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type AnalyzerConfig struct {
Settings map[string]interface{}
}

// Config is a server configuration
type Config struct {
// ServerConfig is a server configuration
type ServerConfig struct {
Analyzers []AnalyzerConfig
}

Expand Down Expand Up @@ -153,7 +153,7 @@ func (s *Server) getConfig(ctx context.Context, logger log.Logger, e Event) (map
return nil, nil
}

var conf Config
var conf ServerConfig
if err := yaml.Unmarshal(configContent, &conf); err != nil {
return nil, fmt.Errorf("Can't parse configuration file: %s", err)
}
Expand Down