31 lines
836 B
Go

// 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"
)