admin

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: AGPL-3.0, AGPL-3.0-or-later Imports: 12 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-License-Identifier: AGPL-3.0-or-later

SPDX-License-Identifier: AGPL-3.0-or-later

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAdminUser

func IsAdminUser(user *models.User, adminEmails []string) bool

func RegisterAdminRoutes

func RegisterAdminRoutes(cfg *config.Config, templates *template.Template, db *sql.DB, authService userService) func(r *chi.Mux)

RegisterAdminRoutes returns a function that registers admin routes

Types

type Handlers

type Handlers struct {
	// contains filtered or unexported fields
}

func NewAdminHandlers

func NewAdminHandlers(
	adminRepo *database.AdminRepository,
	userService userService,
	templates *template.Template,
	baseURL string,
) *Handlers

func (*Handlers) HandleChainIntegrityAPI

func (h *Handlers) HandleChainIntegrityAPI(w http.ResponseWriter, r *http.Request)

func (*Handlers) HandleDashboard

func (h *Handlers) HandleDashboard(w http.ResponseWriter, r *http.Request)

func (*Handlers) HandleDocumentDetails

func (h *Handlers) HandleDocumentDetails(w http.ResponseWriter, r *http.Request)

type Middleware

type Middleware struct {
	// contains filtered or unexported fields
}

func NewAdminMiddleware

func NewAdminMiddleware(userService userService, baseURL string, adminEmails []string, templates *template.Template) *Middleware

func (*Middleware) RequireAdmin

func (m *Middleware) RequireAdmin(next http.HandlerFunc) http.HandlerFunc

Jump to

Keyboard shortcuts

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