db

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(db *gorm.DB) error

Types

type Instance

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

func New

func New(url string, log bool) (*Instance, error)

func (*Instance) AddNewAssets

func (i *Instance) AddNewAssets(assets []models.Asset) error

func (*Instance) CreateSubscriptions

func (i *Instance) CreateSubscriptions(addresses []types.Subscription) error

func (*Instance) CreateSubscriptionsAssets

func (i *Instance) CreateSubscriptionsAssets(associations []models.SubscriptionsAssetAssociation) error

func (*Instance) DeleteSubscriptions

func (i *Instance) DeleteSubscriptions(addresses []string) error

func (*Instance) GetAsset

func (i *Instance) GetAsset(assetId string) (models.Asset, error)

func (*Instance) GetAssetsByIDs

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

func (*Instance) GetAssetsFrom

func (i *Instance) GetAssetsFrom(from time.Time) ([]models.Asset, error)

func (*Instance) GetLastParsedBlockNumber

func (i *Instance) GetLastParsedBlockNumber(coin string) (models.Tracker, error)

func (*Instance) GetLastParsedBlockNumbers

func (i *Instance) GetLastParsedBlockNumbers() ([]models.Tracker, error)

func (*Instance) GetSubscriptions

func (i *Instance) GetSubscriptions(addresses []string) ([]models.Subscription, error)

func (*Instance) GetSubscriptionsByAddressIDs

func (i *Instance) GetSubscriptionsByAddressIDs(ids []string, from time.Time) ([]models.SubscriptionsAssetAssociation, error)

func (*Instance) MemoryGet

func (i *Instance) MemoryGet(key string) ([]byte, error)

func (*Instance) MemorySet

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

func (*Instance) SetLastParsedBlockNumber

func (i *Instance) SetLastParsedBlockNumber(coin string, num int64) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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