wrfly / ecp Goto Github PK
View Code? Open in Web Editor NEWenvironment config parser | fill up the struct through the way you like
License: Apache License 2.0
environment config parser | fill up the struct through the way you like
License: Apache License 2.0
Line 45 in 1a4c76c
should check whether the commas follows a backslash
Line 29 in 24d089d
split by a commas
strings.Contains
go-yaml/yaml#409convert mysql select to struct, es result to struct
If you set the default
tag to some field and the value in the config file is the zero value of that type,
you will get the default value you pointed when you get that field.
This is not right when you use ecp.Get()
to parse a config file when the key is the zero value.
Config parse will get an empty value, while the config set will set a zero value.
How to distinguish them?
#, |, _, ::
if !field.IsNil(){
continue
}
Do not just set to default, check its value first.
Since you delete the old function Default
without a new version v2
, some of our components got errors because it thinks the latest version should have Default
func.
78d8753#diff-dab1fc1f992d61bda5318058e8b8a7aad92caaebf219c1d3d489487b20dce4aaL125
For example:
repo@version/file.go:XX:Y: undefined: ecp.Default
Suggestions:
Default
func back with deprecated
message.v1
.Get a field in a config structureecp.Get(config interface{}, key stirng) interface{}
ecp.GetBool(config interface{}, key stirng) bool
ecp.Get...(config interface{}, key stirng) ...
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.