Compare commits

..

No commits in common. "be7ccf28e3fa293c1d97498256d5163cc428e82c" and "226bdad4f66e3ed560b0594a1df2ced33b4de174" have entirely different histories.

4 changed files with 29 additions and 31 deletions

View file

@ -12,6 +12,4 @@ FROM scratch
COPY --from=builder /checker-dummy /checker-dummy
USER 65534:65534
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD ["/checker-dummy", "-healthcheck"]
ENTRYPOINT ["/checker-dummy"]

View file

@ -43,6 +43,34 @@ Every checker does three things:
A checker can run in three modes:
### Standalone HTTP Server (External Checker)
The checker runs as its own process and exposes an HTTP API. happyDomain communicates with it over the network. This is the most flexible option: you can write your checker in any language, deploy it independently, and scale it separately.
```
┌─────────────┐ HTTP ┌─────────────────┐
│ happyDomain │ ──────────► │ checker-dummy │
│ server │ ◄────────── │ (this program) │
└─────────────┘ └─────────────────┘
```
### In-Process Plugin
The checker is compiled as a Go plugin (`.so` file) and loaded directly into the happyDomain process. This is simpler to deploy (single binary) but requires the checker to be written in Go.
```
┌──────────────────────────────────────┐
│ happyDomain server │
│ │
│ ┌──────────────────────────────┐ │
│ │ checker-dummy.so (plugin) │ │
│ │ checker-ping.so (plugin) │ │
│ │ checker-matrix.so (plugin) │ │
│ │ checker-....so (plugin) │ │
│ └──────────────────────────────┘ │
└──────────────────────────────────────┘
```
### Built-in Checker
The checker package can be imported directly into the happyDomain server and registered at init time: no plugin loading, no separate process. This avoids the operational burden of Go's plugin system (matching toolchain versions, CGO, `.so` distribution) entirely.
@ -66,34 +94,6 @@ This mode is reserved for checkers maintained as part of the happyDomain project
**Both standalone, plugin and built-in modes use the same checker code; only the entry point differs.**
### In-Process Plugin
The checker is compiled as a Go plugin (`.so` file) and loaded directly into the happyDomain process. This is simpler to deploy (single binary) but requires the checker to be written in Go.
```
┌──────────────────────────────────────┐
│ happyDomain server │
│ │
│ ┌──────────────────────────────┐ │
│ │ checker-dummy.so (plugin) │ │
│ │ checker-ping.so (plugin) │ │
│ │ checker-matrix.so (plugin) │ │
│ │ checker-....so (plugin) │ │
│ └──────────────────────────────┘ │
└──────────────────────────────────────┘
```
### Standalone HTTP Server (External Checker)
The checker runs as its own process and exposes an HTTP API. happyDomain communicates with it over the network. This is the most flexible option: you can write your checker in any language, deploy it independently, and scale it separately.
```
┌─────────────┐ HTTP ┌─────────────────┐
│ happyDomain │ ──────────► │ checker-dummy │
│ server │ ◄────────── │ (this program) │
└─────────────┘ └─────────────────┘
```
## Repository Structure

2
go.mod
View file

@ -2,4 +2,4 @@ module git.happydns.org/checker-dummy
go 1.25.0
require git.happydns.org/checker-sdk-go v1.5.0
require git.happydns.org/checker-sdk-go v1.3.0

4
go.sum
View file

@ -1,2 +1,2 @@
git.happydns.org/checker-sdk-go v1.5.0 h1:5uD5Cm6xJ+lwnhbJ09iCXGHbYS9zRh+Yh0NeBHkAPBY=
git.happydns.org/checker-sdk-go v1.5.0/go.mod h1:aNAcfYFfbhvH9kJhE0Njp5GX0dQbxdRB0rJ0KvSC5nI=
git.happydns.org/checker-sdk-go v1.3.0 h1:FG2kIhlJCzI0m35EhxSgn4UWc9M4ha6aZTeoChu4l7A=
git.happydns.org/checker-sdk-go v1.3.0/go.mod h1:aNAcfYFfbhvH9kJhE0Njp5GX0dQbxdRB0rJ0KvSC5nI=