relational

package
v1.10.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterfaceRead

type InterfaceRead interface {
	Connect(dialect, uri string, logMode bool) *response.Response
	GetConnection() *gorm.DB
	IsAvailable() bool
	SetLogMode(logMode bool)
	Find(entity interface{}, query *gorm.DB, tableName string) *response.Response
	SetFilter(filter map[string]interface{}) *gorm.DB
	First(out interface{}, tableName string, where ...interface{}) *response.Response
	RawSQL(sql string, entity interface{}) *response.Response
}

type InterfaceWrite

type InterfaceWrite interface {
	Connect(dialect, uri string, logMode bool) *response.Response
	GetConnection() *gorm.DB
	IsAvailable() bool
	SetLogMode(logMode bool)
	Create(entity interface{}, tableName string) *response.Response
	CreateOrUpdate(entity interface{}, conditions map[string]interface{}, tableName string) *response.Response
	Update(entity interface{}, conditions map[string]interface{}, tableName string) *response.Response
	Delete(conditions map[string]interface{}, tableName string) *response.Response
	DeleteByQuery(condition *gorm.DB, tableName string) *response.Response
	StartTransaction() InterfaceWrite
	RollbackTransaction() *response.Response
	CommitTransaction() *response.Response
}

type MockRead

type MockRead struct {
	mock.Mock
}

func (*MockRead) Connect

func (m *MockRead) Connect(_, _ string, _ bool) *response.Response

func (*MockRead) Find

func (m *MockRead) Find(entity interface{}, _ *gorm.DB, _ string) *response.Response

func (*MockRead) First

func (m *MockRead) First(_ interface{}, _ string, _ ...interface{}) *response.Response

func (*MockRead) GetConnection

func (m *MockRead) GetConnection() *gorm.DB

func (*MockRead) IsAvailable

func (m *MockRead) IsAvailable() bool

func (*MockRead) RawSQL

func (m *MockRead) RawSQL(_ string, entity interface{}) *response.Response

func (*MockRead) SetFilter

func (m *MockRead) SetFilter(_ map[string]interface{}) *gorm.DB

func (*MockRead) SetLogMode

func (m *MockRead) SetLogMode(_ bool)

type MockWrite

type MockWrite struct {
	mock.Mock
}

func (*MockWrite) CommitTransaction

func (m *MockWrite) CommitTransaction() *response.Response

func (*MockWrite) Connect

func (m *MockWrite) Connect(_, _ string, _ bool) *response.Response

func (*MockWrite) Create

func (m *MockWrite) Create(_ interface{}, _ string) *response.Response

func (*MockWrite) CreateOrUpdate

func (m *MockWrite) CreateOrUpdate(_ interface{}, _ map[string]interface{}, _ string) *response.Response

func (*MockWrite) Delete

func (m *MockWrite) Delete(_ map[string]interface{}, _ string) *response.Response

func (*MockWrite) DeleteByQuery

func (m *MockWrite) DeleteByQuery(query *gorm.DB, tableName string) *response.Response

func (*MockWrite) GetConnection

func (m *MockWrite) GetConnection() *gorm.DB

func (*MockWrite) IsAvailable

func (m *MockWrite) IsAvailable() bool

func (*MockWrite) RollbackTransaction

func (m *MockWrite) RollbackTransaction() *response.Response

func (*MockWrite) SetLogMode

func (m *MockWrite) SetLogMode(logMode bool)

func (*MockWrite) StartTransaction

func (m *MockWrite) StartTransaction() InterfaceWrite

func (*MockWrite) Update

func (m *MockWrite) Update(_ interface{}, _ map[string]interface{}, _ string) *response.Response

Jump to

Keyboard shortcuts

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