generated from rmcguire/go-server-with-otel
Initial commit
This commit is contained in:
30
pkg/config/custom.go
Normal file
30
pkg/config/custom.go
Normal file
@ -0,0 +1,30 @@
|
||||
// This serves as a reference sample configuration
|
||||
// to show how to merge custom config fields into
|
||||
// go-app configuration
|
||||
package config
|
||||
|
||||
import (
|
||||
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/config"
|
||||
)
|
||||
|
||||
type DemoConfig struct {
|
||||
Timezone string `yaml:"timezone" json:"timezone,omitempty" default:"UTC"`
|
||||
Opts *DemoOpts `yaml:"opts" json:"opts,omitempty"`
|
||||
|
||||
// Embeds go-app config, used by go-app to
|
||||
// merge custom config into go-app config, and to produce
|
||||
// a complete configuration json schema
|
||||
*config.AppConfig
|
||||
}
|
||||
|
||||
type DemoOpts struct {
|
||||
FactLang string `yaml:"factLang" json:"factLang,omitempty" default:"en"`
|
||||
FactType FactType `yaml:"factType" json:"factType,omitempty" default:"random" enum:"today,random"`
|
||||
}
|
||||
|
||||
type FactType string
|
||||
|
||||
const (
|
||||
TypeToday FactType = "today"
|
||||
TypeRandom FactType = "random"
|
||||
)
|
Reference in New Issue
Block a user