HAProxy tool config file generation TAPI

Overview

TAPI to handle HAProxy tool config file generation. More…

// typedefs

typedef struct tapi_haproxy_cfg_address tapi_haproxy_cfg_address;
typedef enum tapi_haproxy_cfg_shards tapi_haproxy_cfg_shards;
typedef struct tapi_haproxy_cfg_backend tapi_haproxy_cfg_backend;
typedef struct tapi_haproxy_cfg_opt tapi_haproxy_cfg_opt;

// enums

enum tapi_haproxy_cfg_shards;

// structs

struct tapi_haproxy_cfg_address;
struct tapi_haproxy_cfg_backend;
struct tapi_haproxy_cfg_opt;

// global variables

const tapi_haproxy_cfg_opt tapi_haproxy_cfg_default_opt;

// global functions

te_errno tapi_haproxy_cfg_create(const char* ta, const tapi_haproxy_cfg_opt* opt, char** result_pathname);
void tapi_haproxy_cfg_destroy(const char* ta, const char* cfg_file);

// macros

#define TAPI_HAPROXY_CONF_DEFAULT_TIMEOUT_MS

Detailed Documentation

TAPI to handle HAProxy tool config file generation.

Typedefs

typedef struct tapi_haproxy_cfg_address tapi_haproxy_cfg_address

Representation of pair of address and port.

typedef enum tapi_haproxy_cfg_shards tapi_haproxy_cfg_shards

Representation of possible frontend listener shards option value sources.

typedef struct tapi_haproxy_cfg_backend tapi_haproxy_cfg_backend

Backend server representation for HAProxy configuration.

typedef struct tapi_haproxy_cfg_opt tapi_haproxy_cfg_opt

HAProxy config file options.

Global Variables

const tapi_haproxy_cfg_opt tapi_haproxy_cfg_default_opt

Default options initializer.

Global Functions

te_errno tapi_haproxy_cfg_create(const char* ta, const tapi_haproxy_cfg_opt* opt, char** result_pathname)

Generate config file for HAProxy app. Save it in /tmp subdir of Test Agent working dir.

result_pathname must be free’d.

Parameters:

ta

Test Agent name.

opt

Configs for HAProxy tool.

result_pathname

Resulting path to the file (must not be NULL).

Returns:

Status code.

void tapi_haproxy_cfg_destroy(const char* ta, const char* cfg_file)

Destroy generated config file for HAProxy app.

Parameters:

ta

Test Agent name.

cfg_file

Path to generated config file.