dominikh / go-augeas

Go bindings for augeas
MIT License
21 stars 7 forks source link

[idea] provide a reflection interface #4

Closed raphink closed 8 years ago

raphink commented 8 years ago

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.

raphink commented 8 years ago

I started implementing that here: https://github.com/raphink/narcissus

dominikh commented 8 years ago

That's a feature that should exist in a third party package (such as your narcissus). It's not something that I'd want to maintain in this package.

I will close this issue here.