Commits
- Commit:
cb667a50cb18cc38d49e520642743de727bed3ca
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Store last Host check result and time
Includes tests and simplified unmarshal test.
- 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:
717a9e7823638c994c6620883fcee2ef98da294b
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Keep test data in version control
While here also don't log messages in testing unless there's an error.
- Commit:
46ca0f68f521c66d60a5d6646a0a15350533c9b8
- From:
- Oliver Lowe <o@olowe.co>
- Date:
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!
- Commit:
562d5c1eb8a76a65d49d14b36edefb846f747494
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Store acknowledgement status of hosts, services
- Commit:
dd0af5f789c1bac0444c33fcc4434922be48d1e7
- From:
- Oliver Lowe <o@olowe.co>
- Date:
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.