user

package
v0.0.0-...-ae089e8 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractToken

func ExtractToken(r *http.Request) string

func TokenAuthMiddleware

func TokenAuthMiddleware(c *gin.Context)

func TokenValid

func TokenValid(r *http.Request) error

func VerifyToken

func VerifyToken(r *http.Request) (*jwt.Token, error)

Types

type AccessDetails

type AccessDetails struct {
	AccessUuid string
	UserId     string
}

func ExtractTokenMetadata

func ExtractTokenMetadata(r *http.Request) (*AccessDetails, error)

type Adder

type Adder struct {
	F string `json:"friend"`
}

type App

type App struct {
	Uid string
}

type Fo

type Fo struct {
	Roi    int      `json:"resource_owner_id"`
	Scopes []string `json:"scopes"`
	Eis    int      `json:"expires_in_seconds"`
	App    App      `json:"application"`
	Ca     int64    `json:"created_at"`
}

type Four

type Four struct {
	Email string `json:"email"`
	Login string `json:"login"`
	Uuid  string
}

type Ml

type Ml struct {
	Email string `json:"email"`
	Uuid  string `json:"uid"`
	Pwd   string `json:"pwd"`
	Pwda  string `json:"pwd1"`
}

type TokenDetails

type TokenDetails struct {
	AccessToken  string
	RefreshToken string
	AccessUuid   string
	RefreshUuid  string
	AtExpires    int64
	RtExpires    int64
}

type User

type User struct {
	Email      string `json:"email"`
	Uid        string `json:"uuid"`
	Password   string `json:"pwd"`
	Name       string `json:"name"`
	Types      bool
	Buy        bool `json:"buy"`
	MailVerif  bool
	TokenEmail uuid.UUID
}

type UserUtils

type UserUtils struct {
	S      *server.Server
	Client *redis.Client
}

func NewUser

func NewUser(s *server.Server) (u *UserUtils)

func (*UserUtils) AcceptFriend

func (u *UserUtils) AcceptFriend(c *gin.Context)

func (*UserUtils) AddFriend

func (u *UserUtils) AddFriend(c *gin.Context)

func (*UserUtils) AddOauthUser

func (a *UserUtils) AddOauthUser(u Four) error

func (*UserUtils) AddUser

func (a *UserUtils) AddUser(u *User) (err error)

func (*UserUtils) BanFriend

func (u *UserUtils) BanFriend(c *gin.Context)

func (*UserUtils) Change

func (u *UserUtils) Change(c *gin.Context)

func (*UserUtils) Change_Forgot

func (u *UserUtils) Change_Forgot(c *gin.Context)

func (*UserUtils) CreateAuth

func (u *UserUtils) CreateAuth(userid string, td *TokenDetails) (err error)

func (*UserUtils) CreateToken

func (u *UserUtils) CreateToken(user User, ha bool) (*TokenDetails, error)

func (*UserUtils) Deban

func (u *UserUtils) Deban(c *gin.Context)

func (*UserUtils) DelFriend

func (u *UserUtils) DelFriend(c *gin.Context)

func (*UserUtils) DelUser

func (u *UserUtils) DelUser(c *gin.Context)

func (*UserUtils) DeleteAuth

func (u *UserUtils) DeleteAuth(givenUuid string) (int64, error)

func (*UserUtils) FetchAuth

func (u *UserUtils) FetchAuth(authD *AccessDetails) (string, error)

func (*UserUtils) Forgot

func (u *UserUtils) Forgot(c *gin.Context)

func (*UserUtils) Get42

func (u *UserUtils) Get42(c *gin.Context)

func (*UserUtils) GetAllFriend

func (a *UserUtils) GetAllFriend(c *gin.Context)

func (*UserUtils) GetUser

func (a *UserUtils) GetUser(u *User) (err error)

func (*UserUtils) GetUseriVerif

func (a *UserUtils) GetUseriVerif(uid string) (err error)

func (*UserUtils) GetUsers

func (u *UserUtils) GetUsers(c *gin.Context)

func (*UserUtils) InitUser

func (a *UserUtils) InitUser()

func (*UserUtils) Refresh

func (u *UserUtils) Refresh(c *gin.Context)

func (*UserUtils) RefuseFriend

func (u *UserUtils) RefuseFriend(c *gin.Context)

func (*UserUtils) SendMail

func (a *UserUtils) SendMail(u, email string) (err error)

func (*UserUtils) SendMailForgot

func (a *UserUtils) SendMailForgot(u, email string) (err error)

func (*UserUtils) ShowFriend

func (u *UserUtils) ShowFriend(c *gin.Context)

func (*UserUtils) Tok

func (u *UserUtils) Tok(c *gin.Context)

func (*UserUtils) UserHandler

func (u *UserUtils) UserHandler(c *gin.Context)

func (*UserUtils) UserVerif

func (u *UserUtils) UserVerif(c *gin.Context)

func (*UserUtils) WWW

func (u *UserUtils) WWW(s *server.Server)

Jump to

Keyboard shortcuts

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