storage

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package storage is a generated GoMock package.

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 MockStorage

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

MockStorage is a mock of Storage interface

func NewMockStorage

func NewMockStorage(ctrl *gomock.Controller) *MockStorage

NewMockStorage creates a new mock instance

func (*MockStorage) EXPECT

func (m *MockStorage) EXPECT() *MockStorageMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockStorage) GetRequestByAddress added in v0.1.0

func (m *MockStorage) GetRequestByAddress(ctx context.Context, address string) (*Request, error)

GetRequestByAddress mocks base method

func (*MockStorage) GetRequestByOwner added in v0.1.0

func (m *MockStorage) GetRequestByOwner(ctx context.Context, owner string) (*Request, error)

GetRequestByOwner mocks base method

func (*MockStorage) SetConfirmed added in v0.1.0

func (m *MockStorage) SetConfirmed(ctx context.Context, owner string) error

SetConfirmed mocks base method

func (*MockStorage) UpsertRequest added in v0.1.0

func (m *MockStorage) UpsertRequest(ctx context.Context, owner, email, address, code string) error

UpsertRequest mocks base method

type MockStorageMockRecorder

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

MockStorageMockRecorder is the mock recorder for MockStorage

func (*MockStorageMockRecorder) GetRequestByAddress added in v0.1.0

func (mr *MockStorageMockRecorder) GetRequestByAddress(ctx, address interface{}) *gomock.Call

GetRequestByAddress indicates an expected call of GetRequestByAddress

func (*MockStorageMockRecorder) GetRequestByOwner added in v0.1.0

func (mr *MockStorageMockRecorder) GetRequestByOwner(ctx, owner interface{}) *gomock.Call

GetRequestByOwner indicates an expected call of GetRequestByOwner

func (*MockStorageMockRecorder) InsertRequest added in v0.1.0

func (mr *MockStorageMockRecorder) InsertRequest(ctx, owner, email, address, code interface{}) *gomock.Call

UpsertRequest indicates an expected call of UpsertRequest

func (*MockStorageMockRecorder) SetConfirmed added in v0.1.0

func (mr *MockStorageMockRecorder) SetConfirmed(ctx, owner interface{}) *gomock.Call

SetConfirmed indicates an expected call of SetConfirmed

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 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