store

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package store is a registry for Store factories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, key string, conf map[string]interface{}) (bs.Store, error)

Create creates a bs.Store of the type indicated by key, using the supplied configuration.

func FromConfigFile added in v0.4.0

func FromConfigFile(ctx context.Context, filename string) (bs.Store, error)

FromConfigFile loads a config file in JSON format from the given filename. It creates a bs.Store of the type indicated by its `type` key. The rest of the JSON object must be the config for a store of the given type.

func Register

func Register(key string, f Factory)

Register registers f as a factory for creating blob stores of the type named by key.

func Sync

func Sync(ctx context.Context, stores []bs.Store) error

Sync synchronizes two or more stores. It runs ListRefs on all input stores. When a ref is found to be in some but not all stores, its blob is added to the stores where it's missing.

Types

type Factory

type Factory = func(context.Context, map[string]interface{}) (bs.Store, error)

Factory is a function that can create a blob store from a configuration object.

Directories

Path Synopsis
Package file implements a blob store as a file hierarchy.
Package file implements a blob store as a file hierarchy.
Package gcs implements a blob store on Google Cloud Storage.
Package gcs implements a blob store on Google Cloud Storage.
Package logging implements a store that delegates everything to a nested store, logging operations as they happen.
Package logging implements a store that delegates everything to a nested store, logging operations as they happen.
Package lru implements a blob store that acts as a least-recently-used cache for a nested blob store.
Package lru implements a blob store that acts as a least-recently-used cache for a nested blob store.
Package mem implements an in-memory blob store.
Package mem implements an in-memory blob store.
Package pg implements a blob store in a Postgresql relational database schema.
Package pg implements a blob store in a Postgresql relational database schema.
Package rpc defines an RPC server managing a blob store, and a client for it that implements bs.Store (and anchor.Store).
Package rpc defines an RPC server managing a blob store, and a client for it that implements bs.Store (and anchor.Store).
Package sqlite3 implements a blob store in a Sqlite3 relational database schema.
Package sqlite3 implements a blob store in a Sqlite3 relational database schema.
Package transform implements a blob store that can transform blobs into and out of a nested store.
Package transform implements a blob store that can transform blobs into and out of a nested store.

Jump to

Keyboard shortcuts

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