Documentation
¶
Index ¶
- Constants
- func CaptureEndpointPage(ctx context.Context, continuation kiwoomspecs.Continuation, ...) (*kiwoomspecs.EndpointPage, error)
- func GetTokenManager() tokencache.Manager
- type Client
- func (c *Client) Authenticate(ctx context.Context, creds broker.Credentials) (*broker.Token, error)
- func (c *Client) CallDocumentedEndpoint(ctx context.Context, apiID, path string, body any, allowedCodes ...int) (any, error)
- func (c *Client) CancelStockOrder(ctx context.Context, req kiwoomspecs.KiwoomApiDostkOrdrKt10003Request) (*kiwoomspecs.KiwoomApiDostkOrdrKt10003Response, error)
- func (c *Client) InquireBalance(ctx context.Context, exchange string) (*kiwoomspecs.KiwoomApiDostkAcntKt00005Response, error)
- func (c *Client) InquireBalanceByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00005Request) (*kiwoomspecs.KiwoomApiDostkAcntKt00005Response, error)
- func (c *Client) InquireBondPositions(ctx context.Context, exchange string) (*kiwoomspecs.KiwoomApiDostkAcntKt00018Response, error)
- func (c *Client) InquireChangeRateRank(ctx context.Context, req kiwoomspecs.KiwoomApiDostkRkinfoKa10027Request) (*kiwoomspecs.KiwoomApiDostkRkinfoKa10027Response, error)
- func (c *Client) InquireDailyPrice(ctx context.Context, symbol, baseDate string) (*kiwoomspecs.KiwoomApiDostkChartKa10081Response, error)
- func (c *Client) InquireDailyPriceByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10081Request) (*kiwoomspecs.KiwoomApiDostkChartKa10081Response, error)
- func (c *Client) InquireExecutionInfo(ctx context.Context, req kiwoomspecs.KiwoomApiDostkStkinfoKa10003Request) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10003Response, error)
- func (c *Client) InquireInstrumentInfo(ctx context.Context, symbol string) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10100Response, error)
- func (c *Client) InquireInstrumentInfoByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkStkinfoKa10100Request) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10100Response, error)
- func (c *Client) InquireInvestorByStock(ctx context.Context, req kiwoomspecs.KiwoomApiDostkStkinfoKa10059Request) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10059Response, error)
- func (c *Client) InquireInvestorByStockChart(ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10060Request) (*kiwoomspecs.KiwoomApiDostkChartKa10060Response, error)
- func (c *Client) InquireMonthlyPrice(ctx context.Context, symbol, baseDate string) (*kiwoomspecs.KiwoomApiDostkChartKa10083Response, error)
- func (c *Client) InquireMonthlyPriceByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10083Request) (*kiwoomspecs.KiwoomApiDostkChartKa10083Response, error)
- func (c *Client) InquireOrderBook(ctx context.Context, req kiwoomspecs.KiwoomApiDostkMrkcondKa10004Request) (*kiwoomspecs.KiwoomApiDostkMrkcondKa10004Response, error)
- func (c *Client) InquireOrderExecutionDetail(ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00007Request) (*kiwoomspecs.KiwoomApiDostkAcntKt00007Response, error)
- func (c *Client) InquireOrderExecutionStatus(ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00009Request) (*kiwoomspecs.KiwoomApiDostkAcntKt00009Response, error)
- func (c *Client) InquireOrderExecutions(ctx context.Context, symbol string) (*kiwoomspecs.KiwoomApiDostkAcntKa10076Response, error)
- func (c *Client) InquireOrderExecutionsByExchange(ctx context.Context, symbol, exchangeType string) (*kiwoomspecs.KiwoomApiDostkAcntKa10076Response, error)
- func (c *Client) InquireOrderExecutionsByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKa10076Request) (*kiwoomspecs.KiwoomApiDostkAcntKa10076Response, error)
- func (c *Client) InquireOrderableWithdrawable(ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00010Request) (*kiwoomspecs.KiwoomApiDostkAcntKt00010Response, error)
- func (c *Client) InquirePositions(ctx context.Context, queryType, exchange string) (*kiwoomspecs.KiwoomApiDostkAcntKt00018Response, error)
- func (c *Client) InquirePositionsByAsset(ctx context.Context, queryType, exchange, stockBondType string) (*kiwoomspecs.KiwoomApiDostkAcntKt00018Response, error)
- func (c *Client) InquirePositionsByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00018Request) (*kiwoomspecs.KiwoomApiDostkAcntKt00018Response, error)
- func (c *Client) InquirePrice(ctx context.Context, symbol string) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10001Response, error)
- func (c *Client) InquirePriceByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkStkinfoKa10001Request) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10001Response, error)
- func (c *Client) InquireSectorByPrice(ctx context.Context, req kiwoomspecs.KiwoomApiDostkSectKa20002Request) (*kiwoomspecs.KiwoomApiDostkSectKa20002Response, error)
- func (c *Client) InquireSectorCurrent(ctx context.Context, req kiwoomspecs.KiwoomApiDostkSectKa20001Request) (*kiwoomspecs.KiwoomApiDostkSectKa20001Response, error)
- func (c *Client) InquireTickChart(ctx context.Context, symbol, baseDate string) (*kiwoomspecs.KiwoomApiDostkChartKa10079Response, error)
- func (c *Client) InquireTickChartByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10079Request) (*kiwoomspecs.KiwoomApiDostkChartKa10079Response, error)
- func (c *Client) InquireUnsettledOrders(ctx context.Context, symbol string) (*kiwoomspecs.KiwoomApiDostkAcntKa10075Response, error)
- func (c *Client) InquireUnsettledOrdersByExchange(ctx context.Context, symbol, exchangeType string) (*kiwoomspecs.KiwoomApiDostkAcntKa10075Response, error)
- func (c *Client) InquireUnsettledOrdersByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKa10075Request) (*kiwoomspecs.KiwoomApiDostkAcntKa10075Response, error)
- func (c *Client) InquireVolumeRank(ctx context.Context, req kiwoomspecs.KiwoomApiDostkRkinfoKa10030Request) (*kiwoomspecs.KiwoomApiDostkRkinfoKa10030Response, error)
- func (c *Client) InquireWeeklyPrice(ctx context.Context, symbol, baseDate string) (*kiwoomspecs.KiwoomApiDostkChartKa10082Response, error)
- func (c *Client) InquireWeeklyPriceByRequest(ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10082Request) (*kiwoomspecs.KiwoomApiDostkChartKa10082Response, error)
- func (c *Client) ModifyStockOrder(ctx context.Context, req kiwoomspecs.KiwoomApiDostkOrdrKt10002Request) (*kiwoomspecs.KiwoomApiDostkOrdrKt10002Response, error)
- func (c *Client) Name() string
- func (c *Client) PlaceBuyOrder(ctx context.Context, req kiwoomspecs.KiwoomApiDostkOrdrKt10000Request) (*kiwoomspecs.KiwoomApiDostkOrdrKt10000Response, error)
- func (c *Client) PlaceSellOrder(ctx context.Context, req kiwoomspecs.KiwoomApiDostkOrdrKt10001Request) (*kiwoomspecs.KiwoomApiDostkOrdrKt10000Response, error)
- func (c *Client) PlaceStockOrder(ctx context.Context, side StockOrderSide, ...) (*kiwoomspecs.KiwoomApiDostkOrdrKt10000Response, error)
- func (c *Client) SetBaseURL(baseURL string)
- func (c *Client) SetCredentials(appKey, appSecret string)
- func (c *Client) SetLogger(l *slog.Logger)
- type FileTokenManager
- type StockOrderSide
- type TokenResponse
Constants ¶
const ( // BaseURLReal is Kiwoom production REST domain. BaseURLReal = "https://api.kiwoom.com" // BaseURLSandbox is Kiwoom mock REST domain. BaseURLSandbox = "https://mockapi.kiwoom.com" )
const ( PathPrefixAPI = "/api" PathPrefixAPISlash = "/api/" )
Kiwoom REST path prefixes.
const ( PathStockInfo = "/api/dostk/stkinfo" PathMarketCond = "/api/dostk/mrkcond" PathForeignInst = "/api/dostk/frgnistt" PathRankingInfo = "/api/dostk/rkinfo" PathSector = "/api/dostk/sect" PathELW = "/api/dostk/elw" PathETF = "/api/dostk/etf" PathTheme = "/api/dostk/thme" PathSLB = "/api/dostk/slb" PathShortSell = "/api/dostk/shsa" PathAccount = "/api/dostk/acnt" PathChart = "/api/dostk/chart" PathOrder = "/api/dostk/ordr" PathCreditOrder = "/api/dostk/crdordr" //nolint:gosec // G101: URL path constant, not a credential PathWebSocket = "/api/dostk/websocket" )
Kiwoom endpoint paths.
Variables ¶
This section is empty.
Functions ¶
func CaptureEndpointPage ¶ added in v0.28.0
func CaptureEndpointPage(ctx context.Context, continuation kiwoomspecs.Continuation, call func(context.Context) (any, error)) (*kiwoomspecs.EndpointPage, error)
CaptureEndpointPage preserves the existing typed endpoint preparation and validation while collecting the headers from its single HTTP request. The capture belongs to this invocation and is never stored on the shared client.
func GetTokenManager ¶
func GetTokenManager() tokencache.Manager
GetTokenManager returns the global token manager.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a Kiwoom HTTP client with token caching and API-id routing.
func NewClientWithTokenManager ¶
func NewClientWithTokenManager(sandbox bool, tm tokencache.Manager) *Client
NewClientWithTokenManager creates a client with injected token manager.
func (*Client) Authenticate ¶
Authenticate issues or reuses an OAuth token.
func (*Client) CallDocumentedEndpoint ¶ added in v0.8.0
func (c *Client) CallDocumentedEndpoint( ctx context.Context, apiID, path string, body any, allowedCodes ...int, ) (any, error)
CallDocumentedEndpoint executes a documented Kiwoom REST endpoint. It returns generated response type for known documented path/api_id.
func (*Client) CancelStockOrder ¶
func (c *Client) CancelStockOrder( ctx context.Context, req kiwoomspecs.KiwoomApiDostkOrdrKt10003Request, ) (*kiwoomspecs.KiwoomApiDostkOrdrKt10003Response, error)
CancelStockOrder cancels order through kt10003.
func (*Client) InquireBalance ¶
func (c *Client) InquireBalance(ctx context.Context, exchange string) (*kiwoomspecs.KiwoomApiDostkAcntKt00005Response, error)
InquireBalance fetches kt00005.
func (*Client) InquireBalanceByRequest ¶ added in v0.10.0
func (c *Client) InquireBalanceByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00005Request, ) (*kiwoomspecs.KiwoomApiDostkAcntKt00005Response, error)
InquireBalanceByRequest fetches kt00005.
func (*Client) InquireBondPositions ¶ added in v0.6.0
func (c *Client) InquireBondPositions(ctx context.Context, exchange string) (*kiwoomspecs.KiwoomApiDostkAcntKt00018Response, error)
InquireBondPositions is a convenience wrapper for bond holdings.
func (*Client) InquireChangeRateRank ¶ added in v0.6.0
func (c *Client) InquireChangeRateRank( ctx context.Context, req kiwoomspecs.KiwoomApiDostkRkinfoKa10027Request, ) (*kiwoomspecs.KiwoomApiDostkRkinfoKa10027Response, error)
InquireChangeRateRank fetches ka10027.
func (*Client) InquireDailyPrice ¶
func (c *Client) InquireDailyPrice( ctx context.Context, symbol, baseDate string, ) (*kiwoomspecs.KiwoomApiDostkChartKa10081Response, error)
InquireDailyPrice fetches daily candles from ka10081.
func (*Client) InquireDailyPriceByRequest ¶ added in v0.10.0
func (c *Client) InquireDailyPriceByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10081Request, ) (*kiwoomspecs.KiwoomApiDostkChartKa10081Response, error)
InquireDailyPriceByRequest fetches daily candles from ka10081.
func (*Client) InquireExecutionInfo ¶ added in v0.6.0
func (c *Client) InquireExecutionInfo( ctx context.Context, req kiwoomspecs.KiwoomApiDostkStkinfoKa10003Request, ) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10003Response, error)
InquireExecutionInfo fetches ka10003.
func (*Client) InquireInstrumentInfo ¶
func (c *Client) InquireInstrumentInfo( ctx context.Context, symbol string, ) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10100Response, error)
InquireInstrumentInfo fetches ka10100.
func (*Client) InquireInstrumentInfoByRequest ¶ added in v0.10.0
func (c *Client) InquireInstrumentInfoByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkStkinfoKa10100Request, ) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10100Response, error)
InquireInstrumentInfoByRequest fetches ka10100.
func (*Client) InquireInvestorByStock ¶ added in v0.6.0
func (c *Client) InquireInvestorByStock( ctx context.Context, req kiwoomspecs.KiwoomApiDostkStkinfoKa10059Request, ) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10059Response, error)
InquireInvestorByStock fetches ka10059.
func (*Client) InquireInvestorByStockChart ¶ added in v0.6.0
func (c *Client) InquireInvestorByStockChart( ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10060Request, ) (*kiwoomspecs.KiwoomApiDostkChartKa10060Response, error)
InquireInvestorByStockChart fetches investor trend chart via ka10060.
func (*Client) InquireMonthlyPrice ¶
func (c *Client) InquireMonthlyPrice( ctx context.Context, symbol, baseDate string, ) (*kiwoomspecs.KiwoomApiDostkChartKa10083Response, error)
InquireMonthlyPrice fetches monthly candles from ka10083.
func (*Client) InquireMonthlyPriceByRequest ¶ added in v0.10.0
func (c *Client) InquireMonthlyPriceByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10083Request, ) (*kiwoomspecs.KiwoomApiDostkChartKa10083Response, error)
InquireMonthlyPriceByRequest fetches monthly candles from ka10083.
func (*Client) InquireOrderBook ¶ added in v0.6.0
func (c *Client) InquireOrderBook( ctx context.Context, req kiwoomspecs.KiwoomApiDostkMrkcondKa10004Request, ) (*kiwoomspecs.KiwoomApiDostkMrkcondKa10004Response, error)
InquireOrderBook fetches ka10004.
func (*Client) InquireOrderExecutionDetail ¶ added in v0.6.0
func (c *Client) InquireOrderExecutionDetail( ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00007Request, ) (*kiwoomspecs.KiwoomApiDostkAcntKt00007Response, error)
InquireOrderExecutionDetail fetches kt00007.
func (*Client) InquireOrderExecutionStatus ¶ added in v0.6.0
func (c *Client) InquireOrderExecutionStatus( ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00009Request, ) (*kiwoomspecs.KiwoomApiDostkAcntKt00009Response, error)
InquireOrderExecutionStatus fetches kt00009.
func (*Client) InquireOrderExecutions ¶
func (c *Client) InquireOrderExecutions(ctx context.Context, symbol string) (*kiwoomspecs.KiwoomApiDostkAcntKa10076Response, error)
InquireOrderExecutions fetches ka10076.
func (*Client) InquireOrderExecutionsByExchange ¶ added in v0.6.0
func (c *Client) InquireOrderExecutionsByExchange( ctx context.Context, symbol, exchangeType string, ) (*kiwoomspecs.KiwoomApiDostkAcntKa10076Response, error)
InquireOrderExecutionsByExchange fetches execution rows with explicit exchange scope.
func (*Client) InquireOrderExecutionsByRequest ¶ added in v0.10.0
func (c *Client) InquireOrderExecutionsByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKa10076Request, ) (*kiwoomspecs.KiwoomApiDostkAcntKa10076Response, error)
InquireOrderExecutionsByRequest fetches ka10076.
func (*Client) InquireOrderableWithdrawable ¶ added in v0.6.0
func (c *Client) InquireOrderableWithdrawable( ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00010Request, ) (*kiwoomspecs.KiwoomApiDostkAcntKt00010Response, error)
InquireOrderableWithdrawable fetches kt00010.
func (*Client) InquirePositions ¶
func (c *Client) InquirePositions(ctx context.Context, queryType, exchange string) (*kiwoomspecs.KiwoomApiDostkAcntKt00018Response, error)
InquirePositions fetches kt00018.
func (*Client) InquirePositionsByAsset ¶ added in v0.6.0
func (c *Client) InquirePositionsByAsset( ctx context.Context, queryType, exchange, stockBondType string, ) (*kiwoomspecs.KiwoomApiDostkAcntKt00018Response, error)
InquirePositionsByAsset fetches positions with optional stock/bond filter (e.g. 1=stock, 2=bond).
func (*Client) InquirePositionsByRequest ¶ added in v0.10.0
func (c *Client) InquirePositionsByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKt00018Request, ) (*kiwoomspecs.KiwoomApiDostkAcntKt00018Response, error)
InquirePositionsByRequest fetches kt00018.
func (*Client) InquirePrice ¶
func (c *Client) InquirePrice(ctx context.Context, symbol string) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10001Response, error)
InquirePrice fetches ka10001 and returns typed quote fields.
func (*Client) InquirePriceByRequest ¶ added in v0.10.0
func (c *Client) InquirePriceByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkStkinfoKa10001Request, ) (*kiwoomspecs.KiwoomApiDostkStkinfoKa10001Response, error)
InquirePriceByRequest fetches ka10001 and returns typed quote fields.
func (*Client) InquireSectorByPrice ¶ added in v0.6.0
func (c *Client) InquireSectorByPrice( ctx context.Context, req kiwoomspecs.KiwoomApiDostkSectKa20002Request, ) (*kiwoomspecs.KiwoomApiDostkSectKa20002Response, error)
InquireSectorByPrice fetches ka20002.
func (*Client) InquireSectorCurrent ¶ added in v0.6.0
func (c *Client) InquireSectorCurrent( ctx context.Context, req kiwoomspecs.KiwoomApiDostkSectKa20001Request, ) (*kiwoomspecs.KiwoomApiDostkSectKa20001Response, error)
InquireSectorCurrent fetches ka20001.
func (*Client) InquireTickChart ¶ added in v0.6.0
func (c *Client) InquireTickChart( ctx context.Context, symbol, baseDate string, ) (*kiwoomspecs.KiwoomApiDostkChartKa10079Response, error)
InquireTickChart fetches domestic tick chart via ka10079.
func (*Client) InquireTickChartByRequest ¶ added in v0.10.0
func (c *Client) InquireTickChartByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10079Request, ) (*kiwoomspecs.KiwoomApiDostkChartKa10079Response, error)
InquireTickChartByRequest fetches domestic tick chart via ka10079.
func (*Client) InquireUnsettledOrders ¶
func (c *Client) InquireUnsettledOrders(ctx context.Context, symbol string) (*kiwoomspecs.KiwoomApiDostkAcntKa10075Response, error)
InquireUnsettledOrders fetches ka10075.
func (*Client) InquireUnsettledOrdersByExchange ¶ added in v0.6.0
func (c *Client) InquireUnsettledOrdersByExchange( ctx context.Context, symbol, exchangeType string, ) (*kiwoomspecs.KiwoomApiDostkAcntKa10075Response, error)
InquireUnsettledOrdersByExchange fetches unsettled orders with explicit exchange scope.
func (*Client) InquireUnsettledOrdersByRequest ¶ added in v0.10.0
func (c *Client) InquireUnsettledOrdersByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkAcntKa10075Request, ) (*kiwoomspecs.KiwoomApiDostkAcntKa10075Response, error)
InquireUnsettledOrdersByRequest fetches ka10075.
func (*Client) InquireVolumeRank ¶ added in v0.6.0
func (c *Client) InquireVolumeRank( ctx context.Context, req kiwoomspecs.KiwoomApiDostkRkinfoKa10030Request, ) (*kiwoomspecs.KiwoomApiDostkRkinfoKa10030Response, error)
InquireVolumeRank fetches ka10030.
func (*Client) InquireWeeklyPrice ¶
func (c *Client) InquireWeeklyPrice( ctx context.Context, symbol, baseDate string, ) (*kiwoomspecs.KiwoomApiDostkChartKa10082Response, error)
InquireWeeklyPrice fetches weekly candles from ka10082.
func (*Client) InquireWeeklyPriceByRequest ¶ added in v0.10.0
func (c *Client) InquireWeeklyPriceByRequest( ctx context.Context, req kiwoomspecs.KiwoomApiDostkChartKa10082Request, ) (*kiwoomspecs.KiwoomApiDostkChartKa10082Response, error)
InquireWeeklyPriceByRequest fetches weekly candles from ka10082.
func (*Client) ModifyStockOrder ¶
func (c *Client) ModifyStockOrder( ctx context.Context, req kiwoomspecs.KiwoomApiDostkOrdrKt10002Request, ) (*kiwoomspecs.KiwoomApiDostkOrdrKt10002Response, error)
ModifyStockOrder modifies order through kt10002.
func (*Client) PlaceBuyOrder ¶ added in v0.10.0
func (c *Client) PlaceBuyOrder( ctx context.Context, req kiwoomspecs.KiwoomApiDostkOrdrKt10000Request, ) (*kiwoomspecs.KiwoomApiDostkOrdrKt10000Response, error)
PlaceBuyOrder places kt10000.
func (*Client) PlaceSellOrder ¶ added in v0.10.0
func (c *Client) PlaceSellOrder( ctx context.Context, req kiwoomspecs.KiwoomApiDostkOrdrKt10001Request, ) (*kiwoomspecs.KiwoomApiDostkOrdrKt10000Response, error)
PlaceSellOrder places kt10001.
func (*Client) PlaceStockOrder ¶
func (c *Client) PlaceStockOrder( ctx context.Context, side StockOrderSide, req kiwoomspecs.KiwoomApiDostkOrdrKt10000Request, ) (*kiwoomspecs.KiwoomApiDostkOrdrKt10000Response, error)
PlaceStockOrder places kt10000 (buy) or kt10001 (sell).
func (*Client) SetBaseURL ¶
SetBaseURL overrides the API base URL. Primarily useful for tests or private/proxy deployments.
func (*Client) SetCredentials ¶
SetCredentials sets app credentials on this client.
type FileTokenManager ¶
FileTokenManager stores tokens in memory and on disk.
func NewFileTokenManager ¶
func NewFileTokenManager() *FileTokenManager
NewFileTokenManager creates the default file-backed token manager.
func NewFileTokenManagerWithDir ¶
func NewFileTokenManagerWithDir(dir string) *FileTokenManager
NewFileTokenManagerWithDir creates a file-backed manager with optional fixed directory.
type StockOrderSide ¶
type StockOrderSide string
StockOrderSide indicates buy/sell for order placement.
const ( StockOrderSideBuy StockOrderSide = "buy" StockOrderSideSell StockOrderSide = "sell" )