src

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBackupFilePath string = "/backup"

DefaultBackupFilePath : If file path to save dump is not given, then default file path is used.

Variables

This section is empty.

Functions

func AddKVToConsul

func AddKVToConsul(sn, cn, props, config, replace string)

AddKVToConsul : Allows only to add KV-pairs in multi-consul setup, if the KV is already existing it will not update KV

func BackupConsulKV

func BackupConsulKV(cn, cp, fp string)

BackupConsulKV : Function to take json backups of consul and save to a backup file Saves json file of format {"key": "key1", "value": "value1", "flags": "flag0"}

func ConnectConsul

func ConnectConsul(address, datacentre, token string) (*api.Client, error)

ConnectConsul : Connect to consul server

func CreateConsulDetails

func CreateConsulDetails(cfp string) map[string]config.ConsulDetail

CreateConsulDetails : Read console params and yml file to generate console details

func DeleteKVFromConsul

func DeleteKVFromConsul(sn, cn, props, config string)

DeleteKVFromConsul : Deletes given keys from consul server

func ExecuteGoConsulKV

func ExecuteGoConsulKV()

ExecuteGoConsulKV : Driver code for goConsulKV

func RestoreConsulKV

func RestoreConsulKV(cn, cp, fp, sn string)

RestoreConsulKV : To restore consul from backup file Reads from json file of format {"key": "key1", "value": "value1", "flags": "flag0"} . BackupConsulKV saves the backup in same format.

func SyncConsulKVStore

func SyncConsulKVStore(source, target, sn, config, replace string)

SyncConsulKVStore : Sync Kv Store of source Consul Server with target Consul Server

func ValidateFilePath

func ValidateFilePath(path string) error

ValidateFilePath : Validates if the path provide is a file

Types

type KVDetails

type KVDetails struct {
	Key   string `json:"key"`
	Value []byte `json:"value"`
	Flags uint64 `json:"flags"`
}

KVDetails : Struct to marshal backup KV pair json

Jump to

Keyboard shortcuts

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