entity

package
v0.0.0-...-7fd84a6 Latest Latest
Warning

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

Go to latest
Published: May 24, 2018 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

type Chart struct {
	Id         uint   `gorm:"primary_key;AUTO_INCREMENT"`
	UserId     uint   `gorm:"foreign_key;unique_index:idx_chart"`
	Base       string `gorm:"unique_index:idx_chart"`
	Quote      string `gorm:"unique_index:idx_chart"`
	Exchange   string `gorm:"unique_index:idx_chart"`
	Period     int
	AutoTrade  uint
	Indicators []ChartIndicator `gorm:"ForeignKey:ChartId"`
	Strategies []ChartStrategy  `gorm:"ForeignKey:ChartId"`
	Trades     []Trade          `gorm:"ForeignKey:ChartId"`
	User       User
	ChartEntity
}

func (*Chart) AddIndicator

func (entity *Chart) AddIndicator(indicator *ChartIndicator)

func (*Chart) AddStrategy

func (entity *Chart) AddStrategy(strategy *ChartStrategy)

func (*Chart) AddTrade

func (entity *Chart) AddTrade(trade Trade)

func (*Chart) GetAutoTrade

func (entity *Chart) GetAutoTrade() uint

func (*Chart) GetBase

func (entity *Chart) GetBase() string

func (*Chart) GetExchangeName

func (entity *Chart) GetExchangeName() string

func (*Chart) GetId

func (entity *Chart) GetId() uint

func (*Chart) GetIndicators

func (entity *Chart) GetIndicators() []ChartIndicator

func (*Chart) GetPeriod

func (entity *Chart) GetPeriod() int

func (*Chart) GetQuote

func (entity *Chart) GetQuote() string

func (*Chart) GetStrategies

func (entity *Chart) GetStrategies() []ChartStrategy

func (*Chart) GetTrades

func (entity *Chart) GetTrades() []Trade

func (*Chart) GetUserId

func (entity *Chart) GetUserId() uint

func (*Chart) IsAutoTrade

func (entity *Chart) IsAutoTrade() bool

func (*Chart) SetIndicators

func (entity *Chart) SetIndicators(indicators []ChartIndicator)

func (*Chart) SetStrategies

func (entity *Chart) SetStrategies(strategies []ChartStrategy)

func (*Chart) SetTrades

func (entity *Chart) SetTrades(trades []Trade)

type ChartEntity

type ChartEntity interface {
	GetId() uint
	GetUserId() uint
	GetBase() string
	GetQuote() string
	GetPeriod() int
	GetExchangeName() string
	IsAutoTrade() bool
	GetAutoTrade() uint
	SetIndicators(indicators []ChartIndicator)
	GetIndicators() []ChartIndicator
	AddIndicator(indicator *ChartIndicator)
	SetStrategies(strategies []ChartStrategy)
	GetStrategies() []ChartStrategy
	AddStrategy(strategy *ChartStrategy)
	SetTrades(trades []Trade)
	GetTrades() []Trade
	AddTrade(trade Trade)
}

type ChartIndicator

type ChartIndicator struct {
	Id         uint   `gorm:"primary_key"`
	ChartId    uint   `gorm:"foreign_key;unique_index:idx_chart_indicator"`
	Name       string `gorm:"unique_index:idx_chart_indicator"`
	Parameters string `gorm:"not null"`
}

func (*ChartIndicator) GetChartId

func (entity *ChartIndicator) GetChartId() uint

func (*ChartIndicator) GetId

func (entity *ChartIndicator) GetId() uint

func (*ChartIndicator) GetName

func (entity *ChartIndicator) GetName() string

func (*ChartIndicator) GetParameters

func (entity *ChartIndicator) GetParameters() string

type ChartIndicatorEntity

type ChartIndicatorEntity interface {
	GetId() uint
	GetChartId() uint
	GetName() string
	GetParameters() string
}

type ChartStrategy

type ChartStrategy struct {
	Id         uint   `gorm:"primary_key"`
	ChartId    uint   `gorm:"foreign_key;unique_index:idx_chart_strategy"`
	Name       string `gorm:"unique_index:idx_chart_strategy"`
	Parameters string `gorm:"not null"`
}

func (*ChartStrategy) GetChartId

func (entity *ChartStrategy) GetChartId() uint

func (*ChartStrategy) GetId

func (entity *ChartStrategy) GetId() uint

func (*ChartStrategy) GetName

func (entity *ChartStrategy) GetName() string

func (*ChartStrategy) GetParameters

func (entity *ChartStrategy) GetParameters() string

type ChartStrategyEntity

type ChartStrategyEntity interface {
	GetId() uint
	GetChartId() uint
	GetName() string
	GetParameters() string
}

type GlobalMarketCap

type GlobalMarketCap struct {
	TotalMarketCapUSD float64
	Total24HVolumeUSD float64
	BitcoinDominance  float64
	ActiveCurrencies  float64
	ActiveMarkets     float64
	LastUpdated       int64
}

type MarketCap

type MarketCap struct {
	Id               string `gorm:"index"`
	Name             string `gorm:"index"`
	Symbol           string `gorm:"primary_key"`
	Rank             string
	PriceUSD         string
	PriceBTC         string
	VolumeUSD24h     string
	MarketCapUSD     string
	AvailableSupply  string
	TotalSupply      string
	MaxSupply        string
	PercentChange1h  string
	PercentChange24h string
	PercentChange7d  string
	LastUpdated      string
}

type Plugin

type Plugin struct {
	Name     string `gorm:"primary_key"`
	Filename string `gorm:"unique;not null"`
	Version  string `gorm:"not null"`
	Type     string `gorm:"not null"`
	PluginEntity
}

func (*Plugin) GetFilename

func (entity *Plugin) GetFilename() string

func (*Plugin) GetName

func (entity *Plugin) GetName() string

func (*Plugin) GetType

func (entity *Plugin) GetType() string

func (*Plugin) GetVersion

func (entity *Plugin) GetVersion() string

type PluginEntity

type PluginEntity interface {
	GetName() string
	GetFilename() string
	GetVersion() string
	GetType() string
}

type PriceHistory

type PriceHistory struct {
	Time      int64   `json:"time"`
	Open      float64 `json:"open"`
	High      float64 `json:"high"`
	Low       float64 `json:"low"`
	Close     float64 `json:"close"`
	Volume    float64 `json:"volume"`
	MarketCap int64   `json:"marketCap"`
	PriceHistoryEntity
}

func (*PriceHistory) GetClose

func (ph *PriceHistory) GetClose() float64

func (*PriceHistory) GetHigh

func (ph *PriceHistory) GetHigh() float64

func (*PriceHistory) GetLow

func (ph *PriceHistory) GetLow() float64

func (*PriceHistory) GetMarketCap

func (ph *PriceHistory) GetMarketCap() int64

func (*PriceHistory) GetOpen

func (ph *PriceHistory) GetOpen() float64

func (*PriceHistory) GetTime

func (ph *PriceHistory) GetTime() int64

func (*PriceHistory) GetVolume

func (ph *PriceHistory) GetVolume() float64

type PriceHistoryEntity

type PriceHistoryEntity interface {
	GetTime() int64
	GetOpen() float64
	GetHigh() float64
	GetLow() float64
	GetClose() float64
	GetVolume() float64
	GetMarketCap() int64
}

type Profit

type Profit struct {
	Id       uint `gorm:"primary_key"`
	UserId   uint `gorm:"unique_index:idx_profit"`
	TradeId  uint `gorm:"foreign_key;unique_index:idx_profit"`
	Quantity string
	Bought   string
	Sold     string
	Fee      string
	Tax      string
	Total    string
	ProfitEntity
}

func (*Profit) GetBought

func (entity *Profit) GetBought() string

func (*Profit) GetFee

func (entity *Profit) GetFee() string

func (*Profit) GetId

func (entity *Profit) GetId() uint

func (*Profit) GetQuantity

func (entity *Profit) GetQuantity() string

func (*Profit) GetSold

func (entity *Profit) GetSold() string

func (*Profit) GetTax

func (entity *Profit) GetTax() string

func (*Profit) GetTotal

func (entity *Profit) GetTotal() string

func (*Profit) GetTradeId

func (entity *Profit) GetTradeId() uint

func (*Profit) GetUserId

func (entity *Profit) GetUserId() uint

type ProfitEntity

type ProfitEntity interface {
	GetId() uint
	GetUserId() uint
	GetTradeId() uint
	GetQuantity() string
	GetBought() string
	GetSold() string
	GetFee() string
	GetTax() string
	GetTotal() string
}

type Trade

type Trade struct {
	Id        uint   `gorm:"primary_key"`
	ChartId   uint   `gorm:"foreign_key"`
	UserId    uint   `gorm:"foreign_key;index"`
	Base      string `gorm:"index"`
	Quote     string `gorm:"index"`
	Exchange  string `gorm:"index"`
	Date      time.Time
	Type      string
	Price     string
	Amount    string
	ChartData string
	TradeEntity
}

func (*Trade) GetAmount

func (trade *Trade) GetAmount() string

func (*Trade) GetBase

func (trade *Trade) GetBase() string

func (*Trade) GetChartData

func (trade *Trade) GetChartData() string

func (*Trade) GetChartId

func (trade *Trade) GetChartId() uint

func (*Trade) GetDate

func (trade *Trade) GetDate() time.Time

func (*Trade) GetExchangeName

func (trade *Trade) GetExchangeName() string

func (*Trade) GetId

func (trade *Trade) GetId() uint

func (*Trade) GetPrice

func (trade *Trade) GetPrice() string

func (*Trade) GetQuote

func (trade *Trade) GetQuote() string

func (*Trade) GetType

func (trade *Trade) GetType() string

func (*Trade) GetUserId

func (trade *Trade) GetUserId() uint

type TradeEntity

type TradeEntity interface {
	GetId() uint
	GetChartId() uint
	GetUserId() uint
	GetBase() string
	GetQuote() string
	GetExchangeName() string
	GetDate() time.Time
	GetType() string
	GetPrice() string
	GetAmount() string
	GetChartData() string
}

type Transaction

type Transaction struct {
	Id                     string `gorm:"type:varchar(200);primary_key"`
	UserId                 uint
	Date                   time.Time
	MarketPair             string `gorm:"type:varchar(10)"`
	CurrencyPair           string `gorm:"type:varchar(10)"`
	Type                   string `gorm:"type:varchar(64)"`
	Category               string `gorm:"type:varchar(200)"`
	Network                string `gorm:"type:varchar(200)"`
	NetworkDisplayName     string `gorm:"type:varchar(200)"`
	Quantity               string `gorm:"type:varchar(64)"`
	QuantityCurrency       string `gorm:"type:varchar(6)"`
	FiatQuantity           string `gorm:"type:varchar(64)"`
	FiatQuantityCurrency   string `gorm:"type:varchar(6)"`
	Price                  string `gorm:"type:varchar(64)"`
	PriceCurrency          string `gorm:"type:varchar(6)"`
	FiatPrice              string `gorm:"type:varchar(64)"`
	FiatPriceCurrency      string `gorm:"type:varchar(6)"`
	QuoteFiatPrice         string `gorm:"type:varchar(64)"`
	QuoteFiatPriceCurrency string `gorm:"type:varchar(6)"`
	Fee                    string `gorm:"type:varchar(64)"`
	FeeCurrency            string `gorm:"type:varchar(6)"`
	FiatFee                string `gorm:"type:varchar(64)"`
	FiatFeeCurrency        string `gorm:"type:varchar(6)"`
	Total                  string `gorm:"type:varchar(64)"`
	TotalCurrency          string `gorm:"type:varchar(6)"`
	FiatTotal              string `gorm:"type:varchar(64)"`
	FiatTotalCurrency      string `gorm:"type:varchar(6)"`
	Deleted                int    `gorm:"type:integer;default:0"`
	TransactionEntity
}

func (*Transaction) GetCategory

func (tx *Transaction) GetCategory() string

func (*Transaction) GetCurrencyPair

func (tx *Transaction) GetCurrencyPair() string

func (*Transaction) GetDate

func (tx *Transaction) GetDate() time.Time

func (*Transaction) GetFee

func (tx *Transaction) GetFee() string

func (*Transaction) GetFeeCurrency

func (tx *Transaction) GetFeeCurrency() string

func (*Transaction) GetFiatFee

func (tx *Transaction) GetFiatFee() string

func (*Transaction) GetFiatFeeCurrency

func (tx *Transaction) GetFiatFeeCurrency() string

func (*Transaction) GetFiatPrice

func (tx *Transaction) GetFiatPrice() string

func (*Transaction) GetFiatPriceCurrency

func (tx *Transaction) GetFiatPriceCurrency() string

func (*Transaction) GetFiatQuantity

func (tx *Transaction) GetFiatQuantity() string

func (*Transaction) GetFiatQuantityCurrency

func (tx *Transaction) GetFiatQuantityCurrency() string

func (*Transaction) GetFiatTotal

func (tx *Transaction) GetFiatTotal() string

func (*Transaction) GetFiatTotalCurrency

func (tx *Transaction) GetFiatTotalCurrency() string

func (*Transaction) GetId

func (tx *Transaction) GetId() string

func (*Transaction) GetMarketPair

func (tx *Transaction) GetMarketPair() string

func (*Transaction) GetNetwork

func (tx *Transaction) GetNetwork() string

func (*Transaction) GetNetworkDisplayName

func (tx *Transaction) GetNetworkDisplayName() string

func (*Transaction) GetPrice

func (tx *Transaction) GetPrice() string

func (*Transaction) GetPriceCurrency

func (tx *Transaction) GetPriceCurrency() string

func (*Transaction) GetQuantity

func (tx *Transaction) GetQuantity() string

func (*Transaction) GetQuantityCurrency

func (tx *Transaction) GetQuantityCurrency() string

func (*Transaction) GetQuoteFiatPrice

func (tx *Transaction) GetQuoteFiatPrice() string

func (*Transaction) GetQuoteFiatPriceCurrency

func (tx *Transaction) GetQuoteFiatPriceCurrency() string

func (*Transaction) GetTotal

func (tx *Transaction) GetTotal() string

func (*Transaction) GetTotalCurrency

func (tx *Transaction) GetTotalCurrency() string

func (*Transaction) GetType

func (tx *Transaction) GetType() string

func (*Transaction) GetUserId

func (tx *Transaction) GetUserId() uint

func (*Transaction) IsDeleted

func (tx *Transaction) IsDeleted() bool

func (*Transaction) SetCategory

func (tx *Transaction) SetCategory(category string)

func (*Transaction) SetDeleted

func (tx *Transaction) SetDeleted(value int)

type TransactionEntity

type TransactionEntity interface {
	GetId() string
	GetUserId() uint
	GetDate() time.Time
	GetMarketPair() string
	GetCurrencyPair() string
	GetType() string
	GetCategory() string
	SetCategory(category string)
	GetNetwork() string
	GetNetworkDisplayName() string
	GetQuantity() string
	GetQuantityCurrency() string
	GetFiatQuantity() string
	GetFiatQuantityCurrency() string
	GetPrice() string
	GetPriceCurrency() string
	GetFiatPrice() string
	GetFiatPriceCurrency() string
	GetQuoteFiatPrice() string
	GetQuoteFiatPriceCurrency() string
	GetFee() string
	GetFeeCurrency() string
	GetTotal() string
	GetTotalCurrency() string
	GetFiatFee() string
	GetFiatFeeCurrency() string
	GetFiatTotal() string
	GetFiatTotalCurrency() string
	IsDeleted() bool
	SetDeleted(value int)
}

type User

type User struct {
	Id            uint   `gorm:"primary_key;AUTO_INCREMENT"`
	Username      string `gorm:"type:varchar(100);unique_index"`
	LocalCurrency string `gorm:"type:varchar(5)"`
	FiatExchange  string
	Etherbase     string `gorm:"type:varchar(160)"`
	Keystore      string
	Charts        []Chart
	Wallets       []UserWallet
	Tokens        []UserToken
	Exchanges     []UserCryptoExchange
	UserEntity
}

func (*User) GetCharts

func (entity *User) GetCharts() []Chart

func (*User) GetEtherbase

func (entity *User) GetEtherbase() string

func (*User) GetExchanges

func (entity *User) GetExchanges() []UserCryptoExchange

func (*User) GetFiatExchange

func (entity *User) GetFiatExchange() string

func (*User) GetId

func (entity *User) GetId() uint

func (*User) GetKeystore

func (entity *User) GetKeystore() string

func (*User) GetLocalCurrency

func (entity *User) GetLocalCurrency() string

func (*User) GetTokens

func (entity *User) GetTokens() []UserToken

func (*User) GetUsername

func (entity *User) GetUsername() string

func (*User) GetWallets

func (entity *User) GetWallets() []UserWallet

type UserCryptoExchange

type UserCryptoExchange struct {
	UserID  uint   `gorm:"type:integer;primary_key"`
	Name    string `gorm:"type:varchar(200);primary_key"`
	Key     string `gorm:"not null" sql:"type:varchar(255)"`
	Secret  string `gorm:"not null" sql:"type:text"`
	Markets string `sql:"type:text"`
	Extra   string `gorm:"not null" sql:"type:varchar(255)"`
	UserExchangeEntity
}

func (*UserCryptoExchange) GetExtra

func (entity *UserCryptoExchange) GetExtra() string

func (*UserCryptoExchange) GetKey

func (entity *UserCryptoExchange) GetKey() string

func (*UserCryptoExchange) GetMarkets

func (entity *UserCryptoExchange) GetMarkets() string

func (*UserCryptoExchange) GetName

func (entity *UserCryptoExchange) GetName() string

func (*UserCryptoExchange) GetSecret

func (entity *UserCryptoExchange) GetSecret() string

func (*UserCryptoExchange) GetUserID

func (entity *UserCryptoExchange) GetUserID() uint

type UserEntity

type UserEntity interface {
	GetId() uint
	GetUsername() string
	GetLocalCurrency() string
	GetFiatExchange() string
	GetEtherbase() string
	GetKeystore() string
	GetWallets() []UserWallet
	GetExchanges() []UserCryptoExchange
}

type UserExchangeEntity

type UserExchangeEntity interface {
	GetUserID() uint
	GetName() string
	GetKey() string
	GetSecret() string
	GetExtra() string
}

type UserToken

type UserToken struct {
	UserId          uint
	Symbol          string `gorm:"primary_key"`
	ContractAddress string `gorm:"unique_index"`
	WalletAddress   string
	UserTokenEntity
}

func (*UserToken) GetContractAddress

func (entity *UserToken) GetContractAddress() string

func (*UserToken) GetSymbol

func (entity *UserToken) GetSymbol() string

func (*UserToken) GetUserId

func (entity *UserToken) GetUserId() uint

func (*UserToken) GetWalletAddress

func (entity *UserToken) GetWalletAddress() string

type UserTokenEntity

type UserTokenEntity interface {
	GetUserId() uint
	GetSymbol() string
	GetContractAddress() string
	GetWalletAddress() string
}

type UserWallet

type UserWallet struct {
	UserId   uint
	Currency string `gorm:"primary_key"`
	Address  string `gorm:"primary_key"`
	Native   uint
	UserWalletEntity
}

func (*UserWallet) GetAddress

func (entity *UserWallet) GetAddress() string

func (*UserWallet) GetCurrency

func (entity *UserWallet) GetCurrency() string

func (*UserWallet) GetUserId

func (entity *UserWallet) GetUserId() uint

func (*UserWallet) IsNative

func (entity *UserWallet) IsNative() bool

type UserWalletEntity

type UserWalletEntity interface {
	GetUserId() uint
	GetCurrency() string
	GetAddress() string
	IsNative() bool
}

Jump to

Keyboard shortcuts

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