jetup

package module
v0.0.0-...-4c5986c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 4 Imported by: 0

README

jetup

Jetup is a nats jetstream stream backup utility, which support incremental backups to many backup stores, like aws s3, azure blob storage or directly to file system.

Can be simply executed as cronjob to get regularly backups.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(store BackupStore) *jetup

Types

type BackupPackage

type BackupPackage interface {
	AddMessage(msg *Message) error
}

BackupPackage combines multiple messages into single package.

type BackupStore

type BackupStore interface {
	// Creates a new backup. Careful creation can be delayed until first packages is committed.
	// A new backup should only create after commit a package to previously created backup.
	NewBackup(ctx context.Context) (BackupStoreEntry, error)
}

BackupStore allows storage of multiple backups in backup target, e.g. filesystem, s3 or other.

type BackupStoreEntry

type BackupStoreEntry interface {
	// Creates a new package, that can be committed afterwards to the backup.
	NewPackage(ctx context.Context) (BackupPackage, error)

	// Commit a package. Actually writes data to the backup target.
	CommitPackage(ctx context.Context, pkg BackupPackage) error
}

type Message

type Message struct {
	Subject string
	Body    []byte
	Headers map[string][]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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