user

package
v0.0.0-...-600b74a Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(username, password string) bool

Authorize user

func HashPassword

func HashPassword(password string) string

HashPassword string

func Migrate

func Migrate()

Migrate table

func Populate

func Populate(superusers map[string]string)

Populate superusers

Types

type User

type User struct {
	ID uint `json:"id" gorm:"primary_key"`

	Username     string `json:"username"`
	FullName     string `json:"fullname"`
	Password     string `json:"password,omitempty" gorm:"-"`
	PasswordHash string `json:"-"`
	Role         string `json:"role"`

	CreatedAt int64 `json:"-"`
	UpdatedAt int64 `json:"-"`
}

User model

Jump to

Keyboard shortcuts

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