chain

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package chain provides an adaptive wrapper over multiple object storage backends.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain struct {
	// contains filtered or unexported fields
}

Chain queries multiple object databases with an MRU backend preference.

func New

func New(backends ...objectstore.Store) *Chain

New creates a Chain from backends.

func (*Chain) Close

func (chain *Chain) Close() error

Close closes all backends and joins close errors.

func (*Chain) ReadBytesContent

func (chain *Chain) ReadBytesContent(id objectid.ObjectID) (objecttype.Type, []byte, error)

ReadBytesContent reads an object's type and content bytes from one backend that has it.

func (*Chain) ReadBytesFull

func (chain *Chain) ReadBytesFull(id objectid.ObjectID) ([]byte, error)

ReadBytesFull reads a full serialized object from one backend that has it.

func (*Chain) ReadHeader

func (chain *Chain) ReadHeader(id objectid.ObjectID) (objecttype.Type, int64, error)

ReadHeader reads object header data from one backend that has it.

func (*Chain) ReadReaderContent

func (chain *Chain) ReadReaderContent(id objectid.ObjectID) (objecttype.Type, int64, io.ReadCloser, error)

ReadReaderContent reads an object's type, declared content length, and content stream from one backend that has it.

func (*Chain) ReadReaderFull

func (chain *Chain) ReadReaderFull(id objectid.ObjectID) (io.ReadCloser, error)

ReadReaderFull reads a full serialized object stream from one backend that has it.

func (*Chain) ReadSize added in v0.1.28

func (chain *Chain) ReadSize(id objectid.ObjectID) (int64, error)

ReadSize reads object content length from one backend that has it.

Jump to

Keyboard shortcuts

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