models

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetIDs added in v1.1.14

func AssetIDs(assets []Asset) []string

Types

type Asset added in v1.1.9

type Asset struct {
	CreatedAt time.Time `gorm:"index:,"`
	ID        uint      `gorm:"primary_key; uniqueIndex"`
	Asset     string    `gorm:"type:varchar(128); uniqueIndex"`

	Decimals uint   `gorm:"int(4)"`
	Name     string `gorm:"type:varchar(128)"`
	Symbol   string `gorm:"type:varchar(128)"`
	Type     string `gorm:"type:varchar(12)"`
	Coin     uint
}

func AssetFrom added in v1.1.15

func AssetFrom(t types.Tx) (a Asset, ok bool)

func (*Asset) IsValid added in v1.1.15

func (asset *Asset) IsValid() error

type Subscription

type Subscription struct {
	ID        uint `gorm:"primaryKey;"`
	CreatedAt time.Time
	Address   string `gorm:"uniqueIndex:idx_address; type:varchar(256); not null;"`
}

Subscription for address and asset associations

type SubscriptionsAssetAssociation added in v1.1.15

type SubscriptionsAssetAssociation struct {
	CreatedAt      time.Time    `gorm:"index;"`
	Subscription   Subscription `gorm:"ForeignKey:SubscriptionId; not null"`
	SubscriptionId uint         `gorm:"primary_key; autoIncrement:false; index"`

	Asset   Asset `gorm:"ForeignKey:AssetId; not null"`
	AssetId uint  `gorm:"primary_key; autoIncrement:false; index"`
}

type Tracker

type Tracker struct {
	UpdatedAt time.Time
	Coin      string `gorm:"primary_key:true; type:varchar(64)"`
	Height    int64
}

Jump to

Keyboard shortcuts

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