Documentation ¶
Overview ¶
Package pool is
Index ¶
- Constants
- func PointerHasher(_ maphash.Seed, k string) uint64
- type IncomingEvent
- type Option
- type Simple
- func (p *Simple) EnsureRelay(url string) (rl *client.T, err error)
- func (p *Simple) QuerySingle(c context.T, urls []string, f *filter.T, unique bool) *IncomingEvent
- func (p *Simple) SubMany(c context.T, urls []string, f filters.T, unique bool) chan IncomingEvent
- func (p *Simple) SubManyEose(c context.T, urls []string, f filters.T, unique bool) chan IncomingEvent
- func (p *Simple) SubManyEoseNonUnique(c context.T, urls []string, f filters.T, unique bool) chan IncomingEvent
- func (p *Simple) SubManyNonUnique(c context.T, urls []string, filters filters.T, unique bool) chan IncomingEvent
- type WithAuthHandler
Constants ¶
const MAX_LOCKS = MaxLocks
Deprecated: uses snake case - use MaxLocks instead
const MaxLocks = 50
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Simple ¶
type Simple struct { Relays *xsync.MapOf[string, *client.T] Context context.T // contains filtered or unexported fields }
func (*Simple) QuerySingle ¶
QuerySingle returns the first event returned by the first relay, cancels everything else.
func (*Simple) SubMany ¶
SubMany opens a subscription with the given filters to multiple relays the subscriptions only end when the context is canceled
func (*Simple) SubManyEose ¶
func (p *Simple) SubManyEose(c context.T, urls []string, f filters.T, unique bool) chan IncomingEvent
SubManyEose is like SubMany, but it stops subscriptions and closes the channel when gets a EOSE
func (*Simple) SubManyEoseNonUnique ¶
func (p *Simple) SubManyEoseNonUnique(c context.T, urls []string, f filters.T, unique bool) chan IncomingEvent
SubManyEoseNonUnique is like SubManyEose, but returns duplicate events if they come from different relays
func (*Simple) SubManyNonUnique ¶
func (p *Simple) SubManyNonUnique(c context.T, urls []string, filters filters.T, unique bool) chan IncomingEvent
SubManyNonUnique is like SubMany, but returns duplicate events if they come from different relays
type WithAuthHandler ¶
WithAuthHandler must be a function that signs the auth event when called. it will be called whenever any relay in the pool returns a `CLOSED` message with the "auth-required:" prefix, only once for each relay
func (WithAuthHandler) Apply ¶
func (h WithAuthHandler) Apply(pool *Simple)
func (WithAuthHandler) IsPoolOption ¶
func (_ WithAuthHandler) IsPoolOption()