mirror of
https://github.com/emo2007/block-accounting.git
synced 2024-11-13 22:06:27 +00:00
27 lines
431 B
Go
27 lines
431 B
Go
package controllers
|
|
|
|
import (
|
|
"log/slog"
|
|
"net/http"
|
|
)
|
|
|
|
type PingController interface {
|
|
Ping(w http.ResponseWriter, req *http.Request) ([]byte, error)
|
|
}
|
|
|
|
type pingController struct {
|
|
log *slog.Logger
|
|
}
|
|
|
|
func NewPingController(
|
|
log *slog.Logger,
|
|
) PingController {
|
|
return &pingController{
|
|
log: log,
|
|
}
|
|
}
|
|
|
|
func (c *pingController) Ping(w http.ResponseWriter, req *http.Request) ([]byte, error) {
|
|
return []byte("pong"), nil
|
|
}
|