dominikh / go-augeas Goto Github PK
View Code? Open in Web Editor NEWGo bindings for augeas
License: MIT License
Go bindings for augeas
License: MIT License
A pure-golang implementation of this would be better, more portable, and also allow for building with: CGO_ENABLED=0
.
This would allow for easier reproducible builds for example, as explained here: https://go.dev/blog/rebuild
Would someone like to port this to remove the "C" implementation?
I'm considering (but have not yet decided) to drop "C" stuff in mgmt. https://github.com/purpleidea/mgmt/ if I decide to do so, and this isn't ported, then I would have to either drop the augeas
resource entirely or at least from the default builds.
Thank you!
Does it possible to link with static augeas library and enable cros-compile (i'm using go 1.5.1)
I'm getting:
prog.go:4: can't find import: "honnef.co/go/augeas"
[process exited with non-zero status]
in roidelapluie/go-augtest@dca84f5
the file /tmp/foo/bar does not exist, is not created, but still augeas.Save() does not return an error.
I don't know how easy it would be, but it would be pretty cool to have something along the lines of:
type Fstab struct {
File string `augeas:"file"`
Vfstype string `augeas:"vfstype"`
Opt map[string]string `augeas:"opt" augeas-type:"array"`
Dump bool `augeas:"dump"`
Passno bool `augeas:"passno"`
} `augeas:"/files/etc/fstab" augeas-type:"seq"`
The lib would then provide a Parse
method to fill the structure from Augeas info, and a Write
method to write back to Augeas and save.
The following Augeas functions aren't currently implemented and should probably be added:
Looking for volunteers to contribute those functions.
aug, _ := augeas.New("/", "", augeas.None)
v, _ := aug.Get("/augeas/save")
log.Println(v)
prints backup
. Using augeas.Backup
prints newfile
, etc.
If the value is empty or null, go-augeas doesn't works.
But if I used augtool command, I can setting an empty value
such as
augtool> ls /files/etc/php.ini/Tidy/tidy.clean_output
augtool> print /files/etc/php.ini/Tidy/tidy.clean_output
/files/etc/php.ini/Tidy/tidy.clean_output = "Off"
augtool> set /files/etc/php.ini/Tidy/tidy.clean_output
augtool> save
Saved 1 file(s)
augtool> print /files/etc/php.ini/Tidy/tidy.clean_output
/files/etc/php.ini/Tidy/tidy.clean_output
setting an empty value for tidy.clean_output
But if I used Set(path, value string)
this method , it doesn't works
How can I setting an empty value with this method ?
func (a Augeas) Set(path, value string) error {
…
}
Thanks for your help!
Hey @raphink want to update https://launchpad.net/~raphink/+archive/ubuntu/augeas with a 1.7 build so travis can build the latest versions of this lib with 1.7 inside?
Cheers!
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.