polystore

module
v0.0.0-...-3d809f4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT

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/flowshot-io/polystore

Usage

First, import the storage backends you want to use:

import (
    _ "github.com/flowshot-io/polystore/pkg/services/fs"
    _ "github.com/flowshot-io/polystore/pkg/services/s3"

    "github.com/flowshot-io/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

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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