db

package
Version: 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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAO

type DAO interface {
	Available() bool
	DuplicateError(err error) bool
	MaxPacketError(err error) bool

	// PutSetting puts a new setting
	PutSetting(k, v string) error
	// GetSetting puts a new setting
	GetSetting(k, def string) (string, error)

	// PutSwap puts a new swap
	PutSwap(s *types.Swap) (dup bool, err error)
	// GetSwap gets a swap by ID
	GetSwap(id uint64) (*types.Swap, error)
	// GetEnqueuedSwaps gets a list of swaps
	GetEnqueuedSwaps() ([]*types.Swap, error)
	// UpdateSwap updates a swap
	UpdateSwap(s *types.Swap) error

	// PutSending puts a new sending
	PutSending(s *types.Sending) error
	// GetSending gets a sending by ID
	GetSending(id uint64) (*types.Sending, error)
	// GetEnqueuedSendings gets a list of sendings
	GetEnqueuedSendings(max uint16) ([]*types.Sending, error)
	// GetInitiaitedSendings gets a list of sendings
	GetInitiaitedSendings(max uint16) ([]*types.Sending, error)
	// UpdateSending updates a sending
	UpdateSending(s *types.Sending) error
}

DAO is a DB interface

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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