dump

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package dump manages the scheduled dump of the source database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

type Scheduler struct {
	// contains filtered or unexported fields
}

Scheduler runs engine.Dump on a cron schedule and atomically replaces the local dump file on success.

func New

func New(cfg *config.Config, eng engine.Engine, events *store.EventStore, docker *client.Client) *Scheduler

New creates a Scheduler. Call Start() to begin the cron loop.

func (*Scheduler) RunOnce

func (s *Scheduler) RunOnce(ctx context.Context) error

RunOnce executes a single dump cycle. When obfuscation rules are configured, the raw dump is restored into a staging container, scrubbed, and re-dumped so the final dump file has PII already removed before any copy restores it.

  1. Dump source → <destPath>.raw (or .tmp when no obfuscation rules)
  2. If obfuscation rules: restore into staging, apply rules, re-dump → <destPath>.tmp
  3. Atomically rename .tmp → destPath

func (*Scheduler) Start

func (s *Scheduler) Start() error

Start registers the dump job with the cron scheduler and starts it.

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop halts the cron scheduler, waiting for any in-progress run to complete.

Jump to

Keyboard shortcuts

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