mirror of
https://github.com/taigrr/jety.git
synced 2026-04-02 03:19:03 -07:00
update to fixup some race conditions
This commit is contained in:
31
doc.go
Normal file
31
doc.go
Normal file
@@ -0,0 +1,31 @@
|
||||
// Package jety provides configuration management supporting JSON, ENV, TOML, and YAML formats.
|
||||
//
|
||||
// It offers viper-like AutomaticEnv functionality with minimal dependencies, allowing
|
||||
// configuration to be loaded from files and environment variables with automatic merging.
|
||||
//
|
||||
// Configuration sources are layered with the following precedence (highest to lowest):
|
||||
// - Values set via Set() or SetString()/SetBool()
|
||||
// - Environment variables (optionally filtered by prefix)
|
||||
// - Values from config file via ReadInConfig()
|
||||
// - Default values set via SetDefault()
|
||||
//
|
||||
// Basic usage:
|
||||
//
|
||||
// jety.SetConfigFile("/etc/myapp/config.yaml")
|
||||
// jety.SetConfigType("yaml")
|
||||
// jety.SetEnvPrefix("MYAPP_")
|
||||
// jety.SetDefault("port", 8080)
|
||||
//
|
||||
// if err := jety.ReadInConfig(); err != nil {
|
||||
// log.Fatal(err)
|
||||
// }
|
||||
//
|
||||
// port := jety.GetInt("port")
|
||||
//
|
||||
// For multiple independent configurations, create separate ConfigManager instances:
|
||||
//
|
||||
// cm := jety.NewConfigManager()
|
||||
// cm.SetConfigFile("/etc/myapp/config.toml")
|
||||
// cm.SetConfigType("toml")
|
||||
// cm.ReadInConfig()
|
||||
package jety
|
||||
Reference in New Issue
Block a user