Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAuth ¶
func CreateAuth(user []byte, td *TokenDetails) error
Types ¶
type AccessDetails ¶
type TokenDetails ¶
type TokenDetails struct { AccessToken string RefreshToken string AccessUuid string RefreshUuid string AtExpires int64 RtExpires int64 }
func CreateToken ¶
func CreateToken(userId string) (*TokenDetails, error)
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id" json:"id"` Name string `bson:"name" json:"name" validate:"required"` Email string `bson:"email" json:"email" validate:"email,required"` Password string `bson:"password" json:"password" validate:"required,min=6"` Salt string `bson:"salt" json:"salt"` Roles []string `bson:"roles" json:"roles"` Active bool `bson:"active" json:"active"` CreatedAt time.Time `bson:"created_at"` UpdatedAt time.Time `bson:"updated_at"` }
Click to show internal directories.
Click to hide internal directories.