The Sequence Toolkit
www.sequence-toolkit.com |
#include "stk_service_group.h"
#include "stk_service.h"
#include "stk_env.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
Go to the source code of this file.
The Service Group APIs define a module which enable services to be grouped together. The module provides ways to add and remove services to a group and access services in the group
stk_ret stk_add_service_to_group | ( | stk_service_group_t * | svc_group, |
stk_service_t * | svc, | ||
struct sockaddr_in | ip, | ||
stk_service_in_group_state | state | ||
) |
Add a Service to a Service Group (setting the initial state for the service in the group)
stk_service_group_t* stk_create_service_group | ( | stk_env_t * | env, |
char * | name, | ||
stk_service_group_id | id, | ||
stk_options_t * | options | ||
) |
Create a Sequence Service Group.
Accepts options: service_added_cb, service_removed_cb.
stk_ret stk_destroy_service_group | ( | stk_service_group_t * | svcgrp | ) |
Destroy a Service Group.
stk_service_t* stk_find_service_in_group_by_id | ( | stk_service_group_t * | svc_group, |
stk_service_id | id, | ||
struct sockaddr_in | ip | ||
) |
Find a Service by Service ID in a Service Group
stk_service_t* stk_find_service_in_group_by_name | ( | stk_service_group_t * | svc_group, |
char * | name, | ||
struct sockaddr_in | ip | ||
) |
Find a Service by name in a Service Group
stk_env_t* stk_get_service_group_env | ( | stk_service_group_t * | svcgrp | ) |
Get the STK Environment from a Service Group
stk_service_group_id stk_get_service_group_id | ( | stk_service_group_t * | svcgrp | ) |
Get the ID of a service group
char* stk_get_service_group_name | ( | stk_service_group_t * | svcgrp | ) |
Get the name from a Service Group
stk_options_t* stk_get_service_group_options | ( | stk_service_group_t * | svcgrp | ) |
Get the options for a service group
stk_service_group_state stk_get_service_group_state | ( | stk_service_group_t * | svc_group, |
stk_service_t * | svc | ||
) |
Get the state of a Service Group
stk_service_in_group_state stk_get_service_state_in_group | ( | stk_service_group_t * | svc_group, |
stk_service_t * | svc | ||
) |
Get the state of a Service within a Service Group
stk_ret stk_iterate_service_group | ( | stk_service_group_t * | svc_group, |
stk_service_in_group_cb | cb, | ||
void * | clientd | ||
) |
API to execute a callback on each service in a service group. It is common to use this to check the state of the services in order to determine a new group state
stk_ret stk_remove_service_from_group | ( | stk_service_group_t * | svc_group, |
stk_service_t * | svc | ||
) |
Remove a Service from a Service Group
stk_ret stk_service_group_handle_smartbeat | ( | stk_service_group_t * | svc_group, |
stk_service_id | svc_id, | ||
stk_smartbeat_t * | smartbeat, | ||
struct sockaddr_in | reporting_ip | ||
) |
Handle a received smartbeat in a service group
stk_ret stk_set_service_group_state | ( | stk_service_group_t * | svc_group, |
stk_service_t * | svc, | ||
stk_service_group_state | state | ||
) |
Set the state of a Service Group.
stk_ret stk_set_service_state_in_group | ( | stk_service_group_t * | svc_group, |
stk_service_t * | svc, | ||
stk_service_in_group_state | state | ||
) |
Set the state of a Service within a Service Group