MySQL 8.0.40
Source Code Documentation
mock_server_plugin.cc File Reference
#include "mock_server_plugin.h"
#include <array>
#include <climits>
#include <stdexcept>
#include <string>
#include <system_error>
#include "mysql.h"
#include "mysql/harness/config_option.h"
#include "mysql/harness/config_parser.h"
#include "mysql/harness/logging/logging.h"
#include "mysql/harness/plugin.h"
#include "mysql/harness/plugin_config.h"
#include "mysql/harness/stdx/filesystem.h"
#include "mysql/harness/string_utils.h"
#include "mysql/harness/tls_context.h"
#include "mysql/harness/tls_server_context.h"
#include "mysql/harness/utility/string.h"
#include "mysql_server_mock.h"
#include "mysqlrouter/io_component.h"

Classes

class  anonymous_namespace{mock_server_plugin.cc}::SslModeOption
 
class  anonymous_namespace{mock_server_plugin.cc}::StringsOption
 
class  PluginConfig
 

Namespaces

namespace  anonymous_namespace{mock_server_plugin.cc}
 

Macros

#define GET_OPTION_CHECKED(option, section, name, value)
 

Functions

static void init (mysql_harness::PluginFuncEnv *env)
 
static void start (mysql_harness::PluginFuncEnv *env)
 
static void deinit (mysql_harness::PluginFuncEnv *)
 

Variables

constexpr const std::array< std::pair< const char *, mysql_ssl_mode >, 3 > anonymous_namespace{mock_server_plugin.cc}::allowed_ssl_modes
 
static constexpr const char anonymous_namespace{mock_server_plugin.cc}::kSectionName [] {"mock_server"}
 
static constexpr std::array< const char *, 14 > supported_options
 
Monitor< std::list< IoComponent::Workguard > > io_context_work_guards {{}}
 
static const std::array< const char *, 4 > required
 
mysql_harness::Plugin MOCK_SERVER_EXPORT harness_plugin_mock_server
 

Macro Definition Documentation

◆ GET_OPTION_CHECKED

#define GET_OPTION_CHECKED (   option,
  section,
  name,
  value 
)
Value:
option = get_option(section, name, value);
static std::string get_option(const mysql_harness::ConfigSection *section, const std::string &key, const std::string &def_value)
Definition: metadata_cache_plugin.cc:107
static constexpr std::array< const char *, 14 > supported_options
Definition: mock_server_plugin.cc:106
constexpr bool str_in_collection(const T &t, const std::string_view &k)
Definition: string.h:157
case opt name
Definition: sslopt-case.h:33

Function Documentation

◆ deinit()

static void deinit ( mysql_harness::PluginFuncEnv )
static

◆ init()

static void init ( mysql_harness::PluginFuncEnv env)
static

◆ start()

static void start ( mysql_harness::PluginFuncEnv env)
static

Variable Documentation

◆ harness_plugin_mock_server

mysql_harness::Plugin MOCK_SERVER_EXPORT harness_plugin_mock_server
Initial value:
= {
mysql_harness::PLUGIN_ABI_VERSION,
mysql_harness::ARCHITECTURE_DESCRIPTOR,
"Mock MySQL Server for testing",
VERSION_NUMBER(0, 0, 1),
required.size(),
required.data(),
0,
nullptr,
init,
nullptr,
true,
}
static void init(mysql_harness::PluginFuncEnv *env)
Definition: mock_server_plugin.cc:188
static const std::array< const char *, 4 > required
Definition: mock_server_plugin.cc:338
static void start(mysql_harness::PluginFuncEnv *env)
Definition: mock_server_plugin.cc:213
static void deinit(mysql_harness::PluginFuncEnv *)
Definition: mock_server_plugin.cc:334

◆ io_context_work_guards

Monitor<std::list<IoComponent::Workguard> > io_context_work_guards {{}}

◆ required

const std::array<const char *, 4> required
static
Initial value:
= {{
"logger",
"router_openssl",
"router_protobuf",
"io",
}}

◆ supported_options

constexpr std::array<const char *, 14> supported_options
staticconstexpr
Initial value:
{
"filename", "module_prefix", "bind_address", "port", "protocol",
"ssl_ca", "ssl_capath", "ssl_cert", "ssl_key", "ssl_cipher",
"ssl_crl", "ssl_crlpath", "ssl_mode", "tls_version"}