Enhance Dockerfile to build and include a new HTTP API service (mtproxy_checkerd) alongside the existing CLI tool (mtproxy_checker). Update README and documentation to reflect the new service and its usage, including environment variables and Docker run instructions.
Publish mtproxy_checker Docker image / test (push) Successful in 11s
Publish mtproxy_checker Docker image / build-and-push (push) Successful in 56s

This commit is contained in:
Denozordec
2026-04-11 00:50:57 +07:00
parent 4905c06b9b
commit 5a66f0f2e8
8 changed files with 482 additions and 6 deletions
+22
View File
@@ -0,0 +1,22 @@
package checkresult
import (
"context"
"errors"
"mtproxy_checker/internal/checker"
)
// Classify maps a checker error to CLI-style exit codes: 0 OK, 1 generic, 3 proxy closed, 4 timeout.
func Classify(err error) (exitCode int, message string) {
if err == nil {
return 0, ""
}
if errors.Is(err, checker.ErrProxyClosed) {
return 3, err.Error()
}
if errors.Is(err, context.DeadlineExceeded) {
return 4, "timeout"
}
return 1, err.Error()
}