Commits
- Commit:
cb667a50cb18cc38d49e520642743de727bed3ca
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Store last Host check result and time
Includes tests and simplified unmarshal test.
- Commit:
a17d3f9dc6856d0cb60bf176e66844dc2752782d
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Simplify service JSON marshalling
We don't need to have a MarshalJSON method just so that it can be
created ok. It's clearer to do stuff necessart for object creation at
the time of object creation, not way earlier in some unrelated bit of
the code.
While here simplify the tests to actually test what we're worried about.
- Commit:
c26e0f9dab045063f9fb15a64233322532b18dcb
- From:
- Oliver Lowe <o@olowe.co>
- Date:
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.
- Commit:
46fe962a8b8f10d81d0281a5097886b71c99afda
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Revert "Create a new client interface"
This reverts commit bd3b8a33c54037e66233db80fd1120eb0b6215f1.
It's a bad idea. I'm writing a fake server instead so that we can use
the real client code.
- Commit:
bd3b8a33c54037e66233db80fd1120eb0b6215f1
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Create a new client interface
So that testing the client doesn't involve making real HTTP requests.
- Commit:
64e18a8d1ef9f178f91aed840a371f3785c4d188
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Correctly return ErrNoMatch
The check was incorrect before. The HTTP status on responses is still
200 OK, but with empty results if there are no matches to the filter.
- Commit:
02a1a10065dd3be4f89f30756adc670b1a8ab468
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Support cascading delete of objects
- Commit:
e0c24850440b8bcaa5bf6a49c0dd493fb30e94fb
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Support Icinga2 hostgroups
Tests of hostgroup operations are done in TestFilter
- Commit:
6c70362050af3bf13a06cde4ed47aa49064b1813
- From:
- Oliver Lowe <o@olowe.co>
- Date:
doc: correct doc comment about type
- Commit:
26fb88e9ebc4192da36411de66032158b424369d
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Generate CRUD code using go generate
Explanation for use is in the README
- Commit:
82fc97ff8eb537c28bce19af5ffb697773bd200c
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Merge Hosts and FilterHosts
Getting all Hosts is the same as calling FilterHosts with an empty
filter anyway.
- Commit:
6d1ce85e966615f3886d8a2431b3e859d3008db6
- From:
- Oliver Lowe <o@olowe.co>
- Date:
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.
- Commit:
60c115fb1c7683cea9553380eddaeb0033dd17bf
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Merge filter and all objects methods
Getting all objects is the same as getting objects with a zero filter.
- Commit:
fc8956331f70b23ffe89c8307de77bbc0ecccb39
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Deduplicate case conditions
Encoding a Host, Service and User as JSON is the same so
there's no point having different statements.
- Commit:
76669f9b1f06b7299f2261667b4b21db38db7cae
- From:
- Oliver Lowe <o@olowe.co>
- Date:
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!