Documentation ¶
Index ¶
Constants ¶
View Source
const ServiceName = "service-manager"
The service name and signature
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
Server is main application struct
func New ¶
New create a new service manager with the provided time to live and webhook urls, if any webhook url is provided it start a background job to check and notify services changes to the webhook urls
func (*Server) GetServices ¶
func (s *Server) GetServices() []ServiceInfo
GetServices returns all the registered services
func (*Server) RegisterService ¶
func (s *Server) RegisterService(service ServiceInfo)
RegisterService register a new service or replace it with the default time to live
func (*Server) SetHttpClient ¶
SetHttpClient allows setting a custom http client used on the webhook calls
type ServiceInfo ¶
type ServiceInfo struct { Name string `json:"name"` Endpoint string `json:"endpoint"` Value interface{} `json:"value,omitempty"` }
ServiceInfo is the representation of a registered service
Click to show internal directories.
Click to hide internal directories.