dashboard

package
v2.6.4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Username string `json:"username"`
	Role     string `json:"role"`
	Exp      int64  `json:"exp"`
	Iat      int64  `json:"iat"`
}

type Dashboard

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

func New

func New(opts Options) (*Dashboard, error)

func (*Dashboard) AuthMiddleware

func (d *Dashboard) AuthMiddleware(next http.Handler) http.HandlerFunc

func (*Dashboard) HandleChangePassword

func (d *Dashboard) HandleChangePassword(w http.ResponseWriter, r *http.Request)

func (*Dashboard) HandleLogin

func (d *Dashboard) HandleLogin(w http.ResponseWriter, r *http.Request)

func (*Dashboard) HandleLogout

func (d *Dashboard) HandleLogout(w http.ResponseWriter, r *http.Request)

func (*Dashboard) Routes

func (d *Dashboard) Routes() http.Handler

type Options

type Options struct {
	AuthSecret string
	UsersFile  string
	IsCluster  bool
	SiteTitle  string
}

type User

type User struct {
	Username       string `json:"username"`
	Hash           string `json:"hash"`
	Role           string `json:"role"`
	MustChange     bool   `json:"must_change"`
	PasswordSetAt  int64  `json:"password_set_at"`
	FailedAttempts int    `json:"failed_attempts"`
	LockedUntil    int64  `json:"locked_until"`
	CreatedAt      int64  `json:"created_at"`
}

Jump to

Keyboard shortcuts

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