schema

package
v0.0.0-...-930562d Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppToken

type AppToken struct {
	Name  string  `gorm:"varchar(255); notNull;" json:"name"`
	Token string  `gorm:"varchar(255); notNull;" json:"token"`
	Rate  float64 `gorm:"type:real; notNull;" json:"rate"` // 每秒释放量
	Base
}

type Base

type Base struct {
	ID        uint64         `gorm:"primaryKey;autoIncrement" json:"id"`
	CreatedAt time.Time      `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt time.Time      `gorm:"autoUpdateTime" json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`
}

type CoinHistoricalPrice

type CoinHistoricalPrice struct {
	CoinID    string  `gorm:"type:varchar(255);notNull" json:"coin_id"`           // coin id
	Date      int64   `gorm:"type:bigint;notNull" json:"date"`                    // unix date
	DayDate   string  `gorm:"type:varchar(255);notNull" json:"day_date"`          // day date
	Price     string  `gorm:"type:varchar(255);notNull" json:"price"`             // price
	Source    string  `gorm:"type:varchar(255);notNull;default:''" json:"source"` // data source
	QueryInfo *string `gorm:"type:json" json:"query_info"`                        // query info
	Base
}

type Coins

type Coins struct {
	ID                   string     `gorm:"type:varchar(255);primaryKey" json:"id"`                  // chain_id + address
	Address              string     `gorm:"type:varchar(255);notNull" json:"address"`                // token or pool address
	ChainID              string     `gorm:"type:varchar(255);notNull" json:"chain_id"`               // chain id
	Symbol               *string    `gorm:"type:varchar(255);notNull" json:"symbol"`                 // symbol
	Name                 *string    `gorm:"type:varchar(255);notNull" json:"name"`                   // name
	CoingeckoCoinID      *string    `gorm:"type:varchar(255)" json:"coingecko_coin_id"`              // coingecko coin id
	CoingeckoPlatforms   JSONMap    `gorm:"type:json" json:"coingecko_platforms"`                    // coingecko platforms
	GeckoterminalNetwork *string    `gorm:"type:varchar(255)" json:"geckoterminal_network"`          // geckoterminal network
	Extra                *string    `gorm:"type:json" json:"extra"`                                  // json扩展信息
	Decimals             *int       `gorm:"type:int" json:"decimals"`                                // decimals
	TotalSupply          *string    `gorm:"type:varchar(255)" json:"total_supply"`                   // total supply
	Label                string     `gorm:"type:varchar(255);notNull;default:''" json:"label"`       // label
	PoolName             *string    `gorm:"type:varchar(255);default:''" json:"pool_name"`           // pool name
	BaseTokenAddress     *string    `gorm:"type:varchar(255);default:''" json:"base_token_address"`  // base token address
	QuoteTokenAddress    *string    `gorm:"type:varchar(255);default:''" json:"quote_token_address"` // quote token address
	PoolCreatedAt        *time.Time `gorm:"" json:"pool_created_at"`                                 // pool created at
	PoolAttributes       *string    `gorm:"type:json" json:"pool_attributes"`                        // pool attributes
	LastPriceSource      *string    `gorm:"type:varchar(255)" json:"last_price_source"`              // 上次价格查询结果来源
	PriceSource          *string    `gorm:"type:varchar(255)" json:"price_source"`                   // 价格查询来源
	ReturnCoinsId        *string    `gorm:"type:varchar(255)" json:"return_coins_id"`                // 返回的coins ID
	Base
}

type JSONMap

type JSONMap map[string]string

JSONMap is a custom type for handling map[string]string JSON fields in GORM

func (*JSONMap) Scan

func (m *JSONMap) Scan(value interface{}) error

Scan implements the sql.Scanner interface

func (JSONMap) Value

func (m JSONMap) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type RequestLog

type RequestLog struct {
	IPAddress     string `gorm:"size:45"`
	Endpoint      string `gorm:"size:255"`
	RequestParams string `gorm:"type:text"`
	Response      string `gorm:"type:text"`
	ExecutionTime int64
	CreatedAt     time.Time      `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt     time.Time      `gorm:"autoUpdateTime" json:"updated_at"`
	DeletedAt     gorm.DeletedAt `json:"deleted_at"`
}

type SlackNotifications

type SlackNotifications struct {
	Source    string         `gorm:"not null"`
	CoinID    string         `gorm:"not null"`
	DayDate   string         `gorm:"not null"`
	Date      int64          `gorm:"not null"`
	Counter   int            `gorm:"default:1"`
	CreatedAt time.Time      `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt time.Time      `gorm:"autoUpdateTime" json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`
}

Jump to

Keyboard shortcuts

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