neko/internal/api/member/handler.go
2020-10-31 10:48:24 +01:00

42 lines
632 B
Go

package member
import (
"github.com/go-chi/chi"
"demodesk/neko/internal/types"
)
type MemberHandler struct {
sessions types.SessionManager
websocket types.WebSocketHandler
}
func New(
sessions types.SessionManager,
websocket types.WebSocketHandler,
) *MemberHandler {
// Init
return &MemberHandler{
sessions: sessions,
websocket: websocket,
}
}
func (h *MemberHandler) Router(
usersOnly func(chi.Router, func(chi.Router)),
adminsOnly func(chi.Router, func(chi.Router)),
) *chi.Mux {
r := chi.NewRouter()
usersOnly(r, func(r chi.Router) {
})
adminsOnly(r, func(r chi.Router) {
})
return r
}