Curl utility publisher_api implementation. This plugin generates a scratch file (in-memory) and asynchronously sends it to the configured web service by invoking the 'curl' utility. Multiple independent instances of this plugin may be used simultaneously.
More...
|
| | curl_plugin () |
| |
| int | publish (std::shared_ptr< builder_api > b) |
| | Publish the content of the builder.
|
| |
| int | config (const std::map< std::string, std::string > &m) |
| | Configure the plugin with the options given.
|
| |
| int | config (const std::map< std::string, std::string > &m, string_view env_prefix) |
| | Configure the plugin with the options given and the corresponding environment variables.
|
| |
| const std::map< const std::string, const std::string > & | get_option_defaults () |
| | Look up the settable options and their defaults.
|
| |
| int | initialize () |
| | Ready the plugin to publish following the configuration options set or defaulted.
|
| |
| void | finalize () |
| | Stop publishing and release any resources held for managing publication.
|
| |
| void | pause () |
| | Pause publishing until a call to resume. Duplicate calls are allowed.
|
| |
| void | resume () |
| | Resume publishing Duplicate calls are allowed.
|
| |
| string_view | name () const |
| |
| string_view | version () const |
| |
| | ~curl_plugin () |
| |
|
| static const char * | adc_curl_plugin_directory_default = "/dev/shm/adc" |
| | default scratch directory for curl utility messages. This directory must be globally writable and should be fast. Overridden with env("ADC_CURL_PLUGIN_DIRECTORY").
|
| |
| static const char * | adc_curl_plugin_prog_default = "/usr/bin/curl" |
| | default full path to curl utility This program should be world accessible. Overridden with env("ADC_CURL_PLUGIN_PROG").
|
| |
| static const char * | adc_curl_plugin_port_default = "443" |
| | default ADC server https port. The server should be highly available. Overridden with env("ADC_CURL_PLUGIN_PORT").
|
| |
| static const char * | adc_curl_plugin_url_default = "https://localhost" |
| | ADC data ingest server host. The server should be highly available; the default value of https://localhost must be overridden by an environment variable unless the test environment includes a test server. Overridden with env("ADC_CURL_PLUGIN_URL").
|
| |
| static const char * | adc_curl_plugin_debug_default = "0" |
| | ADC curl plugin enable debug messages; (default "0": none) "2" provides message send debugging "1" provides lighter debugging Overridden with env("ADC_CURL_PLUGIN_DEBUG").
|
| |
Curl utility publisher_api implementation. This plugin generates a scratch file (in-memory) and asynchronously sends it to the configured web service by invoking the 'curl' utility. Multiple independent instances of this plugin may be used simultaneously.
Definition at line 21 of file curl.ipp.
◆ curl_plugin()
| adc::curl_plugin::curl_plugin |
( |
| ) |
|
|
inline |
◆ ~curl_plugin()
| adc::curl_plugin::~curl_plugin |
( |
| ) |
|
|
inline |
◆ publish()
| int adc::curl_plugin::publish |
( |
std::shared_ptr< builder_api > |
b | ) |
|
|
inlinevirtual |
Publish the content of the builder.
- Parameters
-
| b | converted to a single json object and published |
Implements adc::publisher_api.
Definition at line 170 of file curl.ipp.
◆ config() [1/2]
| int adc::curl_plugin::config |
( |
const std::map< std::string, std::string > & |
m | ) |
|
|
inlinevirtual |
Configure the plugin with the options given.
- Parameters
-
| m | a map with keys documented in the plugin-specific header. |
For plugin QQQ, Environment variables ADC_QQQ_PLUGIN_* will override the source code default for any key not defined in m. Here QQQ is the uppercase version of the plugin name.
Implements adc::publisher_api.
Definition at line 207 of file curl.ipp.
◆ config() [2/2]
| int adc::curl_plugin::config |
( |
const std::map< std::string, std::string > & |
m, |
|
|
string_view |
env_prefix |
|
) |
| |
|
inlinevirtual |
Configure the plugin with the options given and the corresponding environment variables.
- Parameters
-
| m | a map with keys documented in the plugin-specific header. |
| env_prefix | is prepended to the expected keys for the plugin and values found with getenv that match are used, overriding elements of m. Typically, env_prefix will be PPP_ADC_QQQ_PLUGIN_ if application PPP wants to override the defaults of plugin QQQ. Here QQQ is the uppercase version of the plugin name. |
Implements adc::publisher_api.
Definition at line 213 of file curl.ipp.
◆ get_option_defaults()
| const std::map< const std::string, const std::string > & adc::curl_plugin::get_option_defaults |
( |
| ) |
|
|
inlinevirtual |
Look up the settable options and their defaults.
Some plugins without options will return an empty map.
Implements adc::publisher_api.
Definition at line 222 of file curl.ipp.
◆ initialize()
| int adc::curl_plugin::initialize |
( |
| ) |
|
|
inlinevirtual |
Ready the plugin to publish following the configuration options set or defaulted.
Implements adc::publisher_api.
Definition at line 226 of file curl.ipp.
◆ finalize()
| void adc::curl_plugin::finalize |
( |
| ) |
|
|
inlinevirtual |
◆ pause()
| void adc::curl_plugin::pause |
( |
| ) |
|
|
inlinevirtual |
◆ resume()
| void adc::curl_plugin::resume |
( |
| ) |
|
|
inlinevirtual |
◆ name()
◆ version()
- Returns
- the version of the plugin (should follow semantic versioning practices)
Implements adc::publisher_api.
Definition at line 278 of file curl.ipp.
◆ adc_curl_plugin_directory_default
| const char* adc::curl_plugin::adc_curl_plugin_directory_default = "/dev/shm/adc" |
|
inlinestatic |
default scratch directory for curl utility messages. This directory must be globally writable and should be fast. Overridden with env("ADC_CURL_PLUGIN_DIRECTORY").
Definition at line 37 of file curl.ipp.
◆ adc_curl_plugin_prog_default
| const char* adc::curl_plugin::adc_curl_plugin_prog_default = "/usr/bin/curl" |
|
inlinestatic |
default full path to curl utility This program should be world accessible. Overridden with env("ADC_CURL_PLUGIN_PROG").
Definition at line 42 of file curl.ipp.
◆ adc_curl_plugin_port_default
| const char* adc::curl_plugin::adc_curl_plugin_port_default = "443" |
|
inlinestatic |
default ADC server https port. The server should be highly available. Overridden with env("ADC_CURL_PLUGIN_PORT").
Definition at line 47 of file curl.ipp.
◆ adc_curl_plugin_url_default
| const char* adc::curl_plugin::adc_curl_plugin_url_default = "https://localhost" |
|
inlinestatic |
ADC data ingest server host. The server should be highly available; the default value of https://localhost must be overridden by an environment variable unless the test environment includes a test server. Overridden with env("ADC_CURL_PLUGIN_URL").
Definition at line 54 of file curl.ipp.
◆ adc_curl_plugin_debug_default
| const char* adc::curl_plugin::adc_curl_plugin_debug_default = "0" |
|
inlinestatic |
ADC curl plugin enable debug messages; (default "0": none) "2" provides message send debugging "1" provides lighter debugging Overridden with env("ADC_CURL_PLUGIN_DEBUG").
Definition at line 60 of file curl.ipp.
The documentation for this class was generated from the following file: