token

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table struct {
	base.Table
	UserID    uuid.UUID  `json:"user_id,omitempty"`
	Token     string     `json:"token,omitempty"`
	ExpiredAt *time.Time `json:"expired_at,omitempty"`
}

Table model

func FromEntity

func FromEntity(e *entity.Token) *Table

FromEntity func

func (*Table) BeforeCreate

func (u *Table) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate func

func (*Table) TableName

func (u *Table) TableName(tx *gorm.DB) string

TableName func

func (Table) ToEntity

func (t Table) ToEntity() *entity.Token

ToEntity func

type TokenRepository

type TokenRepository interface {
	Create(*entity.Token) (*entity.Token, error)
	FindByUserID(uuid.UUID) (*entity.Token, error)
	FindByToken(string) (*entity.Token, error)
}

TokenRepository interface

func New

func New() TokenRepository

New func

Jump to

Keyboard shortcuts

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