Documentation ¶
Index ¶
- Constants
- type LookupOption
- type LookupOptions
- type ObjectFilter
- type ObjectManager
- type ObjectPubSub
- type ObjectSubscription
- type Option
- type SubscriptionsMap
- func (m *SubscriptionsMap) Delete(k tilde.Digest)
- func (m *SubscriptionsMap) Get(k tilde.Digest) (*stream.Subscription, bool)
- func (m *SubscriptionsMap) GetOrPut(k tilde.Digest, v *stream.Subscription) (*stream.Subscription, bool)
- func (m *SubscriptionsMap) ListKeys() []tilde.Digest
- func (m *SubscriptionsMap) ListValues() []*stream.Subscription
- func (m *SubscriptionsMap) Put(k tilde.Digest, v *stream.Subscription)
- func (m *SubscriptionsMap) Range(i func(k tilde.Digest, v *stream.Subscription) bool)
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LookupOption ¶
type LookupOption func(*LookupOptions)
LookupOptions
func FilterByHash ¶
func FilterByHash(hs ...tilde.Digest) LookupOption
func FilterByObjectType ¶
func FilterByObjectType(typePatterns ...string) LookupOption
func FilterByOwner ¶
func FilterByOwner(hs ...did.DID) LookupOption
func FilterByStreamHash ¶
func FilterByStreamHash(hs ...tilde.Digest) 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 []tilde.Digest StreamHashes []tilde.Digest ContentTypes []string Owners []did.DID } // filters are the lookups equivalents for matching objects for pubsub Filters []ObjectFilter }
LookupOptions
type ObjectFilter ¶
type ObjectManager ¶
type ObjectManager interface { Put( ctx context.Context, o *object.Object, ) error Append( ctx context.Context, o *object.Object, ) (*object.Object, error) Request( ctx context.Context, hash tilde.Digest, peer *peer.ConnectionInfo, ) (*object.Object, error) RequestStream( ctx context.Context, rootHash tilde.Digest, recipients ...*peer.ConnectionInfo, ) (object.ReadCloser, error) AddStreamSubscription( ctx context.Context, rootHash tilde.Digest, ) error Subscribe( lookupOptions ...LookupOption, ) ObjectSubscription }
type ObjectPubSub ¶
type ObjectPubSub interface { Publish(*object.Object) Subscribe(...ObjectFilter) ObjectSubscription }
ObjectPubSub -
func NewObjectPubSub ¶
func NewObjectPubSub() ObjectPubSub
NewObject constructs and returns a new Object
type ObjectSubscription ¶
type ObjectSubscription interface { object.ReadCloser Channel() <-chan *object.Object }
ObjectSubscription is returned for every subscription
type SubscriptionsMap ¶
type SubscriptionsMap struct {
// contains filtered or unexported fields
}
SubscriptionsMap -
func NewSubscriptionsMap ¶
func NewSubscriptionsMap() *SubscriptionsMap
NewSubscriptionsMap constructs a new SyncMap
func (*SubscriptionsMap) Get ¶
func (m *SubscriptionsMap) Get(k tilde.Digest) (*stream.Subscription, bool)
Get -
func (*SubscriptionsMap) GetOrPut ¶
func (m *SubscriptionsMap) GetOrPut(k tilde.Digest, v *stream.Subscription) (*stream.Subscription, bool)
GetOrPut -
func (*SubscriptionsMap) ListValues ¶
func (m *SubscriptionsMap) ListValues() []*stream.Subscription
ListValues -
func (*SubscriptionsMap) Put ¶
func (m *SubscriptionsMap) Put(k tilde.Digest, v *stream.Subscription)
Put -
func (*SubscriptionsMap) Range ¶
func (m *SubscriptionsMap) Range(i func(k tilde.Digest, v *stream.Subscription) bool)
Range -
Click to show internal directories.
Click to hide internal directories.