access_token

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Id        uuid.UUID  `gorm:"type:uuid;default:gen_random_uuid()" json:"id"`
	Name      string     `json:"name"`
	Token     string     `json:"-"`
	UserId    uuid.UUID  `json:"-"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	LastSeen  *time.Time `json:"last_seen"`
	DeletedAt *time.Time `json:"deleted_at"`
	ExpiresAt *time.Time `json:"expires_at"`
}

type Repository

type Repository interface {
	List(userId uuid.UUID) ([]AccessToken, error)
	FindById(tokenId uuid.UUID) (*AccessToken, error)
	FindByToken(token string) (*AccessToken, error)
	Create(token *AccessToken) (*AccessToken, error)
	Update(token *AccessToken) (*AccessToken, error)
	Delete(tokenId uuid.UUID) error
}

func New

func New(db *gorm.DB) Repository

Jump to

Keyboard shortcuts

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