Commits
- Commit:
001c466e0421fdbaa864cc31ba288f60dc37068a
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Store notes and notes_url object attributes
Used to document, explain stuff. Useful!
- Commit:
f21c51c745099616c3451e39569df1b46feae6af
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Support icinga 2.12 acknowledgement, state, statetype field
On Debian 11 these fields are floats, not ints (or boolean) for some
reason. This patch allows unmarshalling either floats or integers
depending on what the icinga API sends us.
- 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:
8f08828e8134e1160b4be74544d3b6020059366e
- From:
- Oliver Lowe <o@olowe.co>
- Date:
store a service's last check result
- 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:
dca9442c1f7da187028aaaf66f2ebf7c34d6a863
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Catch all HostStates and ServiceStates
This is closer to the Icinga spec, anything greater than 2 or 3 is unknown.
- 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:
f5fde32e94d77a44e85a28f9263531b34fdf7c8b
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Handle last check result of services
Includes a test to know that we're handling the JSON properly.
- Commit:
b06b25c58a0ebeaf58a44f28f1422b842144e507
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Remove unused attrs() method
It was required to satisfty the object interface but the interface
changed because it wasn't used anywhere.
- Commit:
26fb88e9ebc4192da36411de66032158b424369d
- From:
- Oliver Lowe <o@olowe.co>
- Date:
Generate CRUD code using go generate
Explanation for use is in the README
- 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!