Documentation
¶
Overview ¶
Package db contains symbol related CRUD functionality.
Index ¶
- type Agent
- func (s Agent) Create(ctx context.Context, sbl Symbol) error
- func (s Agent) Query(ctx context.Context, pageNumber int, rowsPerPage int) ([]Symbol, error)
- func (s Agent) QueryByID(ctx context.Context, sblID string) (Symbol, error)
- func (s Agent) QueryBySymbol(ctx context.Context, sSbl string) (Symbol, error)
- func (s Agent) Tran(tx sqlx.ExtContext) Agent
- func (s Agent) WithinTran(ctx context.Context, fn func(sqlx.ExtContext) error) error
- type Symbol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent manages the set of API's for candle access.
func NewAgent ¶
func NewAgent(log *zap.SugaredLogger, db *sqlx.DB) Agent
NewAgent constructs a data for api access.
func (Agent) QueryBySymbol ¶
QueryBySymbol gets the specified symbols from the database.
func (Agent) Tran ¶
func (s Agent) Tran(tx sqlx.ExtContext) Agent
Tran return new Agent with transaction in it.
func (Agent) WithinTran ¶
WithinTran runs passed function and do commit/rollback at the end.
type Symbol ¶
type Symbol struct { ID string `db:"symbol_id"` Symbol string `db:"symbol"` Status string `db:"status"` BaseAsset string `db:"base_asset"` BaseAssetPrecision int `db:"base_asset_precision"` QuoteAsset string `db:"quote_asset"` QuotePrecision int `db:"quote_precision"` BaseCommissionPrecision int `db:"base_commission_precision"` QuoteCommissionPrecision int `db:"quote_commission_precision"` IcebergAllowed bool `db:"iceberg_allowed"` OcoAllowed bool `db:"oco_allowed"` QuoteOrderQtyMarketAllowed bool `db:"quote_order_qty_market_allowed"` IsSpotTradingAllowed bool `db:"is_spot_trading_allowed"` IsMarginTradingAllowed bool `db:"is_margin_trading_allowed"` }
Symbol is a function whereby you have two different currencies that can be traded between one another. When buying and selling a cryptocurrency, it is often swapped with local currency. For example, If you're looking to buy or sell Bitcoin with U.S. Dollar, the trading pair would be BTC to USD
Click to show internal directories.
Click to hide internal directories.