user

package
v0.0.22-beta Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteUser

func DeleteUser(username string) error

Removes a user, also removes everything that depends on the user (permissions, switchPermissions)

func InitLogger

func InitLogger(logger *logrus.Logger)

func IsStandaloneUserAdmin

func IsStandaloneUserAdmin(username string) (bool, error)

Checks if the user is the only entity with user management permission

func Notify

func Notify(username string, title string, description string, level NotificationLevel) error

func RemoveAvatar

func RemoveAvatar(username string) error

Will remove the current avatar of a user unless it is set to `default`

func UploadAvatar

func UploadAvatar(username string, filename string, file multipart.File) error

Accepts a username, filename and multipart file and creates and processes the file

func ValidateCredentials

func ValidateCredentials(username string, password string) (bool, error)

Will return <true / false> based on authentication validity <true> means valid authentication Can return an error if the database fails to return a valid result, meaning service downtime

Types

type NotificationLevel

type NotificationLevel uint8
const (
	NotificationLevelInfo  NotificationLevel = 1
	NotificationLevelWarn  NotificationLevel = 2
	NotificationLevelError NotificationLevel = 3
)

Jump to

Keyboard shortcuts

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