db

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2020 License: MIT Imports: 14 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	Gorm        *gorm.DB
	MemoryCache *gocache.Cache
}

func New

func New(uri, readUri string, logMode bool) (*Instance, error)

func (*Instance) AddAssociationsForAddress added in v1.1.9

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

func (*Instance) AddNewAssets added in v1.1.14

func (i *Instance) AddNewAssets(assets []models.Asset, 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) GetAssetsByIDs added in v1.1.14

func (i *Instance) GetAssetsByIDs(ids []string, ctx context.Context) ([]models.Asset, error)

func (*Instance) GetAssetsFrom added in v1.1.14

func (i *Instance) GetAssetsFrom(from time.Time, coin int, ctx context.Context) ([]models.Asset, error)

func (Instance) GetAssetsMapByAddresses added in v1.1.9

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

func (Instance) GetAssetsMapByAddressesFromTime added in v1.1.9

func (i Instance) GetAssetsMapByAddressesFromTime(addresses []string, from time.Time, ctx context.Context) (map[string][]models.Asset, 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) MemoryGet added in v1.1.14

func (i *Instance) MemoryGet(key string, ctx context.Context) ([]byte, error)

func (*Instance) MemorySet added in v1.1.14

func (i *Instance) MemorySet(key string, data []byte, exp time.Duration, ctx context.Context) error

func (*Instance) RestoreConnectionWorker added in v1.1.14

func (i *Instance) RestoreConnectionWorker(ctx context.Context, timeout time.Duration, uri string)

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][]models.Asset, 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