Skip to content
/ lsembed Public

Simple module to embed litestream replication in your Go project

Notifications You must be signed in to change notification settings

jinjie/lsembed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Litestream Embeded

Simple Go module to embed litestream replication in your Go project.

Adapted from example

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()
//..

About

Simple module to embed litestream replication in your Go project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages