userCenter

package
v0.0.0-...-1c3a8e4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddGroup

func AddGroup(name, description string) error

func AddUser

func AddUser(nickname, username, password, email string, group []string) error

func DeleteGroup

func DeleteGroup(name string) error

func EncryptionPassword

func EncryptionPassword(username, password, email string) string

Types

type Group

type Group struct {
	gorm.Model
	Name        string `gorm:"type:varchar(100);unique"`
	Description string
}

func GetGroup

func GetGroup() ([]Group, error)

func GetGroupByName

func GetGroupByName(name string) (Group, error)

func GetGroupByNames

func GetGroupByNames(names []string) ([]Group, error)

type User

type User struct {
	gorm.Model
	Nickname string
	Username string `gorm:"type:varchar(100);unique"`
	Password string
	Email    string  `gorm:"type:varchar(100);unique"`
	Group    []Group `gorm:"many2many:user_group"`
}

func GetUser

func GetUser() ([]User, error)

func GetUserById

func GetUserById(id int) (User, error)

func GetUserByName

func GetUserByName(name string) (User, error)

func (User) AddGroup

func (user User) AddGroup(group string) error

func (User) Delete

func (user User) Delete() error

func (User) DeleteGroup

func (user User) DeleteGroup(group string) error

func (User) Edit

func (user User) Edit(nickName, password string) error

func (User) HasGroup

func (user User) HasGroup(group string) bool

Jump to

Keyboard shortcuts

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