relational

package
v1.7.8 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 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() *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{}, where ...interface{}) *response.Response
	Related(model, related interface{}, filter map[string]interface{}, foreignKeys ...string) *response.Response
	RawSQL(sql string, entity interface{}) *response.Response
}

type InterfaceWrite

type InterfaceWrite interface {
	Connect() *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() *response.Response

func (*MockRead) Find

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

func (*MockRead) First

func (m *MockRead) First(out interface{}, where ...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(sql string, entity interface{}) *response.Response

func (*MockRead) Related

func (m *MockRead) Related(model, related interface{}, filter map[string]interface{}, foreignKeys ...string) *response.Response

func (*MockRead) SetFilter

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

func (*MockRead) SetLogMode

func (m *MockRead) SetLogMode(logMode bool)

type MockWrite

type MockWrite struct {
	mock.Mock
}

func (*MockWrite) CommitTransaction

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

func (*MockWrite) Connect

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

func (*MockWrite) Create

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

func (*MockWrite) CreateOrUpdate

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

func (*MockWrite) Delete

func (m *MockWrite) Delete(conditions map[string]interface{}, tableName 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(entity interface{}, conditions map[string]interface{}, tableName string) *response.Response

Jump to

Keyboard shortcuts

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