Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Config = &config{}
Functions ¶
func ValidateCurrent ¶
func ValidateCurrent() error
ValidateCurrent returns a stable error suitable for startup gates.
Types ¶
type ConfigRevision ¶
type LogOutput ¶
type LogOutput struct {
Target string `json:"target"`
Format string `json:"format"`
Fields []string `json:"fields"`
LogText string `json:"logtext"`
File string `json:"file"`
}
LogOutput configures one application log destination. External targets name a registered RecordHandler.
type RegistryConfig ¶
type RegistryConfig struct {
Name string `json:"name" bson:"name"`
Type string `json:"type" bson:"type"`
Prefix string `json:"prefix" bson:"prefix"`
Namespace string `json:"namespace" bson:"namespace"`
Group string `json:"group" bson:"group"`
ClusterName string `json:"clusterName" bson:"clusterName"`
}
RegistryConfig describes one named registry instance. Prefix identifies the component configuration (for example nacos-public-test.yml).
type RevisionStore ¶
type RevisionStore struct {
// contains filtered or unexported fields
}
RevisionStore is a bounded, concurrency-safe audit and rollback history.
func NewRevisionStore ¶
func NewRevisionStore(limit int) *RevisionStore
func (*RevisionStore) Get ¶
func (s *RevisionStore) Get(version uint64) (ConfigRevision, bool)
func (*RevisionStore) List ¶
func (s *RevisionStore) List() []ConfigRevision
func (*RevisionStore) Record ¶
func (s *RevisionStore) Record(snapshot []byte, actor string) ConfigRevision
type Snapshot ¶
type Snapshot struct {
Cnf *koanf.Koanf
WorkDir string
App app
Config appConfig
Log appLog
Logger appLogger
Discovery discovery
Jwt jwtConfig
Sys sys
Casbin casbin
}
Snapshot is an immutable point-in-time copy of the published configuration. It excludes the mutex so it can be returned and read without copying a lock. Nested field types stay unexported on purpose: callers only need to read their exported fields, and must not be able to mutate a published snapshot.
func Current ¶
func Current() Snapshot
Current returns a snapshot that is safe to read while a reload publishes a new configuration. Production code must use this instead of reading the exported fields of Config directly.
func (Snapshot) GetConfigData ¶
func (Snapshot) GetConfigString ¶
GetConfigString/Exists read from the snapshot's own koanf instance so a multi-key operation can use one coherent view of the configuration.
func (Snapshot) GetConfigUrl ¶
type ValidationError ¶
type ValidationError struct{ Key, Message string }
ValidationError describes a rejected configuration key.
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type VictoriaLogsConfig ¶
type VictoriaLogsConfig struct {
URL string `json:"url"`
APIToken string `json:"api_token" koanf:"api_token"`
HTTPUser string `json:"http_user" koanf:"http_user"`
HTTPPass string `json:"http_pass" koanf:"http_pass"`
APICert string `json:"api_crt" koanf:"api_crt"`
InsecureSkipVerify bool `json:"insecure_skip_verify" koanf:"insecure_skip_verify"`
Request bool `json:"request"`
Client bool `json:"client"`
Timeout int `json:"timeout"`
}
VictoriaLogsConfig configures the built-in HTTPS collector.