s3

command
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Example: Litestream Library Usage with S3 and Restore-on-Startup

This example demonstrates a production-like pattern for using Litestream: - Check if local database exists - If not, restore from S3 backup (if available) - Start replication to S3 - Graceful shutdown

Environment variables:

  • AWS_ACCESS_KEY_ID: AWS access key
  • AWS_SECRET_ACCESS_KEY: AWS secret key
  • LITESTREAM_BUCKET: S3 bucket name (e.g., "my-backup-bucket")
  • LITESTREAM_PATH: Path within bucket (e.g., "databases/myapp")
  • AWS_REGION: AWS region (default: us-east-1)

Run: go run main.go

Jump to

Keyboard shortcuts

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