storage

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 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) GetRequest

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

GetRequest mocks base method

func (*MockStorage) SetRequest

func (m *MockStorage) SetRequest(ctx context.Context, r *Request) error

SetRequest mocks base method

type MockStorageMockRecorder

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

MockStorageMockRecorder is the mock recorder for MockStorage

func (*MockStorageMockRecorder) GetRequest

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

GetRequest indicates an expected call of GetRequest

func (*MockStorageMockRecorder) SetRequest

func (mr *MockStorageMockRecorder) SetRequest(ctx, r interface{}) *gomock.Call

SetRequest indicates an expected call of SetRequest

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 {
	// GetRequest returns request by owner or address.
	GetRequest(ctx context.Context, owner, address string) (*Request, error)
	// SetRequest sets request.
	SetRequest(ctx context.Context, r *Request) 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