consul

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package consul reads configuration from the Consul KV store

Consul is a highly available and distributed service discovery and key-value store designed with support for the modern data center to make distributed systems and configuration easy.

e.g. CONFIG_URI=consul://prod.consul.cloud.com:8301/my/key?dc=frankfurt1&token=123

Index

Constants

View Source
const Name = "consul"

Name contains the adapter registered name

Variables

View Source
var ErrMissingStoreKey = errors.New("cannot initialise config without store key")

ErrMissingStoreKey means the given URL does not contain any key (path)

View Source
var ErrStoreKeyNotFound = errors.New("store config does not exist")

ErrStoreKeyNotFound means the configuration does not exist on Consul

Functions

func New

func New(uri *url.URL) (a.Store, error)

New returns a new file config store

Types

type Store

type Store struct {
	Client *api.Client
	Config *api.Config
	Key    string
}

Store reads config from Consul K/V

func (*Store) Load

func (s *Store) Load() (io.ReadCloser, error)

Load implements Store

Jump to

Keyboard shortcuts

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