auth

package
v0.0.0-...-7de7836 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Cookies map[string]string
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth() *Auth

func (*Auth) DeleteUser

func (a *Auth) DeleteUser(name string) error

func (*Auth) GenerateCookie

func (a *Auth) GenerateCookie() (string, error)

func (*Auth) GetUser

func (a *Auth) GetUser(username string) (User, error)

func (*Auth) GetUsers

func (a *Auth) GetUsers() []User

func (*Auth) InsertUser

func (a *Auth) InsertUser(user User) error

func (*Auth) NewUser

func (a *Auth) NewUser(username string, password string, admin bool) (User, error)

func (*Auth) UpdateAdmin

func (a *Auth) UpdateAdmin(username string, admin bool) error

func (*Auth) UpdatePassword

func (a *Auth) UpdatePassword(user User, newPassword string) (User, error)

func (*Auth) ValidateUser

func (a *Auth) ValidateUser(username string, password string) (bool, error)

type User

type User struct {
	Username string
	PassHash string
	Salt     string
	Admin    bool
}

Jump to

Keyboard shortcuts

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