mysql

package
v0.0.0-...-55a620b Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SharedStore

func SharedStore() models.Store

Types

type Store

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

func NewStore

func NewStore(db *gorm.DB) *Store

func (*Store) AddAccount

func (s *Store) AddAccount(account *models.Account) error

func (*Store) AddBills

func (s *Store) AddBills(bills []*models.Bill) error

func (*Store) AddFills

func (s *Store) AddFills(fills []*models.Fill) error

func (*Store) AddOrder

func (s *Store) AddOrder(order *models.Order) error

func (*Store) AddTicks

func (s *Store) AddTicks(ticks []*models.Tick) error

func (*Store) AddTrades

func (s *Store) AddTrades(trades []*models.Trade) error

func (*Store) AddUser

func (s *Store) AddUser(user *models.User) error

func (*Store) BeginTx

func (s *Store) BeginTx() (models.Store, error)

func (*Store) CommitTx

func (s *Store) CommitTx() error

func (*Store) GetAccount

func (s *Store) GetAccount(userId int64, currency string) (*models.Account, error)

func (*Store) GetAccountForUpdate

func (s *Store) GetAccountForUpdate(userId int64, currency string) (*models.Account, error)

func (*Store) GetAccountsByUserId

func (s *Store) GetAccountsByUserId(userId int64) ([]*models.Account, error)

func (*Store) GetConfigs

func (s *Store) GetConfigs() ([]*models.Config, error)

func (*Store) GetLastFillByProductId

func (s *Store) GetLastFillByProductId(productId string) (*models.Fill, error)

func (*Store) GetLastTickByProductId

func (s *Store) GetLastTickByProductId(productId string, granularity int64) (*models.Tick, error)

func (*Store) GetLastTradeByProductId

func (s *Store) GetLastTradeByProductId(productId string) (*models.Trade, error)

func (*Store) GetOrderByClientOid

func (s *Store) GetOrderByClientOid(userId int64, clientOid string) (*models.Order, error)

func (*Store) GetOrderById

func (s *Store) GetOrderById(orderId int64) (*models.Order, error)

func (*Store) GetOrderByIdForUpdate

func (s *Store) GetOrderByIdForUpdate(orderId int64) (*models.Order, error)

func (*Store) GetOrdersByUserId

func (s *Store) GetOrdersByUserId(userId int64, statuses []models.OrderStatus, side *models.Side, productId string,
	beforeId, afterId int64, limit int) ([]*models.Order, error)

func (*Store) GetProductById

func (s *Store) GetProductById(id string) (*models.Product, error)

func (*Store) GetProducts

func (s *Store) GetProducts() ([]*models.Product, error)

func (*Store) GetTicksByProductId

func (s *Store) GetTicksByProductId(productId string, granularity int64, limit int) ([]*models.Tick, error)

func (*Store) GetTradesByProductId

func (s *Store) GetTradesByProductId(productId string, count int) ([]*models.Trade, error)

func (*Store) GetUnsettledBills

func (s *Store) GetUnsettledBills() ([]*models.Bill, error)

func (*Store) GetUnsettledBillsByUserId

func (s *Store) GetUnsettledBillsByUserId(userId int64, currency string) ([]*models.Bill, error)

func (*Store) GetUnsettledFills

func (s *Store) GetUnsettledFills(count int32) ([]*models.Fill, error)

func (*Store) GetUnsettledFillsByOrderId

func (s *Store) GetUnsettledFillsByOrderId(orderId int64) ([]*models.Fill, error)

func (*Store) GetUserByEmail

func (s *Store) GetUserByEmail(email string) (*models.User, error)

func (*Store) Rollback

func (s *Store) Rollback() error

func (*Store) UpdateAccount

func (s *Store) UpdateAccount(account *models.Account) error

func (*Store) UpdateBill

func (s *Store) UpdateBill(bill *models.Bill) error

func (*Store) UpdateFill

func (s *Store) UpdateFill(fill *models.Fill) error

func (*Store) UpdateOrder

func (s *Store) UpdateOrder(order *models.Order) error

func (*Store) UpdateOrderStatus

func (s *Store) UpdateOrderStatus(orderId int64, oldStatus, newStatus models.OrderStatus) (bool, error)

func (*Store) UpdateUser

func (s *Store) UpdateUser(user *models.User) error

Jump to

Keyboard shortcuts

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