sqlobjectstore

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LookupOption

type LookupOption func(*LookupOptions)

LookupOptions

func FilterByHash

func FilterByHash(h object.Hash) LookupOption

func FilterByObjectType

func FilterByObjectType(typePatterns ...string) LookupOption

func FilterByOwner

func FilterByOwner(h crypto.PublicKey) LookupOption

func FilterByStreamHash

func FilterByStreamHash(h object.Hash) LookupOption

type LookupOptions

type LookupOptions struct {
	// Lookups are used to perform db queries for these filters
	// TODO find a better name for this
	Lookups struct {
		ObjectHashes []object.Hash
		StreamHashes []object.Hash
		ContentTypes []string
		Owners       []crypto.PublicKey
	}
}

LookupOptions

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(
	lookupOptions ...LookupOption,
) (object.ReadCloser, error)

func (*Store) Get

func (st *Store) Get(
	hash object.Hash,
) (object.Object, error)

func (*Store) GetByStream added in v0.11.0

func (st *Store) GetByStream(
	streamRootHash object.Hash,
) (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.Hash, error)

func (*Store) GetRelations

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

func (*Store) Put

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

func (*Store) PutWithTimeout added in v0.11.0

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

func (*Store) Remove

func (st *Store) Remove(
	hash object.Hash,
) error

func (*Store) UpdateTTL

func (st *Store) UpdateTTL(
	hash object.Hash,
	minutes int,
) error

Jump to

Keyboard shortcuts

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