token

package
v0.0.0-...-de9ab70 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExists = errors.New("token already exists")
	ErrNotFound      = errors.New("token not found")
	ErrInternal      = errors.New("internal error")
)

Functions

func CreateToken

func CreateToken(token *Token) error

func DeleteToken

func DeleteToken(token *Token) error

func UpdateToken

func UpdateToken(token *Token) error

Types

type Token

type Token struct {
	gorm.Model
	ID           uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()" json:"id" validate:"uuid"`
	UserID       uuid.UUID `gorm:"type:uuid;not null" json:"user_id" validate:"required,uuid"`
	AccessJwtID  uuid.UUID `gorm:"type:uuid;not null" json:"access_jwt_id" validate:"required,uuid"`
	RefreshJwtID uuid.UUID `gorm:"type:uuid;not null" json:"refresh_jwt_id" validate:"required,uuid"`
}

func FindToken

func FindToken(token *Token) (Token, error)

Jump to

Keyboard shortcuts

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