Compare commits
2 commits
226bdad4f6
...
be7ccf28e3
| Author | SHA1 | Date | |
|---|---|---|---|
| be7ccf28e3 | |||
| 376b33b013 |
4 changed files with 31 additions and 29 deletions
|
|
@ -12,4 +12,6 @@ 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"]
|
||||
|
|
|
|||
56
README.md
56
README.md
|
|
@ -43,34 +43,6 @@ 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.
|
||||
|
|
@ -94,6 +66,34 @@ 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
2
go.mod
|
|
@ -2,4 +2,4 @@ module git.happydns.org/checker-dummy
|
|||
|
||||
go 1.25.0
|
||||
|
||||
require git.happydns.org/checker-sdk-go v1.3.0
|
||||
require git.happydns.org/checker-sdk-go v1.5.0
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -1,2 +1,2 @@
|
|||
git.happydns.org/checker-sdk-go v1.3.0 h1:FG2kIhlJCzI0m35EhxSgn4UWc9M4ha6aZTeoChu4l7A=
|
||||
git.happydns.org/checker-sdk-go v1.3.0/go.mod h1:aNAcfYFfbhvH9kJhE0Njp5GX0dQbxdRB0rJ0KvSC5nI=
|
||||
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=
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue