Versions in this module Expand all Collapse all v0 v0.7.1 Dec 20, 2017 Changes in this version + const DefaultQueryWaitDuration + const ServiceTagHTTP + const ServiceTagRPC + const ServiceTagSerf + type AgentAPI interface + CheckDeregister func(checkID string) error + CheckRegister func(check *api.AgentCheckRegistration) error + Checks func() (map[string]*api.AgentCheck, error) + ServiceDeregister func(serviceID string) error + ServiceRegister func(service *api.AgentServiceRegistration) error + Services func() (map[string]*api.AgentService, error) + UpdateTTL func(id, output, status string) error + type AllocRegistration struct + Tasks map[string]*TaskRegistration + func (a *AllocRegistration) NumChecks() int + func (a *AllocRegistration) NumServices() int + type CatalogAPI interface + Datacenters func() ([]string, error) + Service func(service, tag string, q *api.QueryOptions) ([]*api.CatalogService, *api.QueryMeta, error) + type ChecksAPI interface + Checks func() (map[string]*api.AgentCheck, error) + type MockAgent struct + func NewMockAgent() *MockAgent + func (c *MockAgent) CheckDeregister(checkID string) error + func (c *MockAgent) CheckRegister(check *api.AgentCheckRegistration) error + func (c *MockAgent) CheckRegs() []*api.AgentCheckRegistration + func (c *MockAgent) Checks() (map[string]*api.AgentCheck, error) + func (c *MockAgent) ServiceDeregister(serviceID string) error + func (c *MockAgent) ServiceRegister(service *api.AgentServiceRegistration) error + func (c *MockAgent) Services() (map[string]*api.AgentService, error) + func (c *MockAgent) SetStatus(s string) string + func (c *MockAgent) UpdateTTL(id string, output string, status string) error + type MockCatalog struct + func NewMockCatalog(l *log.Logger) *MockCatalog + func (m *MockCatalog) Datacenters() ([]string, error) + func (m *MockCatalog) Service(service, tag string, q *api.QueryOptions) ([]*api.CatalogService, *api.QueryMeta, error) + type ServiceClient struct + func NewServiceClient(consulClient AgentAPI, skipVerifySupport bool, logger *log.Logger) *ServiceClient + func (c *ServiceClient) AllocRegistrations(allocID string) (*AllocRegistration, error) + func (c *ServiceClient) RegisterAgent(role string, services []*structs.Service) error + func (c *ServiceClient) RegisterTask(allocID string, task *structs.Task, restarter TaskRestarter, ...) error + func (c *ServiceClient) RemoveTask(allocID string, task *structs.Task) + func (c *ServiceClient) Run() + func (c *ServiceClient) Shutdown() error + func (c *ServiceClient) UpdateTask(allocID string, existing, newTask *structs.Task, restarter TaskRestarter, ...) error + type ServiceRegistration struct + Checks []*api.AgentCheck + Service *api.AgentService + type TaskRegistration struct + Services map[string]*ServiceRegistration + type TaskRestarter interface + Restart func(source, reason string, failure bool)