Longbridge OpenAPI C++ SDK
Public Member Functions | Static Public Member Functions | List of all members
longbridge::Config Class Reference

#include <config.hpp>

Public Member Functions

 Config ()
 
 Config (lb_config_t *config)
 
 Config (const Config &)=delete
 
 Config (Config &&other)
 
 ~Config ()
 
 operator const lb_config_t * () const
 
Configset_http_url (const std::string &url)
 Set the HTTP endpoint URL. More...
 
Configset_quote_ws_url (const std::string &url)
 Set the Quote WebSocket endpoint URL. More...
 
Configset_trade_ws_url (const std::string &url)
 Set the Trade WebSocket endpoint URL. More...
 
Configset_language (Language language)
 Set the language identifier. More...
 
Configenable_overnight ()
 Enable overnight quote. More...
 
Configset_push_candlestick_mode (PushCandlestickMode mode)
 Set the push candlestick mode. More...
 
Configdisable_print_quote_packages ()
 Disable printing of quote packages on connection. More...
 
Configset_log_path (const std::string &path)
 Set the log file path. More...
 

Static Public Member Functions

static Config from_apikey (const std::string &app_key, const std::string &app_secret, const std::string &access_token)
 
static Config from_apikey_env (Status &status)
 
static Config from_oauth (const OAuth &oauth)
 

Constructor & Destructor Documentation

◆ Config() [1/4]

longbridge::Config::Config ( )

◆ Config() [2/4]

longbridge::Config::Config ( lb_config_t config)

◆ Config() [3/4]

longbridge::Config::Config ( const Config )
delete

◆ Config() [4/4]

longbridge::Config::Config ( Config &&  other)

◆ ~Config()

longbridge::Config::~Config ( )

Member Function Documentation

◆ disable_print_quote_packages()

Config& longbridge::Config::disable_print_quote_packages ( )

Disable printing of quote packages on connection.

◆ enable_overnight()

Config& longbridge::Config::enable_overnight ( )

Enable overnight quote.

◆ from_apikey()

static Config longbridge::Config::from_apikey ( const std::string &  app_key,
const std::string &  app_secret,
const std::string &  access_token 
)
static

Create a new Config for API Key authentication

Optional environment variables are read automatically: LONGBRIDGE_HTTP_URL, LONGBRIDGE_LANGUAGE, LONGBRIDGE_QUOTE_WS_URL, LONGBRIDGE_TRADE_WS_URL, LONGBRIDGE_ENABLE_OVERNIGHT, LONGBRIDGE_PUSH_CANDLESTICK_MODE, LONGBRIDGE_PRINT_QUOTE_PACKAGES, LONGBRIDGE_LOG_PATH. Use the chainable set_* methods to override any of these values.

Parameters
app_keyApp key
app_secretApp secret
access_tokenAccess token

◆ from_apikey_env()

static Config longbridge::Config::from_apikey_env ( Status status)
static

Create a new Config from environment variables (API Key mode)

Variables: LONGBRIDGE_APP_KEY, LONGBRIDGE_APP_SECRET, LONGBRIDGE_ACCESS_TOKEN, LONGBRIDGE_HTTP_URL, LONGBRIDGE_QUOTE_WS_URL, LONGBRIDGE_TRADE_WS_URL, LONGBRIDGE_LANGUAGE, LONGBRIDGE_ENABLE_OVERNIGHT, LONGBRIDGE_PUSH_CANDLESTICK_MODE, LONGBRIDGE_PRINT_QUOTE_PACKAGES, LONGBRIDGE_LOG_PATH

◆ from_oauth()

static Config longbridge::Config::from_oauth ( const OAuth oauth)
static

Create a new Config for OAuth 2.0 authentication

Optional environment variables are read automatically: LONGBRIDGE_HTTP_URL, LONGBRIDGE_LANGUAGE, LONGBRIDGE_QUOTE_WS_URL, LONGBRIDGE_TRADE_WS_URL, LONGBRIDGE_ENABLE_OVERNIGHT, LONGBRIDGE_PUSH_CANDLESTICK_MODE, LONGBRIDGE_PRINT_QUOTE_PACKAGES, LONGBRIDGE_LOG_PATH. Use the chainable set_* methods to override any of these values.

Parameters
oauthOAuth 2.0 client obtained from OAuthBuilder::build

◆ operator const lb_config_t *()

longbridge::Config::operator const lb_config_t * ( ) const

◆ set_http_url()

Config& longbridge::Config::set_http_url ( const std::string &  url)

Set the HTTP endpoint URL.

◆ set_language()

Config& longbridge::Config::set_language ( Language  language)

Set the language identifier.

◆ set_log_path()

Config& longbridge::Config::set_log_path ( const std::string &  path)

Set the log file path.

◆ set_push_candlestick_mode()

Config& longbridge::Config::set_push_candlestick_mode ( PushCandlestickMode  mode)

Set the push candlestick mode.

◆ set_quote_ws_url()

Config& longbridge::Config::set_quote_ws_url ( const std::string &  url)

Set the Quote WebSocket endpoint URL.

◆ set_trade_ws_url()

Config& longbridge::Config::set_trade_ws_url ( const std::string &  url)

Set the Trade WebSocket endpoint URL.


The documentation for this class was generated from the following file: