verification

package
v0.0.0-...-ac0e98d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package verification provides a core business API.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("verification not found")
)

Set of error variables for CRUD operations.

Functions

This section is empty.

Types

type Core

type Core struct {
	// contains filtered or unexported fields
}

Core manages the set of APIs for verification access.

func NewCore

func NewCore(log *zerolog.Logger, usrCore *user.Core, storer Storer) *Core

NewCore constructs a verification core API for use.

func (*Core) Create

func (c *Core) Create(nv NewVerification) (Verificiation, error)

Create adds a new verification to the system.

func (*Core) QueryByID

func (c *Core) QueryByID(id uuid.UUID) (Verificiation, error)

QueryByID finds the verification by the specified ID.

func (*Core) Update

func (c *Core) Update(vrf Verificiation, used *bool) (Verificiation, error)

func (*Core) Verify

func (c *Core) Verify(id uuid.UUID) (user.User, error)

type NewVerification

type NewVerification struct {
	UserID uuid.UUID
	Email  string
	Code   string
}

type Storer

type Storer interface {
	WithinTran(fn func(s Storer) error) error
	Create(vrf Verificiation) error
	Update(vrf Verificiation) error
	QueryByID(id uuid.UUID) (Verificiation, error)
}

Storer interface declares the behavior this package needs to perists and retrieve data.

type Verificiation

type Verificiation struct {
	ID        uuid.UUID
	UserID    uuid.UUID
	Email     string
	Code      string
	Used      bool
	CreatedAt time.Time
	ExpiredAt time.Time
}

Directories

Path Synopsis
Package mockvrf is a generated GoMock package.
Package mockvrf is a generated GoMock package.
Package verificationdb contains verification related CRUD functionality.
Package verificationdb contains verification related CRUD functionality.

Jump to

Keyboard shortcuts

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