Documentation
¶
Index ¶
Constants ¶
View Source
const (
UuidKey = "uuid"
)
Variables ¶
View Source
var ( HostRegex = regexp.MustCompile(`^(?:[\w-]+\.)+\w+$`) IpAddressRegex = regexp.MustCompile(`^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$`) UriRegex = regexp.MustCompile(`^/?(?:[\w-]+/)*[\w-]+/?(?:\?(?:[\w-]+=[\w-]+)(?:&[\w-]+=[\w-]+)*)?$`) HttpMethodRegex = regexp.MustCompile(fmt.Sprintf(`^(%s)$`, strings.Join([]string{ http.MethodGet, http.MethodHead, http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete, http.MethodConnect, http.MethodOptions, http.MethodTrace, }, "|"))) )
Functions ¶
This section is empty.
Types ¶
type Broadcaster ¶
type Broadcaster[T any] struct { // contains filtered or unexported fields }
func (*Broadcaster[T]) Publish ¶
func (b *Broadcaster[T]) Publish(event T, uuid string)
func (*Broadcaster[T]) PublishAsync ¶
func (b *Broadcaster[T]) PublishAsync(event T, uuid string) *sync.WaitGroup
func (*Broadcaster[T]) Subscribe ¶
func (b *Broadcaster[T]) Subscribe(subscriberId string, acceptFn func(event T) bool) <-chan T
func (*Broadcaster[T]) Unsubscribe ¶
func (b *Broadcaster[T]) Unsubscribe(subscriberId string)
Click to show internal directories.
Click to hide internal directories.