https://github.com/jinjie/lsembed
Simple module to embed litestream replication in your Go project
https://github.com/jinjie/lsembed
go-module golang litestream
Last synced: 23 days ago
JSON representation
Simple module to embed litestream replication in your Go project
- Host: GitHub
- URL: https://github.com/jinjie/lsembed
- Owner: jinjie
- Created: 2023-06-27T03:27:19.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-27T03:28:57.000Z (almost 3 years ago)
- Last Synced: 2025-12-17T10:28:05.907Z (6 months ago)
- Topics: go-module, golang, litestream
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Litestream Embeded
Simple Go module to embed [litestream](https://github.com/benbjohnson/litestream) replication in your Go project.
Adapted from [example](https://github.com/benbjohnson/litestream-library-example/blob/1cee7706d435d241792e01c502f8f37747445d09/main.go)
## Get
`go get github.com/jinjie/lsembed`
## Example
```
// ...
replica := litestream.NewReplica(
litestream.NewDB(app.DataDir()+"/data.db"),
"s3",
)
replica.Client = &s3.ReplicaClient{
AccessKeyID: "ACCESSKEY",
SecretAccessKey: "SECRETKEY",
Bucket: "litestream-test-bucket",
Region: "ap-southeast-1",
Path: "path",
}
lsdb, err := lsembed.Replicate(replica)
if err != nil {
log.Fatal().Err(err).Msg("failed to replicate")
}
defer lsdb.Close()
//..
```