Documentation
¶
Overview ¶
Package ls exposes the public LS Securities adapter, including realtime.
Index ¶
- func NewFileTokenManager() tokencache.Manager
- func NewFileTokenManagerWithDir(dir string) tokencache.Manager
- func OverseasRealtimeKey(exchange, symbol string) (string, error)
- type Adapter
- type Continuation
- type EndpointPage
- type Options
- type PageCaller
- type RealtimeConn
- type RealtimeMessage
- type RealtimeSubscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileTokenManager ¶
func NewFileTokenManager() tokencache.Manager
NewFileTokenManager creates a file-backed LS token manager.
func NewFileTokenManagerWithDir ¶
func NewFileTokenManagerWithDir(dir string) tokencache.Manager
NewFileTokenManagerWithDir creates a file-backed LS token manager with a fixed directory.
func OverseasRealtimeKey ¶
OverseasRealtimeKey returns the fixed-width realtime key used by LS GSC/GSH.
Types ¶
type Adapter ¶
type Adapter interface {
adapter.Adapter
CallEndpoint(ctx context.Context, method, path, trCD string, request any) (any, error)
ConnectRealtime(ctx context.Context) (*RealtimeConn, error)
BuildTradeSubscriptions(ctx context.Context) ([]RealtimeSubscription, error)
BuildOverseasTradeSubscriptions(ctx context.Context, market string, maxRows int) ([]RealtimeSubscription, error)
}
Adapter is the public LS adapter contract.
type Continuation ¶ added in v0.28.0
type Continuation = internal.Continuation
Continuation holds LS continuation request and response headers.
type EndpointPage ¶ added in v0.28.0
type EndpointPage = internal.EndpointPage
EndpointPage is a raw payload together with its continuation metadata.
type PageCaller ¶ added in v0.28.0
type PageCaller interface {
CallEndpointPage(ctx context.Context, method, path, trCD string, request any, continuation Continuation) (*EndpointPage, error)
}
PageCaller is the optional REST pagination extension implemented by built-in adapters.
type RealtimeConn ¶
type RealtimeConn = internal.RealtimeConn
RealtimeConn is a live LS websocket connection.
type RealtimeMessage ¶
type RealtimeMessage = internal.RealtimeMessage
RealtimeMessage is a single message received over a realtime connection.
type RealtimeSubscription ¶
type RealtimeSubscription = internal.RealtimeSubscription
RealtimeSubscription describes one tr_cd+key realtime subscription.