AOSharedServiceLibrary
Public Member Functions | List of all members
AOSSL::Service Class Reference

A Service class which can be registered with Consul for each app instance. More...

#include <service.h>

Inheritance diagram for AOSSL::Service:
Inheritance graph
[legend]
Collaboration diagram for AOSSL::Service:
Collaboration graph
[legend]

Public Member Functions

 Service ()
 Construct a Service.
 
 Service (std::string new_id, std::string new_name)
 Construct a Service.
 
 Service (std::string new_id, std::string new_name, std::string new_address, std::string new_port)
 Construct a Service.
 
 Service (std::string new_id, std::string new_name, std::string new_address, std::string new_port, std::vector< std::string > new_tags)
 Construct a Service.
 
std::string to_json () const
 Convert the Service into a JSON Message. More...
 
std::string get_id () const
 Get the Service ID.
 
std::string get_name () const
 Get the Service Name.
 
std::string get_address () const
 Get the Service Address.
 
std::string get_port () const
 Get the Service Port.
 
void set_id (std::string new_id)
 Set the Service ID.
 
void set_name (std::string new_name)
 Set the Service Name.
 
void set_address (std::string new_address)
 Set the Service Address.
 
void set_port (std::string new_port)
 Set the Service Port.
 
std::vector< std::string > get_tags ()
 Get the tags.
 
void add_tag (std::string new_tag)
 Add a tag.
 
void clear_tags ()
 Clear the tags.
 
int num_tags () const
 How many tags are there?
 
HealthCheck get_check ()
 Get the health checks.
 
void set_check (std::string http_url, int interval_seconds)
 Add a check.
 
void set_check (std::string http_url, int interv_seconds, int interv_ttl)
 Add a check.
 

Detailed Description

A Service class which can be registered with Consul for each app instance.

An instance of this class can be instantiated by a service and is passed to the consul admin to register and de-register

Member Function Documentation

std::string AOSSL::Service::to_json ( ) const
virtual

Convert the Service into a JSON Message.

Method that allows the service to be transformed into a json message that can be sent via HTTP to a Consul instance

Implements AOSSL::ServiceInterface.


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