Skip to content

Commit

Permalink
Add dodoc
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzei committed Dec 23, 2018
1 parent 56e989b commit 8a19879
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ func (c *configuration) Clone() *configuration {
return &clone
}

// IsValid checks if all needed fields are set.
func (c *configuration) IsValid() error {
if len(c.APIKey) == 0 {
return fmt.Errorf("APIKey is not configured.")
}

if len(c.APISecret) == 0 {
return fmt.Errorf("APISecret is not configured.")
}

if len(c.WebhookSecret) == 0 {
return fmt.Errorf("WebhookSecret is not configured.")
}
Expand Down

0 comments on commit 8a19879

Please sign in to comment.