omnistorage

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 11 Imported by: 0

README

OmniStorage

Go CI Go Lint Go SAST Go Report Card Docs Visualization License

Unified storage abstraction layer for Go. This is an aggregator package that re-exports the core interfaces from omnistorage-core and imports all provider backends for automatic registration.

Installation

go get github.com/plexusone/omnistorage

Quick Start

import (
    "github.com/plexusone/omnistorage"
)

// All backends are automatically registered via init()
backend, err := omnistorage.Open("s3", map[string]string{
    "bucket": "my-bucket",
    "region": "us-east-1",
})

Included Backends

All 9 backends are automatically registered when you import this package:

Core Backends (from omnistorage-core)
Backend Registry Name Description
File file Local filesystem storage
Memory memory In-memory storage (testing)
Channel channel Go channel-based IPC
SFTP sftp SSH file transfer
Dropbox dropbox Dropbox cloud storage
Cloud Backends (from omni-* packages)
Backend Provider Registry Name
Amazon S3 omni-aws s3
GitHub Releases omni-github github
Google Cloud Storage omni-google gcs
Google Drive omni-google drive

Key-Value Storage

KVS interfaces are also re-exported for session state, caching, and structured data:

import "github.com/plexusone/omnistorage/kvs/sqlite"

store, _ := sqlite.New(sqlite.Config{Path: "data.db"})
store.Set(ctx, "session:123", data, time.Hour)

Minimal Dependencies

For minimal dependencies, import omnistorage-core directly:

import "github.com/plexusone/omnistorage-core"

// Gets: file, memory, channel, sftp, dropbox (no cloud SDKs)
backend, err := omnistorage.Open("file", map[string]string{"root": "/data"})

Or import only specific backends:

import (
    "github.com/plexusone/omnistorage-core/object"
    _ "github.com/plexusone/omni-aws/omnistorage/backend/s3"
)

backend, err := object.Open("s3", map[string]string{
    "bucket": "my-bucket",
    "region": "us-east-1",
})

Documentation

License

MIT

Documentation

Overview

Package omnistorage provides a unified storage abstraction layer for Go.

This is an aggregator package that re-exports the core interfaces from omnistorage-core and imports all provider backends for automatic registration.

For minimal dependencies, import omnistorage-core directly and only the specific provider backends you need.

Object Storage

For file/blob storage (documents, media, backups):

import (
    "github.com/plexusone/omnistorage"
    _ "github.com/plexusone/omni-aws/omnistorage/backend/s3"
)

backend, _ := omnistorage.Open("s3", map[string]string{
    "bucket": "my-bucket",
    "region": "us-east-1",
})

Key-Value Storage

For session state, caching, and structured data:

import (
    "github.com/plexusone/omnistorage"
    "github.com/plexusone/omnistorage/kvs/sqlite"
)

store, _ := sqlite.New(sqlite.Config{Path: "data.db"})
store.Set(ctx, "session:123", data, time.Hour)

The kvs.Store interface is re-exported as omnistorage.Store.

Index

Constants

View Source
const (
	HashMD5    = object.HashMD5
	HashSHA1   = object.HashSHA1
	HashSHA256 = object.HashSHA256
	HashCRC32C = object.HashCRC32C
)

Re-export hash types.

Variables

View Source
var (
	ErrKVSNotFound = kvs.ErrNotFound
	ErrKVSClosed   = kvs.ErrClosed
)

Re-export kvs errors.

View Source
var (
	// Register registers a backend factory.
	Register = object.Register

	// Open creates a backend from the registry.
	Open = object.Open

	// WithContentType sets the content type for a writer.
	WithContentType = object.WithContentType

	// WithMetadata sets metadata for a writer.
	WithMetadata = object.WithMetadata

	// WithOffset sets the read offset.
	WithOffset = object.WithOffset

	// WithLimit sets the read limit.
	WithLimit = object.WithLimit

	// ApplyWriterOptions applies writer options.
	ApplyWriterOptions = object.ApplyWriterOptions

	// ApplyReaderOptions applies reader options.
	ApplyReaderOptions = object.ApplyReaderOptions
)

Re-export core functions.

View Source
var (
	ErrNotFound         = object.ErrNotFound
	ErrPermissionDenied = object.ErrPermissionDenied
	ErrBackendClosed    = object.ErrBackendClosed
	ErrNotSupported     = object.ErrNotSupported
	ErrInvalidPath      = object.ErrInvalidPath
	ErrWriterClosed     = object.ErrWriterClosed
)

Re-export core errors.

Functions

This section is empty.

Types

type Backend

type Backend = object.Backend

Backend represents a storage backend (S3, GCS, local file, etc.).

type Document added in v0.2.0

type Document = kvs.Document

Document represents a stored document.

type DocumentStore added in v0.2.0

type DocumentStore = kvs.DocumentStore

DocumentStore extends Store with document operations.

type ExtendedBackend

type ExtendedBackend = object.ExtendedBackend

ExtendedBackend extends Backend with additional operations.

type Features

type Features = object.Features

Features describes capabilities of a backend.

type HashType

type HashType = object.HashType

HashType identifies a hash algorithm.

type KVSConfig added in v0.2.0

type KVSConfig = kvs.Config

Config configures storage creation.

type ListableStore added in v0.2.0

type ListableStore = kvs.ListableStore

ListableStore extends Store with key listing.

type ObjectInfo

type ObjectInfo = object.ObjectInfo

ObjectInfo contains metadata about a stored object.

type ReaderOption

type ReaderOption = object.ReaderOption

ReaderOption configures a reader.

type RecordReader

type RecordReader = object.RecordReader

RecordReader reads framed records from an underlying reader.

type RecordWriter

type RecordWriter = object.RecordWriter

RecordWriter writes framed records to an underlying writer.

type Store added in v0.2.0

type Store = kvs.Store

Store is the primary key-value storage interface.

type WriterOption

type WriterOption = object.WriterOption

WriterOption configures a writer.

Directories

Path Synopsis
kvs
memory
Package memory re-exports the in-memory key-value storage backend.
Package memory re-exports the in-memory key-value storage backend.
sqlite
Package sqlite re-exports the SQLite key-value storage backend.
Package sqlite re-exports the SQLite key-value storage backend.

Jump to

Keyboard shortcuts

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