databases

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceDB

type ServiceDB struct {
	Cfg    *config.ServiceConfig
	Driver string

	Name string
	// contains filtered or unexported fields
}

func New

func New(this *ServiceDB) *ServiceDB

func (*ServiceDB) CreateHistoryLog

func (db *ServiceDB) CreateHistoryLog(ctx context.Context, reqDB *modelDB.HistoryLog) (lastInsertID int64, err error)

CreateHistoryLog create history log from request client

func (*ServiceDB) CreateHistoryLogTx

func (db *ServiceDB) CreateHistoryLogTx(ctx context.Context, tx *sqlx.Tx, reqDB *modelDB.HistoryLog) (lastInsertID int64, err error)

CreateHistoryLogTx create history log from request client using transaction

func (*ServiceDB) CreateHistorySigning

func (db *ServiceDB) CreateHistorySigning(ctx context.Context, reqDB *modelDB.Signing) (lastInsertID int64, err error)

CreateHistorySigning create history signing from request client

func (*ServiceDB) CreateUserTx

func (db *ServiceDB) CreateUserTx(ctx context.Context, tx *sqlx.Tx, reqDB *modelDB.User) (lastInsertID int64, err error)

CreateUserTx create user from request client using transaction

func (*ServiceDB) GetUserByEmail

func (db *ServiceDB) GetUserByEmail(ctx context.Context, email string) (respDB *modelDB.User, err error)

func (*ServiceDB) TxBegin

func (db *ServiceDB) TxBegin(ctx context.Context) (*sqlx.Tx, error)

func (*ServiceDB) TxCommit

func (db *ServiceDB) TxCommit(tx *sqlx.Tx) error

func (*ServiceDB) TxError

func (db *ServiceDB) TxError(tx *sqlx.Tx, err error) error

Jump to

Keyboard shortcuts

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