Giter Site home page Giter Site logo

go-augeas's People

Contributors

dominikh avatar raphink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

go-augeas's Issues

Port to pure golang implementation and remove "C"

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!

[idea] provide a reflection interface

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.

Missing functions

The following Augeas functions aren't currently implemented and should probably be added:

  • aug_label
  • aug_cp
  • aug_rename
  • aug_text_store
  • aug_text_retrieve
  • aug_escape_name
  • aug_transform
  • aug_srun

Looking for volunteers to contribute those functions.

Flags are wrong

    aug, _ := augeas.New("/", "", augeas.None)
    v, _ := aug.Get("/augeas/save")
    log.Println(v)

prints backup. Using augeas.Backup prints newfile, etc.

func (a Augeas) Set(path, value string) setting empty Value failure

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.