consul

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateConsulRegionClient

func CreateConsulRegionClient(c *config.Config, region string) (*api.Client, error)

CreateConsulRegionClient ...

Types

type ConsulCluster

type ConsulCluster struct {
	ClusterClient  *api.Client
	RegionChannels *ConsulRegionChannels
	RegionClients  *ConsulRegionClients
}

ConsulCluster derp

func NewConsulCluster

func NewConsulCluster(clusterClient *api.Client, clients *ConsulRegionClients, channels *ConsulRegionChannels) *ConsulCluster

NewConsulCluster ...

func (*ConsulCluster) StartWatchers

func (c *ConsulCluster) StartWatchers()

StartWatchers ...

type ConsulClusterBroadcastChannels

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

ConsulClusterBroadcastChannels ...

type ConsulConnection

type ConsulConnection struct {
	ID uuid.UUID
	// contains filtered or unexported fields
}

ConsulConnection monitors the websocket connection. It processes any action received on the websocket and sends out actions on Consul state changes. It maintains a set to keep track of the running watches.

func NewConsulConnection

func NewConsulConnection(hub *ConsulHub, socket *websocket.Conn, consulRegion *ConsulRegion, channels *ConsulRegionBroadcastChannels) *ConsulConnection

NewConsulConnection creates a new connection.

func (*ConsulConnection) Debugf

func (c *ConsulConnection) Debugf(format string, args ...interface{})

Debugf is a stupid wrapper for logger.Debugf

func (*ConsulConnection) Errorf

func (c *ConsulConnection) Errorf(format string, args ...interface{})

Errorf is a stupid wrapper for logger.Errorf

func (*ConsulConnection) Handle

func (c *ConsulConnection) Handle()

Handle monitors the websocket connection for incoming actions. It sends out actions on state changes.

func (*ConsulConnection) Infof

func (c *ConsulConnection) Infof(format string, args ...interface{})

Infof is a stupid wrapper for logger.Infof

func (*ConsulConnection) Warningf

func (c *ConsulConnection) Warningf(format string, args ...interface{})

Warningf is a stupid wrapper for logger.Warningf

type ConsulHub

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

ConsulHub keeps track of all the websocket connections and sends state updates from Nomad to all connections.

func InitializeConsul

func InitializeConsul(cfg *config.Config) (*ConsulHub, bool)

InitializeConsul ...

func NewConsulHub

func NewConsulHub(cluster *ConsulCluster) *ConsulHub

NewConsulHub initializes a new hub.

func (*ConsulHub) Handler

func (h *ConsulHub) Handler(w http.ResponseWriter, r *http.Request)

Handler establishes the websocket connection and calls the connection handler.

func (*ConsulHub) Run

func (h *ConsulHub) Run()

Run (un)registers websocket connections and broadcasts Nomad state updates to all connections.

type ConsulInternalNode

type ConsulInternalNode struct {
	Node            string
	Address         string
	TaggedAddresses map[string]string
	Services        []*api.AgentService
	Checks          []*api.AgentCheck
}

ConsulInternalNode ...

type ConsulInternalNodes

type ConsulInternalNodes []*ConsulInternalNode

ConsulInternalNodes ...

type ConsulInternalService

type ConsulInternalService struct {
	Name           string
	Nodes          []string
	ChecksPassing  int64
	ChecksWarning  int64
	ChecksCritical int64
}

ConsulInternalService ...

type ConsulInternalServices

type ConsulInternalServices []*ConsulInternalService

ConsulInternalServices ...

type ConsulRegion

type ConsulRegion struct {
	Config *config.Config
	Client *api.Client
	// contains filtered or unexported fields
}

ConsulRegion keeps track of the ConsulRegion state. It monitors changes to allocations, evaluations, jobs and nodes and broadcasts them to all connected websockets. It also exposes an API client for the ConsulRegion server.

func NewConsulRegion

func NewConsulRegion(c *config.Config, client *api.Client, channels *ConsulRegionBroadcastChannels) (*ConsulRegion, error)

NewConsulRegion configures the Consul API client and initializes the internal state.

func (*ConsulRegion) StartWatchers

func (c *ConsulRegion) StartWatchers()

StartWatchers derp

type ConsulRegionBroadcastChannels

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

ConsulRegionBroadcastChannels contains all the channels for resources hashi-ui automatically maintain active lists of

type ConsulRegionChannels

type ConsulRegionChannels map[string]*ConsulRegionBroadcastChannels

ConsulRegionChannels ...

type ConsulRegionClients

type ConsulRegionClients map[string]*ConsulRegion

ConsulRegionClients ...

type ConsulService

type ConsulService struct {
	Name  string
	Nodes []string
	Tags  []string
}

ConsulService ...

type ConsulServices

type ConsulServices map[string]*ConsulService

ConsulServices ...

Jump to

Keyboard shortcuts

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