dao

package
v1.1.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package dao provides access to the database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAO

type DAO interface {
	CreatePaymentResource(paymentResource *models.PaymentResourceDB) error
	GetPaymentResource(string) (*models.PaymentResourceDB, error)
	PatchPaymentResource(id string, paymentUpdate *models.PaymentResourceDB) error
}

DAO is an interface for accessing dao from a backend store

type MockDAO

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

MockDAO is a mock of DAO interface

func NewMockDAO

func NewMockDAO(ctrl *gomock.Controller) *MockDAO

NewMockDAO creates a new mock instance

func (*MockDAO) CreatePaymentResource

func (m *MockDAO) CreatePaymentResource(paymentResource *models.PaymentResourceDB) error

CreatePaymentResource mocks base method

func (*MockDAO) EXPECT

func (m *MockDAO) EXPECT() *MockDAOMockRecorder

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

func (*MockDAO) GetPaymentResource

func (m *MockDAO) GetPaymentResource(arg0 string) (*models.PaymentResourceDB, error)

GetPaymentResource mocks base method

func (*MockDAO) PatchPaymentResource

func (m *MockDAO) PatchPaymentResource(id string, paymentUpdate *models.PaymentResourceDB) error

PatchPaymentResource mocks base method

type MockDAOMockRecorder

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

MockDAOMockRecorder is the mock recorder for MockDAO

func (*MockDAOMockRecorder) CreatePaymentResource

func (mr *MockDAOMockRecorder) CreatePaymentResource(paymentResource interface{}) *gomock.Call

CreatePaymentResource indicates an expected call of CreatePaymentResource

func (*MockDAOMockRecorder) GetPaymentResource

func (mr *MockDAOMockRecorder) GetPaymentResource(arg0 interface{}) *gomock.Call

GetPaymentResource indicates an expected call of GetPaymentResource

func (*MockDAOMockRecorder) PatchPaymentResource

func (mr *MockDAOMockRecorder) PatchPaymentResource(id, paymentUpdate interface{}) *gomock.Call

PatchPaymentResource indicates an expected call of PatchPaymentResource

type Mongo

type Mongo struct {
	URL string
}

Mongo represents a simplistic MongoDB configuration.

func (*Mongo) CreatePaymentResource

func (m *Mongo) CreatePaymentResource(paymentResource *models.PaymentResourceDB) error

CreatePaymentResource writes a new payment resource to the DB

func (*Mongo) GetPaymentResource

func (m *Mongo) GetPaymentResource(id string) (*models.PaymentResourceDB, error)

GetPaymentResource gets a payment resource from the DB If payment not found in DB, return nil

func (*Mongo) PatchPaymentResource

func (m *Mongo) PatchPaymentResource(id string, paymentUpdate *models.PaymentResourceDB) error

PatchPaymentResource patches a payment resource from the DB

Jump to

Keyboard shortcuts

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