db

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MIT Imports: 12 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BulkInsert added in v1.1.9

func BulkInsert(db *gorm.DB, dbModels interface{}) error

Example: postgres.BulkInsert(DBWrite, []models.User{...})

func RestoreConnectionWorker

func RestoreConnectionWorker(database *Instance, timeout time.Duration, uri string)

Types

type Instance

type Instance struct {
	Gorm     *gorm.DB
	GormRead *gorm.DB
}

func New

func New(uri, readURI, env string, mode bool) (*Instance, error)

func (*Instance) AddAssociationsForAddress added in v1.1.9

func (i *Instance) AddAssociationsForAddress(address string, assets []string, ctx context.Context) error

func (*Instance) AddSubscriptionsForNotifications added in v1.1.9

func (i *Instance) AddSubscriptionsForNotifications(addresses []string, ctx context.Context) error

func (*Instance) DeleteSubscriptionsForNotifications added in v1.1.9

func (i *Instance) DeleteSubscriptionsForNotifications(addresses []string, ctx context.Context) error

func (Instance) GetAssetsMapByAddresses added in v1.1.9

func (i Instance) GetAssetsMapByAddresses(addresses []string, ctx context.Context) (map[string][]string, error)

func (Instance) GetAssetsMapByAddressesFromTime added in v1.1.9

func (i Instance) GetAssetsMapByAddressesFromTime(addresses []string, from time.Time, ctx context.Context) (map[string][]string, error)

func (*Instance) GetAssociationsByAddresses added in v1.1.9

func (i *Instance) GetAssociationsByAddresses(addresses []string, ctx context.Context) ([]models.AddressToAssetAssociation, error)

func (*Instance) GetAssociationsByAddressesFromTime added in v1.1.9

func (i *Instance) GetAssociationsByAddressesFromTime(addresses []string, from time.Time, ctx context.Context) ([]models.AddressToAssetAssociation, error)

func (*Instance) GetLastParsedBlockNumber

func (i *Instance) GetLastParsedBlockNumber(coin string, ctx context.Context) (int64, error)

func (Instance) GetSubscribedAddressesForAssets added in v1.1.9

func (i Instance) GetSubscribedAddressesForAssets(ctx context.Context, addresses []string) ([]models.Address, error)

func (*Instance) GetSubscriptionsForNotifications added in v1.1.9

func (i *Instance) GetSubscriptionsForNotifications(addresses []string, ctx context.Context) ([]models.NotificationSubscription, error)

func (*Instance) SetLastParsedBlockNumber

func (i *Instance) SetLastParsedBlockNumber(coin string, num int64, ctx context.Context) error

func (*Instance) UpdateAssociationsForExistingAddresses added in v1.1.9

func (i *Instance) UpdateAssociationsForExistingAddresses(associations map[string][]string, ctx context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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