Documentation ¶
Index ¶
- Variables
- type LookupOption
- type LookupOptions
- type ObjectFilter
- type ObjectManager
- type ObjectPubSub
- type ObjectSubscription
- type Option
- type SubscriptionsMap
- func (m *SubscriptionsMap) Delete(k object.Hash)
- func (m *SubscriptionsMap) Get(k object.Hash) (*stream.Subscription, bool)
- func (m *SubscriptionsMap) GetOrPut(k object.Hash, v *stream.Subscription) (*stream.Subscription, bool)
- func (m *SubscriptionsMap) ListKeys() []object.Hash
- func (m *SubscriptionsMap) ListValues() []*stream.Subscription
- func (m *SubscriptionsMap) Put(k object.Hash, v *stream.Subscription)
- func (m *SubscriptionsMap) Range(i func(k object.Hash, v *stream.Subscription) bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDone = errors.New("done") ErrTimeout = errors.New("request timed out") )
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 []ObjectFilter }
LookupOptions
type ObjectFilter ¶
type ObjectManager ¶
type ObjectManager interface { Put( ctx context.Context, o *object.Object, ) (*object.Object, error) Request( ctx context.Context, hash object.Hash, peer *peer.ConnectionInfo, excludeNested bool, ) (*object.Object, error) RequestStream( ctx context.Context, rootHash object.Hash, recipients ...*peer.ConnectionInfo, ) (object.ReadCloser, 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 ¶
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 object.Hash) (*stream.Subscription, bool)
Get -
func (*SubscriptionsMap) GetOrPut ¶
func (m *SubscriptionsMap) GetOrPut(k object.Hash, 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 object.Hash, v *stream.Subscription)
Put -
func (*SubscriptionsMap) Range ¶
func (m *SubscriptionsMap) Range(i func(k object.Hash, v *stream.Subscription) bool)
Range -
Click to show internal directories.
Click to hide internal directories.