30 lines
756 B
Go
30 lines
756 B
Go
package config
|
|
|
|
import "time"
|
|
|
|
type LayersConfig struct {
|
|
Queue QueueLayerConfig `yaml:"queue"`
|
|
CircuitBreaker CircuitBreakerLayerConfig `yaml:"circuitbreaker"`
|
|
}
|
|
|
|
func NewDefaultLayersConfig() LayersConfig {
|
|
return LayersConfig{
|
|
Queue: QueueLayerConfig{
|
|
TemplateDir: "./layers/queue/templates",
|
|
DefaultKeepAlive: NewInterpolatedDuration(time.Minute),
|
|
},
|
|
CircuitBreaker: CircuitBreakerLayerConfig{
|
|
TemplateDir: "./layers/circuitbreaker/templates",
|
|
},
|
|
}
|
|
}
|
|
|
|
type QueueLayerConfig struct {
|
|
TemplateDir InterpolatedString `yaml:"templateDir"`
|
|
DefaultKeepAlive *InterpolatedDuration `yaml:"defaultKeepAlive"`
|
|
}
|
|
|
|
type CircuitBreakerLayerConfig struct {
|
|
TemplateDir InterpolatedString `yaml:"templateDir"`
|
|
}
|