consul

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package consul contains helper functions for Consul storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

Action represent possible Consul changes.

const (
	ConsulAdd Action = iota
	ConsulUpdate
	ConsulRemove
)

Actions for Consul storage.

type Change

type Change struct {
	Action Action
	Key    string
	Val    string
	NewVal string
}

Change represents single Consul change.

func GetChanges

func GetChanges(pairs api.KVPairs, config []byte, format string) ([]Change, error)

GetChanges creates collection of changes from Consul KVPairs.

type NestedMap

type NestedMap map[string]interface{}

NestedMap is a map type for parsing Consul key/values in nested structure.

func KVPairsToMap

func KVPairsToMap(pairs api.KVPairs) NestedMap

KVPairsToMap creates NestedMap from Consul KVPairs.

func (NestedMap) Add

func (j NestedMap) Add(path, value string)

Add value to NestedMap with nested key separated with keySep.

Jump to

Keyboard shortcuts

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