mysql

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Migrations = []*gormigrate.Migration{

	&gormigrate.Migration{
		ID: "2019-08-31T13:18:52.719Z",
		Migrate: func(tx *gorm.DB) error {
			return tx.
				CreateTable(&model.Setting{}).
				CreateTable(&model.Swap{}).
				AddUniqueIndex("ux_swap_srctx", "src_tx").
				AddIndex("ix_swap_status", "status").
				CreateTable(&model.Sending{}).
				Error
		},
		Rollback: func(tx *gorm.DB) error {
			return tx.
				DropTable(&model.Setting{}).
				DropTable(&model.Swap{}).
				DropTable(&model.Sending{}).
				Error
		},
	},
}

Migrations array

Functions

This section is empty.

Types

type Database

type Database struct {
	*gorm.DB
	// contains filtered or unexported fields
}

Database data

func New

func New(connection, tablePrefix string, multiStatements bool, maxPacket uint32) (*Database, error)

New instance

func (*Database) Available

func (d *Database) Available() bool

Available impl.

func (*Database) DuplicateError

func (d *Database) DuplicateError(err error) bool

DuplicateError impl.

func (*Database) GetEnqueuedSendings

func (d *Database) GetEnqueuedSendings(max uint16) ([]*types.Sending, error)

GetEnqueuedSendings implementation

func (*Database) GetEnqueuedSwaps

func (d *Database) GetEnqueuedSwaps() ([]*types.Swap, error)

GetEnqueuedSwaps implementation

func (*Database) GetInitiaitedSendings

func (d *Database) GetInitiaitedSendings(max uint16) ([]*types.Sending, error)

GetInitiaitedSendings implementation

func (*Database) GetSending

func (d *Database) GetSending(id uint64) (*types.Sending, error)

GetSending implementation

func (*Database) GetSetting

func (d *Database) GetSetting(k, def string) (string, error)

GetSetting implementation

func (*Database) GetSwap

func (d *Database) GetSwap(id uint64) (*types.Swap, error)

GetSwap implementation

func (*Database) MaxPacketError

func (d *Database) MaxPacketError(err error) bool

MaxPacketError impl.

func (*Database) PutSending

func (d *Database) PutSending(s *types.Sending) error

PutSending implementation

func (*Database) PutSetting

func (d *Database) PutSetting(k, v string) error

PutSetting implementation

func (*Database) PutSwap

func (d *Database) PutSwap(s *types.Swap) (dup bool, err error)

PutSwap implementation

func (*Database) UpdateSending

func (d *Database) UpdateSending(s *types.Sending) error

UpdateSending implementation

func (*Database) UpdateSwap

func (d *Database) UpdateSwap(s *types.Swap) error

UpdateSwap implementation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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