Help us shape the future of Go! Take the 2026 Go Developer Survey

applicationbackup

package
v0.4.15 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatMagic   = "BASEHARBOR-APP-BACKUP"
	SchemaVersion = 1

	MaxEntries            = 128
	MaxEntryBytes   int64 = 512 << 20
	MaxPayloadBytes int64 = 2 << 30
)

Variables

This section is empty.

Functions

func ApplicationManifestFromPayload

func ApplicationManifestFromPayload(payload Payload) (application.Manifest, error)

func Build

func Build(application, environment string, createdAt time.Time, entries []PayloadEntry, password []byte) ([]byte, error)

func OpenBaoBackupFromPayload

func OpenBaoBackupFromPayload(application, environment string, payload Payload) (openbao.ApplicationSecretBackup, error)

func PostgresBackupsFromPayload

func PostgresBackupsFromPayload(m application.Manifest, payload Payload) ([]application.PostgresBackup, error)

Types

type Entry

type Entry struct {
	Name   string `json:"name"`
	Kind   string `json:"kind"`
	Size   int64  `json:"size"`
	SHA256 string `json:"sha256"`
}

func (Entry) Validate

func (e Entry) Validate() error

type Envelope

type Envelope struct {
	Magic      string    `json:"magic"`
	Version    int       `json:"version"`
	KDF        KDFParams `json:"kdf"`
	Nonce      string    `json:"nonce"`
	Ciphertext string    `json:"ciphertext"`
}

type KDFParams

type KDFParams struct {
	Algorithm string `json:"algorithm"`
	Time      uint32 `json:"time"`
	MemoryKiB uint32 `json:"memory_kib"`
	Threads   uint8  `json:"threads"`
	KeyLength uint32 `json:"key_length"`
	Salt      string `json:"salt"`
}

type Manifest

type Manifest struct {
	SchemaVersion int       `json:"schema_version"`
	Application   string    `json:"application"`
	Environment   string    `json:"environment"`
	CreatedAt     time.Time `json:"created_at"`
	Entries       []Entry   `json:"entries"`
}

func (Manifest) Validate

func (m Manifest) Validate() error

type Payload

type Payload struct {
	Manifest Manifest       `json:"manifest"`
	Entries  []PayloadEntry `json:"entries"`
}

func Open

func Open(archive, password []byte) (Payload, error)

func (Payload) Validate

func (p Payload) Validate() error

type PayloadEntry

type PayloadEntry struct {
	Name string `json:"name"`
	Data []byte `json:"data"`
}

func ApplicationManifestPayloadEntry

func ApplicationManifestPayloadEntry(m application.Manifest) (PayloadEntry, error)

func OpenBaoPayloadEntry

func OpenBaoPayloadEntry(backup openbao.ApplicationSecretBackup) (PayloadEntry, error)

func PostgresPayloadEntries

func PostgresPayloadEntries(backups []application.PostgresBackup) ([]PayloadEntry, error)

Jump to

Keyboard shortcuts

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