Documentation ¶
Overview ¶
Package subscribe manages subscriptions to all or specific go structs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SubscribeManager ¶
type SubscribeManager struct {
// contains filtered or unexported fields
}
SubscribeManager maintains lists of subscribers to specific or all structs.
func (*SubscribeManager) HandleStruct ¶ added in v0.0.2
func (s *SubscribeManager) HandleStruct(p any)
HandleStruct calls registered subscriber callbacks for a struct. It calls all specific subscribers and all subscribers.
func (*SubscribeManager) SubscribeToAllStructs ¶
func (s *SubscribeManager) SubscribeToAllStructs(callback any) (SubscriptionId, error)
SubscribeToAllStructs registers a subscription to all structs. It validates the callback is a func with an any argument.
func (*SubscribeManager) SubscribeToStruct ¶
func (s *SubscribeManager) SubscribeToStruct(t any, callback any) (SubscriptionId, error)
SubscribeToStruct registers a subscription to the specified struct. It validates the callback is a function with a matching argument type.
func (*SubscribeManager) Unsubscribe ¶
func (s *SubscribeManager) Unsubscribe(subId SubscriptionId) error
Unsubscribe cancels a subscription.
Click to show internal directories.
Click to hide internal directories.