generated from bool64/go-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.go
44 lines (32 loc) · 1.21 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package brick
import (
"time"
"github.com/bool64/brick/debug"
"github.com/bool64/zapctxd"
)
// BaseConfig is a basic application agnostic service configuration that manages common infrastructure.
type BaseConfig struct {
// Initialized indicates zero/uninitialized value of the configuration.
Initialized bool `default:"true"`
Log zapctxd.Config `split_words:"true"`
// Environment is the name of environment where application runs.
Environment string `default:"dev"`
// ServiceName is the name of the service to use in documentation and tracing.
ServiceName string `split_words:"true"`
// HTTPListenAddr is the address of HTTP server listener.
HTTPListenAddr string `split_words:"true" default:":80"`
// ShutdownTimeout limits time for graceful shutdown of an application.
ShutdownTimeout time.Duration `split_words:"true" default:"10s"`
// Debug controls dev tools.
Debug debug.Config `split_words:"true"`
// CacheTransferURL is URL to fetch cache from on application start.
CacheTransferURL string `split_words:"true"`
}
// WithBaseConfig is an embedded config accessor.
type WithBaseConfig interface {
Base() BaseConfig
}
// Base exposes base config.
func (c *BaseConfig) Base() BaseConfig {
return *c
}