Documentation ¶
Index ¶
- Constants
- type LookupOption
- type LookupOptions
- type ObjectFilter
- type ObjectManager
- type ObjectPubSub
- type ObjectSubscription
- type Option
- type SubscriptionsMap
- func (m *SubscriptionsMap) Delete(k object.CID)
- func (m *SubscriptionsMap) Get(k object.CID) (*stream.Subscription, bool)
- func (m *SubscriptionsMap) GetOrPut(k object.CID, v *stream.Subscription) (*stream.Subscription, bool)
- func (m *SubscriptionsMap) ListKeys() []object.CID
- func (m *SubscriptionsMap) ListValues() []*stream.Subscription
- func (m *SubscriptionsMap) Put(k object.CID, v *stream.Subscription)
- func (m *SubscriptionsMap) Range(i func(k object.CID, v *stream.Subscription) bool)
Constants ¶
View Source
const ( ErrDone = errors.Error("done") ErrTimeout = errors.Error("request timed out") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LookupOption ¶
type LookupOption func(*LookupOptions)
LookupOptions
func FilterByCID ¶ added in v0.17.0
func FilterByCID(hs ...object.CID) LookupOption
func FilterByObjectType ¶
func FilterByObjectType(typePatterns ...string) LookupOption
func FilterByOwner ¶
func FilterByOwner(hs ...crypto.PublicKey) LookupOption
func FilterByStreamCID ¶ added in v0.17.0
func FilterByStreamCID(hs ...object.CID) 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 { ObjectCIDs []object.CID StreamCIDs []object.CID 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, cid object.CID, peer *peer.ConnectionInfo, ) (*object.Object, error) RequestStream( ctx context.Context, rootCID object.CID, recipients ...*peer.ConnectionInfo, ) (object.ReadCloser, error) AddStreamSubscription( ctx context.Context, rootCID object.CID, ) 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 object.CID) (*stream.Subscription, bool)
Get -
func (*SubscriptionsMap) GetOrPut ¶
func (m *SubscriptionsMap) GetOrPut(k object.CID, 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.CID, v *stream.Subscription)
Put -
func (*SubscriptionsMap) Range ¶
func (m *SubscriptionsMap) Range(i func(k object.CID, v *stream.Subscription) bool)
Range -
Click to show internal directories.
Click to hide internal directories.