model

package
v0.0.0-...-8176360 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UserAuthCollection is mongo collection name for UserAuth
	UserAuthCollection = "userauth"
	// UserTokenCollection is mongo collection name for UserToken
	UserTokenCollection = "usertoken"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Audit

type Audit struct {
	CreatedDt *time.Time `bson:"crdt"`
	UpdatedDt *time.Time `bson:"updt"`
}

Audit ...

type UserAuth

type UserAuth struct {
	ID       bson.ObjectId `bson:"_id,omitempty"`
	Username string        `bson:"uname"`
	Email    string        `bson:"email"`
	Phone    string        `bson:"phone"`
	Password string        `bson:"passwd"`
	Status   UserStatus    `bson:"status"`
	Audit
}

UserAuth ...

type UserStatus

type UserStatus string
const (
	UserStatusActive  UserStatus = "active"
	UserStatusSuspend UserStatus = "inactive"
)

type UserToken

type UserToken struct {
	ID        bson.ObjectId `bson:"_id,omitempty"`
	UserID    bson.ObjectId `bson:"uid"`
	Username  string        `bson:"uname"`
	DeviceID  string        `bson:"dvcid"`
	LoginDt   *time.Time    `bson:"lgdt"`
	ExpiredDt *time.Time    `bson:"exdt"`
	Token     string        `bson:"token"`
}

UserToken ...

Jump to

Keyboard shortcuts

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