consul

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConsulTestServer

func CreateConsulTestServer(dc string, t *testing.T) *testutil.TestServer

func IsTaskHealthy

func IsTaskHealthy(healthChecksResults []tasks.HealthCheckResult) bool

func MarathonTaskToConsulService

func MarathonTaskToConsulService(task tasks.Task, healthChecks []apps.HealthCheck, labels map[string]string) *consulapi.AgentServiceRegistration

Types

type Agents

type Agents interface {
	GetAgent(string) (*consulapi.Client, error)
	GetAnyAgent() (*consulapi.Client, error)
}

type Auth

type Auth struct {
	Enabled  bool
	Username string
	Password string
}

type ConcurrentAgents

type ConcurrentAgents struct {
	// contains filtered or unexported fields
}

func NewAgents

func NewAgents(config *ConsulConfig) *ConcurrentAgents

func (*ConcurrentAgents) GetAgent

func (a *ConcurrentAgents) GetAgent(agentHost string) (*consulapi.Client, error)

func (*ConcurrentAgents) GetAnyAgent

func (a *ConcurrentAgents) GetAnyAgent() (*consulapi.Client, error)

type Consul

type Consul struct {
	// contains filtered or unexported fields
}

func ConsulClientAtServer

func ConsulClientAtServer(server *testutil.TestServer) *Consul

func New

func New(config ConsulConfig) *Consul

func (*Consul) Deregister

func (c *Consul) Deregister(serviceId tasks.Id, agentAddress string) error

func (*Consul) GetAgent added in v0.3.1

func (c *Consul) GetAgent(agentAddress string) (*consulapi.Client, error)

func (*Consul) GetAllServices

func (c *Consul) GetAllServices() ([]*consulapi.CatalogService, error)

func (*Consul) GetServices added in v0.3.1

func (c *Consul) GetServices(name tasks.AppId) ([]*consulapi.CatalogService, error)

func (*Consul) Register

func (c *Consul) Register(service *consulapi.AgentServiceRegistration) error

type ConsulConfig

type ConsulConfig struct {
	Auth       Auth
	Port       string
	SslEnabled bool
	SslVerify  bool
	SslCert    string
	SslCaCert  string
	Token      string
}

type ConsulServices

type ConsulServices interface {
	GetAllServices() ([]*consulapi.CatalogService, error)
	GetServices(name tasks.AppId) ([]*consulapi.CatalogService, error)
	Register(service *consulapi.AgentServiceRegistration) error
	Deregister(serviceId tasks.Id, agentAddress string) error
	GetAgent(agentAddress string) (*consulapi.Client, error)
}

type ConsulStub

type ConsulStub struct {
	ErrorServices map[tasks.Id]error
	// contains filtered or unexported fields
}

func NewConsulStub

func NewConsulStub() *ConsulStub

func (*ConsulStub) Deregister

func (c *ConsulStub) Deregister(serviceId tasks.Id, agent string) error

func (*ConsulStub) GetAgent added in v0.3.1

func (c *ConsulStub) GetAgent(agentAddress string) (*consulapi.Client, error)

func (ConsulStub) GetAllServices

func (c ConsulStub) GetAllServices() ([]*consulapi.CatalogService, error)

func (ConsulStub) GetServices added in v0.3.1

func (c ConsulStub) GetServices(name tasks.AppId) ([]*consulapi.CatalogService, error)

func (*ConsulStub) Register

func (c *ConsulStub) Register(service *consulapi.AgentServiceRegistration) error

func (*ConsulStub) RegisteredServicesIds

func (c *ConsulStub) RegisteredServicesIds() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL