backup

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 24 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Runner

func Runner(version string, once bool) int

Runner is the main runner for a backup

Types

type Backup

type Backup struct {
	ACLFileChecksum  string
	ACLJSONData      []byte
	Client           *consul.Consul
	Config           *config.Config
	Storage          interfaces.StorageClient
	FileSystem       interfaces.FileSystem
	Archiver         interfaces.Archiver
	Logger           interfaces.Logger
	FullFilename     string
	KVFileChecksum   string
	KVJSONData       []byte
	LocalACLFileName string
	LocalFilePath    string
	LocalKVFileName  string
	LocalPQFileName  string
	PQFileChecksum   string
	PQJSONData       []byte
	RemoteFilePath   string
	StartTime        int64
}

Backup is the backup itself including configuration and data

func (*Backup) ACLsToJSON added in v0.1.6

func (b *Backup) ACLsToJSON()

ACLsToJSON used to marshall the data and put it on a Backup object

func (*Backup) KeysToJSON

func (b *Backup) KeysToJSON()

KeysToJSON used to marshall the data and put it on a Backup object

func (*Backup) PQsToJSON added in v0.1.6

func (b *Backup) PQsToJSON()

PQsToJSON used to marshall the data and put it on a Backup object

type ConsulAdapter added in v0.3.0

type ConsulAdapter struct {
	Client *consulapi.Client
}

ConsulAdapter wraps the consul API client to implement ConsulClient interface

func (*ConsulAdapter) CreateACL added in v0.3.0

func (c *ConsulAdapter) CreateACL(acl *consulapi.ACLEntry) error

CreateACL creates an ACL in consul

func (*ConsulAdapter) CreatePQ added in v0.3.0

CreatePQ creates a prepared query in consul

func (*ConsulAdapter) ListACLs added in v0.3.0

func (c *ConsulAdapter) ListACLs() ([]*consulapi.ACLEntry, error)

ListACLs lists all ACLs from consul

func (*ConsulAdapter) ListKeys added in v0.3.0

func (c *ConsulAdapter) ListKeys() (consulapi.KVPairs, error)

ListKeys lists all keys from consul

func (*ConsulAdapter) ListPQs added in v0.3.0

ListPQs lists all prepared queries from consul

func (*ConsulAdapter) PutKV added in v0.3.0

func (c *ConsulAdapter) PutKV(key string, value []byte) error

PutKV puts a key-value pair in consul

type Meta added in v0.1.6

type Meta struct {
	ACLSha256             string
	ConsulSnapshotVersion string
	EndTime               int64
	KVSha256              string
	NodeName              string
	PQSha256              string
	StartTime             int64
}

Meta holds the meta struct to write inside the compressed data

Jump to

Keyboard shortcuts

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