24 lines
415 B
Go
24 lines
415 B
Go
|
package handler
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
"os"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func Exit(_ http.ResponseWriter, _ *http.Request) {
|
||
|
os.Exit(0)
|
||
|
}
|
||
|
|
||
|
func CreateVersionHandler() func(w http.ResponseWriter, r *http.Request) {
|
||
|
startTime := time.Now().Unix()
|
||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||
|
fmt.Fprintf(w, "%d\n", startTime)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func IsLoggedIn(w http.ResponseWriter, _ *http.Request) {
|
||
|
fmt.Fprintf(w, "ok")
|
||
|
}
|