Documentation ¶
Index ¶
- Constants
- type LookupOption
- type LookupOptions
- type Option
- type Options
- type SqlStoreFilter
- type SqlStorePubSub
- type SqlStoreSubscription
- type Store
- func (st *Store) Close() error
- func (st *Store) Filter(lookupOptions ...LookupOption) ([]object.Object, error)
- func (st *Store) Get(hash object.Hash) (object.Object, error)
- func (st *Store) GetRelations(parent object.Hash) ([]object.Hash, error)
- func (st *Store) Put(obj object.Object, opts ...Option) error
- func (st *Store) Remove(hash object.Hash) error
- func (st *Store) Subscribe(lookupOptions ...LookupOption) SqlStoreSubscription
- func (st *Store) UpdateTTL(hash object.Hash, minutes int) error
Constants ¶
View Source
const ( // ErrNotFound is returned when a requested object or hash is not found ErrNotFound = errors.Error("not found") )
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 } // filters are the lookups equivalents for matching objects for pubsub Filters []SqlStoreFilter }
LookupOptions
type SqlStoreFilter ¶
type SqlStorePubSub ¶
type SqlStorePubSub interface { Publish(object.Object) Subscribe(...SqlStoreFilter) SqlStoreSubscription }
SqlStorePubSub -
func NewSqlStorePubSub ¶
func NewSqlStorePubSub() SqlStorePubSub
NewSqlStore constructs and returns a new SqlStorePubSub
type SqlStoreSubscription ¶
SqlStoreSubscription is returned for every subscription
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Filter ¶
func (st *Store) Filter( lookupOptions ...LookupOption, ) ([]object.Object, error)
func (*Store) GetRelations ¶
func (*Store) Subscribe ¶
func (st *Store) Subscribe( lookupOptions ...LookupOption, ) SqlStoreSubscription
Click to show internal directories.
Click to hide internal directories.