Commits
- 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:
e4ad50b973973310a1823f00ea975697e93e3182
- From:
- Oliver Lowe <o@olowe.co>
- Date:
panic on unlikely test case
We're just in test mode, so it's ok to panic if we reach this highly unlikely
scenario when, for example, the testdata file changes or something.
- 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:
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.