consul_utils

package module
v0.0.0-...-8974ebe Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2017 License: MIT Imports: 3 Imported by: 0

README

consul-utils

Package contains functions to work with Consul KV and function to get the list of Service's addresses by provided name and tag

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServiceError = errors.New("Service not found")
)

Functions

func Del

func Del(client *api.Client, key string, opt QueryOptions) (bool, error)

func DelTree

func DelTree(client *api.Client, prefix string, opt QueryOptions) (bool, error)

func GetKV

func GetKV(client *api.Client, key string, opt QueryOptions) (string, error)

func PutKV

func PutKV(client *api.Client, key, value string, opt QueryOptions) (bool, error)

Types

type QueryOptions

type QueryOptions struct {
	Datacenter string
	Token      string
}

type ServiceAddr

type ServiceAddr struct {
	Addr        string
	ServiceID   string
	ServiceAddr string
	ServicePort int
}

func GetServiceAddr

func GetServiceAddr(client *api.Client, service, tag string, opt QueryOptions) (addrs []*ServiceAddr, err error)

Jump to

Keyboard shortcuts

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