consul

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package consul provides facilities for working with Consul.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a client for Consul API. All keys in KV operations are prefixed to avoid collisions.

func NewClient

func NewClient(addr string) (*Client, error)

NewClient creates a new client for given Consul address.

func (*Client) DeleteKV

func (c *Client) DeleteKV(key string) error

DeleteKV deletes given key from Consul.

func (*Client) GetKV

func (c *Client) GetKV(key string) ([]byte, error)

GetKV returns value for a given key from Consul, or nil, if key does not exist.

func (*Client) GetNodes added in v1.15.0

func (c *Client) GetNodes() ([]*Node, error)

GetNodes returns list of nodes.

func (*Client) PutKV

func (c *Client) PutKV(key string, value []byte) error

PutKV puts given key/value pair into Consul.

type Node added in v1.15.0

type Node = api.Node

FIXME remove alias after reconsidering the usage of GetNodes() method Currently it breaks encapsulation of this service

Jump to

Keyboard shortcuts

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