users

package module
v0.0.0-...-440ca47 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedirectURL

type RedirectURL struct {
	ID          primitive.ObjectID `bson:"_id,omitempty"`
	URL         string             `bson:"url,omitempty"`
	Description string             `bson:"description,omitempty"`
	CreatedAt   string             `bson:"created_at,omitempty"`
}

RedirectURL of the user app

type User

type User struct {
	ID               primitive.ObjectID `bson:"_id,omitempty"`
	Email            string             `bson:"email,omitempty"`
	Password         string             `bson:"password,omitempty"`
	AppName          string             `bson:"app_name,omitempty"`
	ClientID         string             `bson:"client_id,omitempty"`
	CurrentSecretKey string             `bson:"current_secret_key,omitempty"`
	Token            string             `bson:"token,omitempty"`
	RefreshToken     string             `bson:"refresh_token,omitempty"`
	RedirectURLs     []RedirectURL      `bson:"redirect_urls,omitempty"`
	CreatedAt        string             `bson:"created_at,omitempty"`
}

User db info

type Users

type Users struct{}

Users implements

func NewUsers

func NewUsers() Users

NewUsers interface implementation

func (Users) Delete

func (u Users) Delete(userID int64) error

Delete doc

func (Users) Get

func (u Users) Get(userID int64) (*users.User, error)

Get doc ..

func (Users) GetAll

func (u Users) GetAll() ([]users.User, error)

GetAll doc ...

func (Users) GetByClientID

func (u Users) GetByClientID(clientID string) (*users.User, error)

GetByClientID doc ...

func (Users) GetByEmail

func (u Users) GetByEmail(email string) (*users.User, error)

GetByEmail doc ...

func (Users) GetRedirectURLs

func (u Users) GetRedirectURLs(userID int64) ([]users.RedirectURL, error)

GetRedirectURLs ...

func (Users) Save

func (u Users) Save(usr users.User) error

Save doc ...

func (Users) UpdateCurrentSecretKey

func (u Users) UpdateCurrentSecretKey(clientID, secretKey string) error

UpdateCurrentSecretKey doc

func (Users) UpdateToken

func (u Users) UpdateToken(clientID, token, refreshToken string) error

UpdateToken doc ...

Jump to

Keyboard shortcuts

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