Files
portainer/api/http/handler/motd/handler.go
T
2026-03-26 15:01:48 +02:00

28 lines
610 B
Go

package motd
import (
"net/http"
"github.com/gorilla/mux"
"github.com/portainer/portainer/api/http/security"
motdservice "github.com/portainer/portainer/api/motd"
)
// Handler is the HTTP handler used to handle MOTD operations.
type Handler struct {
*mux.Router
motdService *motdservice.Service
}
// NewHandler returns a new Handler
func NewHandler(bouncer security.BouncerService, svc *motdservice.Service) *Handler {
h := &Handler{
Router: mux.NewRouter(),
motdService: svc,
}
h.Handle("/motd",
bouncer.RestrictedAccess(http.HandlerFunc(h.motd))).Methods(http.MethodGet)
return h
}