Categorygithub.com/backdrop-run/polystore
module
0.0.0-20241114222725-0085ac75c854
Repository: https://github.com/backdrop-run/polystore.git
Documentation: pkg.go.dev

# README

PolyStore

PolyStore is a flexible and extensible Go library for unifying and abstracting different storage backends.

Github tag Go Doc Go Report Card MIT license

It supports various storage services including:

Features

  • Allows operations to be performed without worrying about the specifics of the storage backend.
  • Extensible design allows more storage backends to be added easily.

Installation

go get github.com/backdrop-run/polystore

Usage

First, import the storage backends you want to use:

import (
    _ "github.com/backdrop-run/polystore/pkg/services/fs"
    _ "github.com/backdrop-run/polystore/pkg/services/s3"

    "github.com/backdrop-run/polystore/pkg/services"
)

Then, you can create a storage instance using a connection string:

connectionString := "s3://myBucketName/my/prefix?endpoint=s3.amazonaws.com&region=region&accessKey=accessKey&secretKey=secretKey&sse=sse"
storage, err := services.New(connectionString)
if err != nil {
    // handle error
}

Adding new backends

To add a new backend, you need to implement the types.Storage interface and register a factory function for your backend in the services package. See the existing backends for examples.

License

MIT

# Packages

No description provided by the author