
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
github.com/eraclitux/cfgp
|image0|_ |image1|_ |image2|_
.. |image0| image:: https://godoc.org/github.com/eraclitux/conf?status.svg .. _image0: https://godoc.org/github.com/eraclitux/conf
.. |image1| image:: https://travis-ci.org/eraclitux/conf.svg?branch=master .. _image1: https://travis-ci.org/eraclitux/conf
.. |image2| image:: https://goreportcard.com/badge/github.com/eraclitux/conf .. _image2: https://goreportcard.com/report/github.com/eraclitux/conf
.. contents::
A go package for configuration parsing. Automagically populates a configuration struct
using configuration files & command line arguments.
It aims to be modular and easily extendible to support other formats. Only INI format supported for now.
An example of utilization::
type myConf struct {
Address string
Port string
// A command line flag "-users", which expects an int value,
// will be created.
// Same key name will be searched in configuration file.
NumberOfUsers int `conf:"users,number of users,"`
Daemon bool
Message string
}
func Example() {
// To create a dafault value for a flag
// assign it when instantiate the conf struct.
c := myConf{Message: "A default value"}
conf.Path = "test_data/one.ini"
err := conf.Parse(&c)
if err != nil {
log.Fatal("Unable to parse configuration", err)
}
fmt.Println("address:", c.Address)
fmt.Println("port:", c.Port)
fmt.Println("number of users:", c.NumberOfUsers)
}
See the flag arguments that are automagically created::
go run main.go -h
See godocs <http://godoc.org/github.com/eraclitux/conf>
_ for examples and documentation.
Pull requests that add new tests, features or fixes are welcome, encouraged, and credited.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.