dao

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartDAO

type ChartDAO interface {
	Create(chart entity.ChartEntity) error
	Save(chart entity.ChartEntity) error
	Update(chart entity.ChartEntity) error
	Find(user common.UserContext, autoTradeOnly bool) ([]entity.Chart, error)
	Get(id uint) (entity.ChartEntity, error)
	GetIndicators(chart entity.ChartEntity) ([]entity.ChartIndicator, error)
	GetStrategies(chart entity.ChartEntity) ([]entity.ChartStrategy, error)
	GetTrades(user common.UserContext) ([]entity.Trade, error)
	GetLastTrade(chart entity.ChartEntity) (entity.TradeEntity, error)
}

func NewChartDAO

func NewChartDAO(ctx common.Context) ChartDAO

type ChartDAOImpl

type ChartDAOImpl struct {
	ChartDAO
	// contains filtered or unexported fields
}

func (*ChartDAOImpl) Create

func (chartDAO *ChartDAOImpl) Create(chart entity.ChartEntity) error

func (*ChartDAOImpl) Find

func (chartDAO *ChartDAOImpl) Find(user common.UserContext, autoTradeonly bool) ([]entity.Chart, error)

func (*ChartDAOImpl) Get

func (chartDAO *ChartDAOImpl) Get(id uint) (entity.ChartEntity, error)

func (*ChartDAOImpl) GetIndicators

func (chartDAO *ChartDAOImpl) GetIndicators(chart entity.ChartEntity) ([]entity.ChartIndicator, error)

func (*ChartDAOImpl) GetLastTrade

func (chartDAO *ChartDAOImpl) GetLastTrade(chart entity.ChartEntity) (entity.TradeEntity, error)

func (*ChartDAOImpl) GetStrategies

func (chartDAO *ChartDAOImpl) GetStrategies(chart entity.ChartEntity) ([]entity.ChartStrategy, error)

func (*ChartDAOImpl) GetTrades

func (chartDAO *ChartDAOImpl) GetTrades(user common.UserContext) ([]entity.Trade, error)

func (*ChartDAOImpl) Save

func (chartDAO *ChartDAOImpl) Save(chart entity.ChartEntity) error

func (*ChartDAOImpl) Update

func (chartDAO *ChartDAOImpl) Update(chart entity.ChartEntity) error

type ChartIndicatorDAO

type ChartIndicatorDAO interface {
	Create(indicator entity.ChartIndicatorEntity) error
	Save(indicator entity.ChartIndicatorEntity) error
	Update(indicator entity.ChartIndicatorEntity) error
	Find(chart entity.ChartEntity) ([]entity.ChartIndicator, error)
	Get(chart entity.ChartEntity, indicatorName string) (entity.ChartIndicatorEntity, error)
}

func NewChartIndicatorDAO

func NewChartIndicatorDAO(ctx common.Context) ChartIndicatorDAO

type ChartIndicatorDAOImpl

type ChartIndicatorDAOImpl struct {
	ChartIndicatorDAO
	// contains filtered or unexported fields
}

func (*ChartIndicatorDAOImpl) Create

func (dao *ChartIndicatorDAOImpl) Create(indicator entity.ChartIndicatorEntity) error

func (*ChartIndicatorDAOImpl) Find

func (*ChartIndicatorDAOImpl) Get

func (*ChartIndicatorDAOImpl) Save

func (*ChartIndicatorDAOImpl) Update

func (dao *ChartIndicatorDAOImpl) Update(indicator entity.ChartIndicatorEntity) error

type ChartStrategyDAO

type ChartStrategyDAO interface {
	Create(indicator entity.ChartStrategyEntity) error
	Save(indicator entity.ChartStrategyEntity) error
	Update(indicator entity.ChartStrategyEntity) error
	Find(chart entity.ChartEntity) ([]entity.ChartStrategy, error)
	Get(chart entity.ChartEntity, strategyName string) (entity.ChartStrategyEntity, error)
}

func NewChartStrategyDAO

func NewChartStrategyDAO(ctx common.Context) ChartStrategyDAO

type ChartStrategyDAOImpl

type ChartStrategyDAOImpl struct {
	ChartStrategyDAO
	// contains filtered or unexported fields
}

func (*ChartStrategyDAOImpl) Create

func (dao *ChartStrategyDAOImpl) Create(indicator entity.ChartStrategyEntity) error

func (*ChartStrategyDAOImpl) Find

func (*ChartStrategyDAOImpl) Get

func (*ChartStrategyDAOImpl) Save

func (*ChartStrategyDAOImpl) Update

func (dao *ChartStrategyDAOImpl) Update(indicator entity.ChartStrategyEntity) error

type Config

type Config struct {
	Key   string `gorm:"primary_key"`
	Value string `gorm:"not null"`
}

type Configuration

type Configuration interface {
	Get(key string) string
}

type ConfigurationDAO

type ConfigurationDAO struct {
	Items []Config
	Configuration
}

func NewConfigurationDAO

func NewConfigurationDAO(db *gorm.DB, logger *logging.Logger) *ConfigurationDAO

func (*ConfigurationDAO) Get

func (dao *ConfigurationDAO) Get(key string) string

type MarketCapDAO

type MarketCapDAO struct {
	// contains filtered or unexported fields
}

func NewMarketCapDAO

func NewMarketCapDAO(ctx common.Context) *MarketCapDAO

func (*MarketCapDAO) Delete

func (dao *MarketCapDAO) Delete(symbol string) error

func (*MarketCapDAO) Get

func (dao *MarketCapDAO) Get(symbol string) (*common.MarketCap, error)

type PluginDAO

type PluginDAO interface {
	Create(plugin entity.PluginEntity) error
	Save(plugin entity.PluginEntity) error
	Update(plugin entity.PluginEntity) error
	Find(pluginType string) ([]entity.Plugin, error)
	Get(pluginName, pluginType string) (entity.PluginEntity, error)
}

func NewPluginDAO

func NewPluginDAO(ctx common.Context) PluginDAO

type PluginDAOImpl

type PluginDAOImpl struct {
	PluginDAO
	// contains filtered or unexported fields
}

func (*PluginDAOImpl) Create

func (dao *PluginDAOImpl) Create(indicator entity.PluginEntity) error

func (*PluginDAOImpl) Find

func (dao *PluginDAOImpl) Find(pluginType string) ([]entity.Plugin, error)

func (*PluginDAOImpl) Get

func (dao *PluginDAOImpl) Get(pluginName, pluginType string) (entity.PluginEntity, error)

func (*PluginDAOImpl) Save

func (dao *PluginDAOImpl) Save(indicator entity.PluginEntity) error

func (*PluginDAOImpl) Update

func (dao *PluginDAOImpl) Update(indicator entity.PluginEntity) error

type PriceHistoryDAO

type PriceHistoryDAO interface {
}

func NewPriceHistoryDAO

func NewPriceHistoryDAO(ctx common.Context) PriceHistoryDAO

type PriceHistoryDAOImpl

type PriceHistoryDAOImpl struct {
	// contains filtered or unexported fields
}

func (*PriceHistoryDAOImpl) Create

func (phDAO *PriceHistoryDAOImpl) Create(priceHistory entity.PriceHistoryEntity) error

func (*PriceHistoryDAOImpl) Save

func (phDAO *PriceHistoryDAOImpl) Save(priceHistory entity.PriceHistoryEntity) error

func (*PriceHistoryDAOImpl) Update

func (phDAO *PriceHistoryDAOImpl) Update(priceHistory entity.PriceHistoryEntity) error

type ProfitDAO

type ProfitDAO interface {
	Create(profit entity.ProfitEntity) error
	Save(profit entity.ProfitEntity) error
	Find() ([]entity.Profit, error)
	GetByTrade(trade entity.TradeEntity) (entity.ProfitEntity, error)
}

func NewProfitDAO

func NewProfitDAO(ctx common.Context) ProfitDAO

type ProfitDAOImpl

type ProfitDAOImpl struct {
	ProfitDAO
	// contains filtered or unexported fields
}

func (*ProfitDAOImpl) Create

func (dao *ProfitDAOImpl) Create(profit entity.ProfitEntity) error

func (*ProfitDAOImpl) Find

func (dao *ProfitDAOImpl) Find() ([]entity.Profit, error)

func (*ProfitDAOImpl) GetByTrade

func (dao *ProfitDAOImpl) GetByTrade(trade entity.TradeEntity) (entity.ProfitEntity, error)

func (*ProfitDAOImpl) Save

func (dao *ProfitDAOImpl) Save(profit entity.ProfitEntity) error

type TradeDAO

type TradeDAO interface {
	Create(trade entity.TradeEntity)
	Save(trade entity.TradeEntity)
	Update(trade entity.TradeEntity)
	Find(user common.UserContext) []entity.Trade
	FindByChart(chart entity.ChartEntity) []entity.Trade
	GetLastTrade(chart entity.ChartEntity) entity.TradeEntity
}

func NewTradeDAO

func NewTradeDAO(ctx common.Context) TradeDAO

type TradeDAOImpl

type TradeDAOImpl struct {
	TradeDAO
	// contains filtered or unexported fields
}

func (*TradeDAOImpl) Create

func (dao *TradeDAOImpl) Create(trade entity.TradeEntity)

func (*TradeDAOImpl) Find

func (dao *TradeDAOImpl) Find(user common.UserContext) []entity.Trade

func (*TradeDAOImpl) Save

func (dao *TradeDAOImpl) Save(trade entity.TradeEntity)

func (*TradeDAOImpl) Update

func (dao *TradeDAOImpl) Update(trade entity.TradeEntity)

type TransactionDAO

type TransactionDAO interface {
	Create(Transaction entity.TransactionEntity) error
	Save(Transaction entity.TransactionEntity) error
	Update(tx entity.TransactionEntity, field, value string) error
	Get(id string) (entity.TransactionEntity, error)
	Find(order string) ([]entity.Transaction, error)
}

func NewTransactionDAO

func NewTransactionDAO(ctx common.Context) TransactionDAO

type TransactionDAOImpl

type TransactionDAOImpl struct {
	TransactionDAO
	// contains filtered or unexported fields
}

func (*TransactionDAOImpl) Create

func (*TransactionDAOImpl) Find

func (dao *TransactionDAOImpl) Find(direction string) ([]entity.Transaction, error)

func (*TransactionDAOImpl) Get

func (*TransactionDAOImpl) Save

func (*TransactionDAOImpl) Update

func (dao *TransactionDAOImpl) Update(tx entity.TransactionEntity, field, value string) error

type UserDAO

type UserDAO interface {
	GetUsername() string
	GetById(userId uint) (entity.UserEntity, error)
	GetByName(username string) (entity.UserEntity, error)
	Create(user entity.UserEntity) error
	Save(user entity.UserEntity) error
	Update(user entity.UserEntity) error
	Find() ([]entity.User, error)
	GetWallets(user entity.UserEntity) []entity.UserWallet
	GetWallet(user entity.UserEntity, currency string) entity.UserWalletEntity
	GetTokens(user entity.UserEntity) []entity.UserToken
	GetToken(user entity.UserEntity, symbol string) entity.UserTokenEntity
	GetExchanges(user entity.UserEntity) []entity.UserCryptoExchange
	GetExchange(user entity.UserEntity, exchangeName string) (entity.UserExchangeEntity, error)
	CreateExchange(userExchange entity.UserExchangeEntity) error
	DeleteExchange(userExchange entity.UserExchangeEntity) error
	CreateToken(userToken entity.UserTokenEntity) error
	CreateWallet(userWallet entity.UserWalletEntity) error
}

func CreateUserDAO

func CreateUserDAO(ctx common.Context, user common.UserContext) UserDAO

func NewUserDAO

func NewUserDAO(ctx common.Context) UserDAO

type UserDAOImpl

type UserDAOImpl struct {
	UserDAO
	// contains filtered or unexported fields
}

func (*UserDAOImpl) Create

func (dao *UserDAOImpl) Create(user entity.UserEntity) error

func (*UserDAOImpl) CreateExchange

func (dao *UserDAOImpl) CreateExchange(userExchange entity.UserExchangeEntity) error

func (*UserDAOImpl) CreateToken

func (dao *UserDAOImpl) CreateToken(userToken entity.UserTokenEntity) error

func (*UserDAOImpl) CreateWallet

func (dao *UserDAOImpl) CreateWallet(userWallet entity.UserWalletEntity) error

func (*UserDAOImpl) DeleteExchange

func (dao *UserDAOImpl) DeleteExchange(userExchange entity.UserExchangeEntity) error

func (*UserDAOImpl) Find

func (dao *UserDAOImpl) Find() ([]entity.User, error)

func (*UserDAOImpl) GetById

func (dao *UserDAOImpl) GetById(userId uint) (entity.UserEntity, error)

func (*UserDAOImpl) GetByName

func (dao *UserDAOImpl) GetByName(username string) (entity.UserEntity, error)

func (*UserDAOImpl) GetExchange

func (dao *UserDAOImpl) GetExchange(user entity.UserEntity, exchangeName string) (entity.UserExchangeEntity, error)

func (*UserDAOImpl) GetExchanges

func (dao *UserDAOImpl) GetExchanges(user entity.UserEntity) []entity.UserCryptoExchange

func (*UserDAOImpl) GetToken

func (dao *UserDAOImpl) GetToken(user entity.UserEntity, symbol string) entity.UserTokenEntity

func (*UserDAOImpl) GetTokens

func (dao *UserDAOImpl) GetTokens(user entity.UserEntity) []entity.UserToken

func (*UserDAOImpl) GetWallet

func (dao *UserDAOImpl) GetWallet(user entity.UserEntity, currency string) entity.UserWalletEntity

func (*UserDAOImpl) GetWallets

func (dao *UserDAOImpl) GetWallets(user entity.UserEntity) []entity.UserWallet

func (*UserDAOImpl) Save

func (dao *UserDAOImpl) Save(user entity.UserEntity) error

Jump to

Keyboard shortcuts

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