Commits


Use default MarshalJSON method There's no point doing so much manual work and testing just to keep fields under a "attrs" key when marshalling to JSON. When creating the object we can just: 1. Marshal the object to JSON 2. Put it all under a "attrs" key. Now it's easier to imagine the mapping of the structs to JSON, since they follow the same rules as everything else in Go.


Marshal using struct tags rather than a custom map I was excluding some struct fields so I thought I'd need to do some custom marshalling . But you don't need to do this as you can use struct tags to optionally exclude things from being put into JSON. Now there's no longer duplicate code between struct tags and keys in a map when marshalling. Handy!


Delete unused testUser var This was used in some old tests but is now unused.


Remove unused attrs() method It was required to satisfty the object interface but the interface changed because it wasn't used anywhere.


Generate CRUD code using go generate Explanation for use is in the README


Merge filter and all objects methods Getting all objects is the same as getting objects with a zero filter.


I learned how to do some generic programming New type "object" is an interface to represent an Icinga2 object. I added heaps of other stuff! On our way to 1000 lines of code!


Use slightly clearer param name


more docs


dump