models

package
v0.0.0-...-aa65b62 Latest Latest
Warning

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

Go to latest
Published: May 11, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim struct {
	Key   string
	Value string
}

Claim struct for JWT claims

type OAuth2

type OAuth2 struct {
	Code              string    `bson:"code"`
	CodeValidUntil    time.Time `bson:"codeValidUntil"`
	AccessToken       string    `bson:"accessToken"`
	ValidUntil        time.Time `bson:"validUntil"`
	RefreshToken      string    `bson:"refreshToken"`
	RefreshValidUntil time.Time `bson:"refreshValidUntil"`
	Claims            []Claim   `bson:"claims"`
	LastAuth          time.Time `bson:"lastAuth"`
}

OAuth2 struct for JWT data

type User

type User struct {
	ID           primitive.ObjectID `bson:"_id,omitempty"`
	Login        string             `bson:"login,omitempty"`
	PasswordHash string             `bson:"passwordHash,omitempty"`
	Auth         OAuth2             `bson:"auth"`
}

User struct for mapping mongo data

func (User) CheckPassword

func (user User) CheckPassword(password string) bool

CheckPassword check password for UserDao struct

Jump to

Keyboard shortcuts

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