Documentation ¶
Index ¶
- Constants
- func AddKVToConsul(sn, cn, props, config, replace string)
- func BackupConsulKV(cn, cp, fp string)
- func ConnectConsul(address, datacentre, token string) (*api.Client, error)
- func CreateConsulDetails(cfp string) map[string]config.ConsulDetail
- func DeleteKVFromConsul(sn, cn, props, config string)
- func ExecuteGoConsulKV()
- func RestoreConsulKV(cn, cp, fp, sn string)
- func SyncConsulKVStore(source, target, sn, config, replace string)
- func ValidateFilePath(path string) error
- type KVDetails
Constants ¶
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 ¶
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 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 ¶
ValidateFilePath : Validates if the path provide is a file