Documentation ¶
Index ¶
- Variables
- type Notification
- type Sender
- type Service
- func (m *Service) GetNewServices(services *[]SwarmService) (*[]SwarmService, error)
- func (m *Service) GetRemovedServices(services *[]SwarmService) *[]string
- func (m *Service) GetServices() (*[]SwarmService, error)
- func (m *Service) GetServicesParameters(services *[]SwarmService) *[]map[string]string
- type Servicer
- type SwarmService
Constants ¶
This section is empty.
Variables ¶
var CachedServices map[string]SwarmService
CachedServices stores the information about services processed by the system
Functions ¶
This section is empty.
Types ¶
type Notification ¶
Notification defines the structure with exported functions
func NewNotificationFromEnv ¶
func NewNotificationFromEnv() *Notification
NewNotificationFromEnv returns `notification` instance
func (*Notification) ServicesCreate ¶
func (m *Notification) ServicesCreate(services *[]SwarmService, retries, interval int) error
ServicesCreate sends create service notifications
func (*Notification) ServicesRemove ¶
func (m *Notification) ServicesRemove(remove *[]string, retries, interval int) error
ServicesRemove sends remove service notifications
type Sender ¶
type Sender interface { ServicesCreate(services *[]SwarmService, retries, interval int) error ServicesRemove(services *[]string, retries, interval int) error }
Sender defines mandatory functions for sending notifications
type Service ¶
Service defines the based structure
func NewService ¶
NewService returns a new instance of the `Service` structure
func NewServiceFromEnv ¶
func NewServiceFromEnv() *Service
NewServiceFromEnv returns a new instance of the `Service` structure using environment variable `DF_DOCKER_HOST` for the host
func (*Service) GetNewServices ¶
func (m *Service) GetNewServices(services *[]SwarmService) (*[]SwarmService, error)
GetNewServices returns services that were not processed previously
func (*Service) GetRemovedServices ¶
func (m *Service) GetRemovedServices(services *[]SwarmService) *[]string
GetRemovedServices returns services that were removed from the cluster
func (*Service) GetServices ¶
func (m *Service) GetServices() (*[]SwarmService, error)
GetServices returns all services running in the cluster
func (*Service) GetServicesParameters ¶
func (m *Service) GetServicesParameters(services *[]SwarmService) *[]map[string]string
GetServicesParameters returns parameters extracted from labels associated with input services
type Servicer ¶
type Servicer interface { GetServices() (*[]SwarmService, error) GetNewServices(services *[]SwarmService) (*[]SwarmService, error) GetRemovedServices(services *[]SwarmService) *[]string GetServicesParameters(services *[]SwarmService) *[]map[string]string }
Servicer defines interface with mandatory methods
type SwarmService ¶
SwarmService defines internal structure with service information