Public Member Functions | List of all members
ServiceInterface Class Referenceabstract

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

#include <consul_interface.h>

Public Member Functions

virtual std::string to_json () const =0
 Convert the Service into a JSON Message. More...
virtual std::string get_id () const =0
 Get the Service ID.
virtual std::string get_name () const =0
 Get the Service Name.
virtual std::string get_address () const =0
 Get the Service Address.
virtual std::string get_port () const =0
 Get the Service Port.
virtual void set_id (std::string new_id)=0
 Set the Service ID.
virtual void set_name (std::string new_name)=0
 Set the Service Name.
virtual void set_address (std::string new_address)=0
 Set the Service Address.
virtual void set_port (std::string new_port)=0
 Set the Service Port.
virtual std::vector< std::string > get_tags ()=0
 Get the tags.
virtual void add_tag (std::string new_tag)=0
 Add a tag.
virtual void clear_tags ()=0
 Clear the tags.
virtual int num_tags () const =0
 How many tags are there?
virtual HealthCheck get_check ()=0
 Get the health checks.
virtual void set_check (std::string scr, int interval_seconds)=0
 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

virtual std::string ServiceInterface::to_json ( ) const
pure 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

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