user

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

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

func Init

func Init(driver *mongo.Database) (*User, error)

func (*User) ChangeUserPassword

func (u *User) ChangeUserPassword(id string, passwd string) error

func (*User) ChangeUserSettings

func (u *User) ChangeUserSettings(id string, settings map[string]string) error

func (*User) CreateUser

func (u *User) CreateUser(user models.User) (models.User, error)

func (*User) GetAllUsers

func (u *User) GetAllUsers() ([]models.User, error)

func (*User) GetUserById

func (u *User) GetUserById(id string) (models.User, error)

GetUserById(id string) (models.User, error)

func (*User) GetUserByUsername

func (u *User) GetUserByUsername(username string) (models.User, error)

GetUser(username string) (models.User, error)

func (*User) UpdateUserData

func (u *User) UpdateUserData(id string, fullname string, email string, isadmin bool, iswriter bool) error

type UserScheme

type UserScheme struct {
	UserName     string             `bson:"user_name"`
	FullName     string             `bson:"full_name"`
	Password     string             `bson:"passwd"`
	Email        string             `bson:"email"`
	IsAdmin      bool               `bson:"is_admin"`
	IsWriter     bool               `bson:"is_writer"`
	Id           primitive.ObjectID `bson:"_id"`
	LastLogin    time.Time          `bson:"last_login"`
	CreationDate time.Time          `bson:"creation_date"`
	Settings     map[string]string  `bson:"settings"`
}

Jump to

Keyboard shortcuts

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