Commit Briefs
Actually return permissions grante to the client
Before we were just returning an empty response or something non-meaningful
Always format generated code
While here document what is needed to actually run go generate.
Handle last check result of services
Includes a test to know that we're handling the JSON properly.
Implement checker interface for HostGroup
This also adds a test for checking all hosts in a HostGroup.
Correctly marshal Hosts into JSON
We were missing some attributes, like not adding any groups or display names. This also adds a test which checks whether we are marshalling hosts into JSON correctly.
Add checking of services and hosts
And also add a icinga_test package that does the black-box tests i.e. tests which speak to a real icinga server.
Set accurate crud.go header comment
getopt(1) clears the value of "$@", so grab it before it's cleared
deduplicate new test client code
This adds a newTestClient option so that we aren't constantly creating new http transports clients and all that
Support Icinga2 hostgroups
Tests of hostgroup operations are done in TestFilter
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 Hosts and FilterHosts
Getting all Hosts is the same as calling FilterHosts with an empty filter anyway.
Merge get and getFilter methods
Doing a GET without a query is the same as doing a GET with an empty query, so there's no point having 2 separate methods.
Merge filter and all objects methods
Getting all objects is the same as getting objects with a zero filter.
Deduplicate case conditions
Encoding a Host, Service and User as JSON is the same so there's no point having different statements.
