omeid / uconfig Goto Github PK
View Code? Open in Web Editor NEWLightweight, zero-dependency, and extendable configuration management library for Go
License: MIT License
Lightweight, zero-dependency, and extendable configuration management library for Go
License: MIT License
type Config struct {
Ports []string `default:""`
}
I need to set up a list of strings as default value for "Ports". How can I do this?
Thanks
I would like a plugin that makes sure that fields with a required
tag are present.
My golang project fails to build as a result of an unknown revision of uconfig.
I have this in my go.mod require list: github.com/omeid/uconfig v1.2.0
Here are my terminal commands and output:
I'm using golang version 1.19.4 darwin/amd64
I see here https://pkg.go.dev/github.com/omeid/uconfig/plugins that you have the module registered under the version v1.2.0, but your tags in the repo do not match:
I think this is the source of the problem.
As a workaround, I've forked the repo and replaced the path with my forked repo like so: replace github.com/omeid/uconfig => github.com/Lumerin-protocol/uconfig v0.0.5
My team isn't happy with the workaround, so I'm just wondering if you could add a matching tag for v1.2.0. I think that would solve the problem. or register the package under v0.0.4, and please create a matching tag.
Can we not expose the FIELD
column in the help document? Although the below looks good I don't think its a good idea to reveal how the conf is mapped to an internal data structure. I don't see any configuration library doing that however will leave it to the maintainer
Supported Fields:
FIELD FLAG ENV DEFAULT USAGE
----- ----- ----- ------- -----
Hosts -hosts HOSTS localhost,localhost.local the ip or domains to bind to
Redis.Address -redis-address REDIS_ADDRESS redis-master
Redis.Port -redis-port REDIS_PORT 6379
Redis.Password -redis-password REDIS_PASSWORD
Redis.DB -redis-db REDIS_DB 0
Redis.Expire -redis-expire REDIS_EXPIRE 5s
Database.Address -database-address DATABASE_ADDRESS localhost
Database.Port -database-port DATABASE_PORT 28015
Database.Database -database-database DATABASE_DATABASE my-project
While there is some tests for uconfig, the overall test coverage could be improved.
How to add description for each field in the usage section?
I know this is quite a new project, but could you please add tags/releases (using semantic versioning) so that uconfig can be used via Glide without having to pin to specific commits?
Hello,
It seems that using uconfig causes go mod tidy
to fetch v1.2.0 by default. At the very least, on go1.21.5 linux/amd64
.
user@hostname > /tmp/foo > vim main.go # here just copy/paste the first full example from the README and remove redis/database references
user@hostname > /tmp/foo > go mod init foo
go: creating new go.mod: module foo
go: to add module requirements and sums:
go mod tidy
user@hostname > /tmp/foo > go mod tidy
go: finding module for package github.com/omeid/uconfig
go: found github.com/omeid/uconfig in github.com/omeid/uconfig v1.2.0
user@hostname > /tmp/foo > go version
go version go1.21.5 linux/amd64
This causes the version of uconfig
to be somewhat outdated. I noticed this because the USAGE column was nowhere to be found upon calling .Usage()
and decided to investigate a bit. Editing the go.mod
to point towards 0.5 instead naturally works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.