Files
go-server-with-otel/pkg/config/custom.go
Ryan McGuire c1c296a0c0
All checks were successful
Build and Publish / check-chart (push) Successful in 14s
Build and Publish / helm-release (push) Has been skipped
Build and Publish / release (push) Successful in 4m30s
improve shutdown and app service boilerplate
2025-07-20 18:16:12 -04:00

32 lines
961 B
Go

// Package config contains ServiceConfig, which is intended
// to extend go-app/pkg/config.AppConfig. Add any custom fields
// here, and it will automatically be handled by go-app, including
// overrides by environment, and json schema generation
package config
import (
"gitea.libretechconsulting.com/rmcguire/go-app/pkg/config"
)
type ServiceConfig 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"
)