From 0b91893d31915ba59a88b918d6c6dbc7f8546de3 Mon Sep 17 00:00:00 2001 From: Tai Groot Date: Wed, 1 Nov 2023 23:33:47 -0700 Subject: [PATCH] go mod init, add stubbed funcs --- README.md | 18 ++++++++++++++++++ env.go | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ go.mod | 3 +++ 3 files changed, 71 insertions(+) create mode 100644 env.go create mode 100644 go.mod diff --git a/README.md b/README.md index 418e1f5..ca45045 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,22 @@ JSON, ENV, YAML, TOML +This is a package for collapsing multiple configuration stores (env+json, env+yaml, env+toml) and writing them back to a centralized config. +It should behave similarly to the AutomaticEnv functionality of viper, but without some of the extra heft of the depedendencies it carries. + + +.AutomaticEnv +.ConfigFileUsed +.GetDuration +.GetString +.GetStringMap +.GetStringSlice +.ReadInConfig +.SetConfigFile +.SetConfigName +.SetConfigType +.SetDefault +.Set("privkey", string +viper.ConfigFileNotFoundError); ok { +.WriteConfig diff --git a/env.go b/env.go new file mode 100644 index 0000000..c7bac4b --- /dev/null +++ b/env.go @@ -0,0 +1,50 @@ +package config + +import "errors" + +type ConfigManager struct{} + +var ConfigFileNotFoundError = errors.New("config File Not Found") + +func NewConfigManager() *ConfigManager { + return &ConfigManager{} +} + +func AutoMaticEnv() { +} + +func ConfigFileUsed() { +} + +func GetDuration() { +} + +func GetString() { +} + +func GetStringMap() { +} + +func GetStringSlice() { +} + +func ReadInConfig() { +} + +func SetConfigFile() { +} + +func SetConfigName() { +} + +func SetConfigType() { +} + +func SetDefault() { +} + +func Set() { +} + +func WriteConfig() { +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..bbdaf4b --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/taigrr/jety + +go 1.21.3