storage

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package storage provides datasource functionality.

Index

Constants

This section is empty.

Variables

View Source
var ErrAddressIsTaken = fmt.Errorf("address is taken")

ErrAddressIsTaken ...

View Source
var ErrNotFound = fmt.Errorf("not found")

ErrNotFound ...

Functions

This section is empty.

Types

type Request

type Request struct {
	Owner       string      `db:"owner"`
	Email       string      `db:"email"`
	Address     string      `db:"address"`
	Code        string      `db:"code"`
	CreatedAt   time.Time   `db:"created_at"`
	ConfirmedAt pq.NullTime `db:"confirmed_at"`
}

Request ...

type Storage

type Storage interface {
	// GetRequestByOwner returns request by owner.
	GetRequestByOwner(ctx context.Context, owner string) (*Request, error)
	// GetRequestByAddress returns request by address.
	GetRequestByAddress(ctx context.Context, address string) (*Request, error)
	// SetConfirmed sets request confirmed.
	SetConfirmed(ctx context.Context, owner string) error
	// UpsertRequest inserts request into storage.
	UpsertRequest(ctx context.Context, owner, email, address, code string) error
}

Storage provides methods for interacting with database.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
Package postgres is implementation of storage interface.
Package postgres is implementation of storage interface.

Jump to

Keyboard shortcuts

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