sqlobjectstore

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterOption added in v0.15.6

type FilterOption func(*FilterOptions)

FilterOptions

func FilterByCID added in v0.17.0

func FilterByCID(hs ...object.CID) FilterOption

func FilterByObjectType

func FilterByObjectType(typePatterns ...string) FilterOption

func FilterByOwner

func FilterByOwner(hs ...crypto.PublicKey) FilterOption

func FilterByStreamCID added in v0.17.0

func FilterByStreamCID(hs ...object.CID) FilterOption

func FilterLimit added in v0.15.6

func FilterLimit(limit, offset int) FilterOption

func FilterOrderBy added in v0.15.6

func FilterOrderBy(orderBy string) FilterOption

func FilterOrderDir added in v0.15.6

func FilterOrderDir(orderDir string) FilterOption

type FilterOptions added in v0.15.6

type FilterOptions struct {
	// Filters are used to perform db queries for these filters
	// TODO find a better name for this
	Filters struct {
		ObjectCIDs   []object.CID
		StreamCIDs   []object.CID
		ContentTypes []string
		Owners       []crypto.PublicKey
		OrderBy      string
		OrderDir     string
		Limit        *int
		Offset       *int
	}
}

FilterOptions

type Store

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

func New

func New(
	db *sql.DB,
) (*Store, error)

func (*Store) Close

func (st *Store) Close() error

func (*Store) Filter

func (st *Store) Filter(
	filterOptions ...FilterOption,
) (object.ReadCloser, error)

func (*Store) Get

func (st *Store) Get(
	cid object.CID,
) (*object.Object, error)

func (*Store) GetByStream added in v0.11.0

func (st *Store) GetByStream(
	streamRootCID object.CID,
) (object.ReadCloser, error)

func (*Store) GetByType added in v0.11.0

func (st *Store) GetByType(
	objectType string,
) (object.ReadCloser, error)

func (*Store) GetPinned added in v0.8.0

func (st *Store) GetPinned() ([]object.CID, error)

func (*Store) GetRelations

func (st *Store) GetRelations(
	parent object.CID,
) ([]object.CID, error)

func (*Store) GetStreamLeaves added in v0.14.0

func (st *Store) GetStreamLeaves(
	streamRootCID object.CID,
) ([]object.CID, error)

func (*Store) IsPinned added in v0.18.0

func (st *Store) IsPinned(cid object.CID) (bool, error)

func (*Store) Pin added in v0.18.0

func (st *Store) Pin(
	cid object.CID,
) error

func (*Store) Put

func (st *Store) Put(
	obj *object.Object,
) error

func (*Store) PutWithTTL added in v0.14.0

func (st *Store) PutWithTTL(
	obj *object.Object,
	ttl time.Duration,
) error

func (*Store) Remove

func (st *Store) Remove(
	cid object.CID,
) error

func (*Store) RemovePin added in v0.18.0

func (st *Store) RemovePin(
	cid object.CID,
) error

func (*Store) UpdateTTL

func (st *Store) UpdateTTL(
	cid object.CID,
	minutes int,
) error

Jump to

Keyboard shortcuts

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