consul

package
v0.0.0-...-e7ab01c Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	CreateIndex uint64
	ID          string
	ModifyIndex uint64
	Name        string
	Rules       string
	Type        string
}

ACL represents a ACL

type CatalogService

type CatalogService struct {
	ID                       string
	Node                     string
	Address                  string
	Datacenter               string
	TaggedAddresses          map[string]string
	NodeMeta                 map[string]string
	ServiceID                string
	ServiceName              string
	ServiceAddress           string
	ServiceTags              []string
	ServicePort              int
	ServiceEnableTagOverride bool
	CreateIndex              uint64
	ModifyIndex              uint64
}

CatalogService represents a service

type Consul

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

Consul represents a consul connection

func GetConsul

func GetConsul(config *configuration.Struct) *Consul

GetConsul gets a

func (*Consul) GetDCs

func (c *Consul) GetDCs(dc string) ([]DC, error)

GetDCs gets a list of available DCs from Consul

func (*Consul) GetKVs

func (c *Consul) GetKVs(key string, dcs []DC) ([]KV, error)

GetKVs gets a list of KeyValues from Consul from all given DCs

func (*Consul) WriteKVs

func (c *Consul) WriteKVs(kvs []KV, ignoreDC, dcprefix bool, setprefix string) error

WriteKVs writes KVs to consul

type DC

type DC struct {
	Name string
}

DC represents a Datacenter

type KV

type KV struct {
	// Key is the name of the key. It is also part of the URL path when accessed
	// via the API.
	Key string

	// CreateIndex holds the index corresponding the creation of this KVPair. This
	// is a read-only field.
	CreateIndex uint64

	// ModifyIndex is used for the Check-And-Set operations and can also be fed
	// back into the WaitIndex of the QueryOptions in order to perform blocking
	// queries.
	ModifyIndex uint64

	// LockIndex holds the index corresponding to a lock on this key, if any. This
	// is a read-only field.
	LockIndex uint64

	// Flags are any user-defined flags on the key. It is up to the implementer
	// to check these values, since Consul does not treat them specially.
	Flags uint64

	// Value is the value for the key. This can be any value, but it will be
	// base64 encoded upon transport.
	Value []byte

	// Session is a string representing the ID of the session. Any other
	// interactions with this key over the same session must specify the same
	// session ID.
	Session string

	// Not implemented yet in consul API
	Regex string

	Datacenter string
}

KV represents a Key Value Pair

func (*KV) Equals

func (kv *KV) Equals(ckv KV) bool

Equals checks if to kv are equal in tearms of content

type Node

type Node struct {
	ID              string
	Node            string
	Address         string
	Datacenter      string
	TaggedAddresses map[string]string
	Meta            map[string]string
	CreateIndex     uint64
	ModifyIndex     uint64
}

Node represents a Node

Jump to

Keyboard shortcuts

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