Commit Briefs

65a6eeea79 Oliver Lowe

Update to working godoc host (master)


bd9616a8e4 Oliver Lowe

Always return a usable Client (tags/v0.1.0)

Just because we have an error connecting to the server doesn't mean the client's configuration is invalid. Callers can inspect the error we return and decide what to do with the returned client.


2f7e40d9e9 Oliver Lowe

Correctly return scan errors


d65c457cdb Oliver Lowe

Trim const type prefix

Not needed and easier to read when exposed in UI.


6c821dbc08 Oliver Lowe

cmd/checkweb: start experimental basic web app for icinga2

No relational databases or server-side dependencies required. Requires docs!


410b374583 Oliver Lowe

Handle looking up objects with slashes in name


001c466e04 Oliver Lowe

Store notes and notes_url object attributes

Used to document, explain stuff. Useful!


34e5974278 Oliver Lowe

delete experimental object watcher


8b3445266f Oliver Lowe

delete experimental object watcher


9016a0fbf4 Oliver Lowe

initial event stream implementation

Documentation too. It's not quite clear enough that callers need to handle resubscribing on any errors reading the stream. It's documented for Subscribe but example usage would be good too.


43c71de36c Oliver Lowe

wip


f21c51c745 Oliver Lowe

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.


fb8a219e2a Oliver Lowe

link to the new general mailing list

because there's so many subscribers... lol


cb667a50cb Oliver Lowe

Store last Host check result and time

Includes tests and simplified unmarshal test.


a17d3f9dc6 Oliver Lowe

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.


8f08828e81 Oliver Lowe

store a service's last check result


f4705a6414 Oliver Lowe

icinga_test: Don't assign group for random hosts

We can test hostgroup assignment in other tests if desired.


62bf235cf0 Oliver Lowe

icinga_test: Inline permissions response

No need for a file on disk; it's only referenced once.


87154adc3f Oliver Lowe

Run a full test on builds.sr.ht for every commit

On OpenBSD. Why not?


b717ce9bd5 Oliver Lowe

Test against a fake in-processs icinga server

A lot of the testing doesn't really flex what a real icinga2 server does. We can implement a simple fake server with about 250 lines of Go, then we get all the benefits of really quick feedback and no dependency on an icinga2 server (which isn't super easy to set up) for most tests. More complicated tests are still performed against a real server listening on loopback (if available).


49e200e1bf Oliver Lowe

Remove unnecessary parseAPIResponse function

All this did was wrap the usual standard library JSON decode procedure.


9feb16b367 Oliver Lowe

Remove useless loop

We always returned something on the first iteration, so just remove it.


e4ad50b973 Oliver Lowe

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.


c26e0f9dab Oliver Lowe

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.


717a9e7823 Oliver Lowe

Keep test data in version control

While here also don't log messages in testing unless there's an error.