Initial commit.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package configuration
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var errRequestTimeoutTooLow = errors.New("request timeout is too low")
|
||||
|
||||
// HTTPClient is an HTTP client configuration.
|
||||
type HTTPClient struct {
|
||||
RequestTimeoutSeconds int64 `json:"request_timeout_seconds"`
|
||||
}
|
||||
|
||||
// Validate validates configuration for HTTP clients.
|
||||
func (h *HTTPClient) Validate() error {
|
||||
if h.RequestTimeoutSeconds < 1 {
|
||||
return fmt.Errorf("validate HTTP client configuration: %w", errRequestTimeoutTooLow)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user