fa1k3n / resolvconf Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
it is possible to do
resolvconf.Add(ns1, ns2, opt1 et.c.)
to add items, but to remove them you need to call
resolvconf.Remove(ns1)
resolvconf.Remove(ns2)
resolvconf.Remove(opt1)
it should be possible to remove using
resolvconf.Remove(ns1, ns2, opt1)
NewSortlistPair(ip).SetNetmask(...)
Instead of NewOption(type string, ...interface{}) it should be NewOption(type string) and a method Set(val int) that sets value, Get that returns, then you can do
NewOption(“ndots”).Set(4)
and
conf.Find(NewOption(“ndots”)).Get()
When creating an item today you get the items and an possible error back, then you can use the item to add to the conf
opt, err := resolvconf.NewOption("debug")
err = conf.Add(opt)
this prevents us from adding options at the same time as they are created and sortof uglifies the interface. I would prefer to be able to do
err := conf.Add(resolvconf.NewOption("debug"))
currently a netmask is needed, make this optional
instead of
ns := resolvconf.NewNameserver(net.ParseIP("8.8.8.8'"))
it should be
ns := resolvconf.Nameserver(net.ParseIP("8.8.8.8'"))
this is valid for all Items e.g NewOption == Option
It should be possible to have the library log all updates it does, e.g. removing nameservers, adding options et.c.
Eg number of nameservers
when using you need to do several derefs
item := resolvconf.Find(resolvconf.NewOption("debug"))
opt := (*item).(*resolvconf.Option)
would be cleaner to have
item := resolvconf.Find(resolvconf.NewOption("debug"))
opt := item.(resolvconf.Option)
i.e. have Find return ConfItem instead of *ConfItem
e.g if adding ndots option multiple times then each time added the value should be updated. As it is now it will generate an error
other such items is eg sortlist netmask
When adding multiple items and there is an error in one of the items then none of the items following the faulty item will be added.
This code
err := conf.Add(ns1, ns2, <faulty item>, opt1)
will only add ns1 and ns2 to the conf
I would prefer to have the error accumulate and returned after all items have been handeld, so that ns1 & 2 and opt1 are added above. Then the error returned must be the accumulated error from all the faulty items
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.