user

package
v0.0.0-...-d6e685d Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckToken

func CheckToken(c *gin.Context)

func CreateAccount

func CreateAccount(c *gin.Context)

func DelateAccount

func DelateAccount(ID primitive.ObjectID) error

func DelateSession

func DelateSession(c *gin.Context)

func DelateaAccount

func DelateaAccount(c *gin.Context)

func EmailIsAvailable

func EmailIsAvailable(Email string) bool

func GetBasicInfo

func GetBasicInfo(ID primitive.ObjectID, data interface{}) error

func GetPublications

func GetPublications(UserID string, Next int) ([]blog.FeedStrcture, error)

func IPAddrUser

func IPAddrUser(data *IpAddrUser) (bool, error)

func Iploggeduser

func Iploggeduser(c *gin.Context)

func Login

func Login(c *gin.Context)

func RecoveryAccount

func RecoveryAccount(c *gin.Context)

RecoveryAccount

func RemoveIPAddrUser

func RemoveIPAddrUser(uudi string) error

func SearchMyPublications

func SearchMyPublications(c *gin.Context)

Search for the user’s posts.

func Signout

func Signout(c *gin.Context)

func TokenRenewal

func TokenRenewal(c *gin.Context)

Renew the token that is about to expire and delete the token that is about to expire.

func UpdateUserInfo

func UpdateUserInfo(id primitive.ObjectID, data *UserStrcture) (*mongo.UpdateResult, error)

func Updateinfo

func Updateinfo(c *gin.Context)

func UserInfo

func UserInfo(c *gin.Context)

func ValidateRecoveryAccount

func ValidateRecoveryAccount(c *gin.Context)

ValidateRecoveryAccount

Types

type BasicInfo

type BasicInfo struct {
	Username    string `bson:"Username,omitempty"`
	FirstName   string `bson:"FirstName,omitempty"`
	LastName    string `bson:"LastName,omitempty"`
	Permissions string `bson:"Permissions,omitempty"`
	Email       string `bson:"Email,omitempty"`
	ID          string `bson:"_id,omitempty"`
	Image       string `bson:"Image,omitempty"`
	Banned      bool   `bson:"Banned,omitempty"`
}

Basic user structure

type Data

type Data []UserStrcture

Data

type IpAddrUser

type IpAddrUser struct {
	IDuser    primitive.ObjectID `bson:"IDuser"`
	Date      time.Time          `bson:"Date"`
	IpAddrs   string             `bson:"IpAddrs"`
	DateOut   time.Time          `bson:"DateOut"`
	UserAgent string             `bson:"UserAgent"`
	Uuidtoken string             `bson:"Uuidtoken"`
}

Structure used in the logon record

func GetIpaddes

func GetIpaddes(Userid primitive.ObjectID) ([]IpAddrUser, error)

type LoginRequestStruct

type LoginRequestStruct struct {
	ID       uint64 `json:"id"`
	Email    string `json:"Email"`
	Password string `json:"Password"`
}

Structure of the login parameters

type RecoveryAccountStrctureTemplate

type RecoveryAccountStrctureTemplate struct {
	Name     string
	UrlToken string
}

Account recovery structure only basic parameters

type UserStrcture

type UserStrcture struct {
	Email       string    `bson:"Email,omitempty"`
	Image       string    `bson:"Image,omitempty"`
	Password    string    `json:"Password,omitempty" bson:"Password,omitempty"`
	FirstName   string    `bson:"FirstName,omitempty"`
	LastName    string    `bson:"LastName,omitempty"`
	Permissions string    `bson:"Permissions,omitempty"`
	Username    string    `bson:"Username,omitempty"`
	Banned      bool      `bson:"Banned"`
	Created_at  time.Time `bson:"Created_at,omitempty"`
	ID          string    `bson:"_id,omitempty"`
}

Complete user structure

Jump to

Keyboard shortcuts

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