Documentation
¶
Index ¶
- Constants
- func EnsurePortIsFree(port int, log logger.Logger)
- func GracefulShutdown(server *http.Server, pidFile string, log logger.Logger)
- func IsPortBusy(port int) (bool, int, error)
- func LogFileName(prefix string) string
- func ReadPID(pidFile string) (int, error)
- func RemovePID(pidFile string) error
- func SendSIGTERM(pid int) error
- func SetSecurityLayer(layer security.SecurityLayer)
- func ShutdownServer(configPath string, log logger.Logger) error
- func WaitForPortFreed(port int, log logger.Logger)
- func WritePID(pidFile string) error
- type Config
Constants ¶
View Source
const DefaultPort = 2026
Variables ¶
This section is empty.
Functions ¶
func EnsurePortIsFree ¶
EnsurePortIsFree prüft, ob der Port frei ist. Falls nicht, wird der Prozess per Port-Suche gekillt und gewartet, bis der Port frei ist.
func GracefulShutdown ¶
GracefulShutdown wartet immer selbst auf SIGTERM/SIGINT und loggt das Signal.
func IsPortBusy ¶
IsPortBusy prüft, ob der Port bereits belegt ist. Gibt ggf. die PID des Prozesses zurück (immer 0, da Go das nicht nativ unterstützt).
func LogFileName ¶
LogFileName returns a log file name based on the current datetime (YYYYMMDD_HHMMSS.log)
func SendSIGTERM ¶
func SetSecurityLayer ¶ added in v0.1.4
func SetSecurityLayer(layer security.SecurityLayer)
Add a setter for the security layer
func WaitForPortFreed ¶
WaitForPortFreed wartet, bis der Port nicht mehr belegt ist (Timeout: 10s)
Types ¶
Click to show internal directories.
Click to hide internal directories.