user

package
v0.0.0-...-b302b47 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleAdmin = "Admin"
	RoleUser  = "User"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type User

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

func New

func New(salt []byte) *User

func (*User) Authenticate

func (u *User) Authenticate(username, password string) (UserInfo, bool)

func (*User) Get

func (u *User) Get(id ulid.ULID) (UserInfo, bool)

func (*User) Register

func (u *User) Register(username string, password string, role string) error

type UserInfo

type UserInfo struct {
	ID       ulid.ULID
	Username string

	Role string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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