server

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandHandler

func CommandHandler(w http.ResponseWriter, r *http.Request)

Types

type Server

type Server struct {
	UserRepo     *db.UserRepo
	Templates    *template.Template
	SessionStore *sessions.CookieStore
}

func NewServer

func NewServer(userRepo *db.UserRepo) *Server

Constructor

func (*Server) CreateDocumentHandler

func (s *Server) CreateDocumentHandler(w http.ResponseWriter, r *http.Request)

Sample CreateDocumentHandler. It is not defined yet, but only to show the RBAC features

func (*Server) ExecuteTemplate

func (s *Server) ExecuteTemplate(w http.ResponseWriter, name string, data any) error

func (*Server) GetUserFromSession

func (s *Server) GetUserFromSession(r *http.Request) (*db.PdmUser, error)

func (*Server) HandleAdminDashboard

func (s *Server) HandleAdminDashboard(w http.ResponseWriter, r *http.Request)

func (*Server) HandleAdminEditUser

func (s *Server) HandleAdminEditUser(w http.ResponseWriter, r *http.Request)

func (*Server) HandleAdminNewUser

func (s *Server) HandleAdminNewUser(w http.ResponseWriter, r *http.Request)

func (*Server) HandleAdminResetPassword

func (s *Server) HandleAdminResetPassword(w http.ResponseWriter, r *http.Request)

Handler for resetting password

func (*Server) HandleAdminUsers

func (s *Server) HandleAdminUsers(w http.ResponseWriter, r *http.Request)

func (*Server) HandleChangePassword

func (s *Server) HandleChangePassword(w http.ResponseWriter, r *http.Request)

func (*Server) HandleDashboard

func (s *Server) HandleDashboard(w http.ResponseWriter, r *http.Request)

func (*Server) HandleHomePage

func (s *Server) HandleHomePage(w http.ResponseWriter, r *http.Request)

func (*Server) HandleLogin

func (s *Server) HandleLogin(w http.ResponseWriter, r *http.Request)

login handler

func (*Server) HandleLoginPage

func (s *Server) HandleLoginPage(w http.ResponseWriter, r *http.Request)

func (*Server) HandleLogout

func (s *Server) HandleLogout(w http.ResponseWriter, r *http.Request)

func (*Server) HandleProjectManagement

func (s *Server) HandleProjectManagement(w http.ResponseWriter, r *http.Request)

func (*Server) HandleShowLogFile

func (s *Server) HandleShowLogFile(w http.ResponseWriter, r *http.Request)

func (*Server) HandleShowLogs

func (s *Server) HandleShowLogs(w http.ResponseWriter, r *http.Request)

Handler update for colored log HTML + raw log output

func (*Server) HandleShowPhoto

func (s *Server) HandleShowPhoto(w http.ResponseWriter, r *http.Request)

func (*Server) HandleUploadPhoto

func (s *Server) HandleUploadPhoto(w http.ResponseWriter, r *http.Request)

func (*Server) Login

func (s *Server) Login(w http.ResponseWriter, r *http.Request)

func (*Server) RequireAdminChi

func (s *Server) RequireAdminChi(next http.Handler) http.Handler

func (*Server) RequireLoginChi

func (s *Server) RequireLoginChi(next http.Handler) http.Handler

func (*Server) RequireRoleChi

func (s *Server) RequireRoleChi(roles ...string) func(http.Handler) http.Handler

func (*Server) Routes

func (s *Server) Routes(mux *http.ServeMux)

func (*Server) ServeLoginPage

func (s *Server) ServeLoginPage(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL