Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broadcaster ¶
type Broadcaster struct {
// contains filtered or unexported fields
}
Only a pointer to the struct should be used
func NewBroadcaster ¶
func NewBroadcaster(c chan SocketData) *Broadcaster
Creates broadcaster from channel parameter and immediately starts broadcasting Without any subscribers, received data will be discarded Broadcaster should be the only channel reader
func (*Broadcaster) Expired ¶
func (b *Broadcaster) Expired() bool
func (*Broadcaster) PoolSize ¶
func (b *Broadcaster) PoolSize() (size int)
Iterates over sync.Map and returns number of elements Response can be oversized if counted subscriptions are cancelled while counting
func (*Broadcaster) Subscribe ¶
func (b *Broadcaster) Subscribe() (*Subscriber, error)
Subscriber expected to constantly consume or unsubscribe
func (*Broadcaster) Unsubscribe ¶
func (b *Broadcaster) Unsubscribe(sub *Subscriber) error
type MessageType ¶ added in v0.7.0
type MessageType string
const ( Log MessageType = "Log" NamespaceCreated MessageType = "NamespaceCreated" NamespaceUpdated MessageType = "NamespaceUpdated" NamespaceDeleted MessageType = "NamespaceDeleted" PipelineCreated MessageType = "PipelineCreated" PipelineDeleted MessageType = "PipelineDeleted" PipelineUpdated MessageType = "PipelineUpdated" ClusterTaskCreated MessageType = "ClusterTaskCreated" ClusterTaskDeleted MessageType = "ClusterTaskDeleted" ClusterTaskUpdated MessageType = "ClusterTaskUpdated" TaskCreated MessageType = "TaskCreated" TaskDeleted MessageType = "TaskDeleted" TaskUpdated MessageType = "TaskUpdated" PipelineResourceCreated MessageType = "PipelineResourceCreated" PipelineResourceDeleted MessageType = "PipelineResourceDeleted" PipelineResourceUpdated MessageType = "PipelineResourceUpdated" PipelineRunCreated MessageType = "PipelineRunCreated" PipelineRunDeleted MessageType = "PipelineRunDeleted" PipelineRunUpdated MessageType = "PipelineRunUpdated" TaskRunCreated MessageType = "TaskRunCreated" TaskRunDeleted MessageType = "TaskRunDeleted" TaskRunUpdated MessageType = "TaskRunUpdated" ConditionCreated MessageType = "ConditionCreated" ConditionDeleted MessageType = "ConditionDeleted" ConditionUpdated MessageType = "ConditionUpdated" ResourceExtensionCreated MessageType = "ResourceExtensionCreated" ResourceExtensionUpdated MessageType = "ResourceExtensionUpdated" ResourceExtensionDeleted MessageType = "ResourceExtensionDeleted" ServiceExtensionCreated MessageType = "ServiceExtensionCreated" ServiceExtensionUpdated MessageType = "ServiceExtensionUpdated" ServiceExtensionDeleted MessageType = "ServiceExtensionDeleted" SecretCreated MessageType = "SecretCreated" SecretDeleted MessageType = "SecretDeleted" SecretUpdated MessageType = "SecretUpdated" ServiceAccountCreated MessageType = "ServiceAccountCreated" ServiceAccountDeleted MessageType = "ServiceAccountDeleted" ServiceAccountUpdated MessageType = "ServiceAccountUpdated" TriggerBindingCreated MessageType = "TriggerBindingCreated" TriggerBindingDeleted MessageType = "TriggerBindingDeleted" TriggerBindingUpdated MessageType = "TriggerBindingUpdated" ClusterTriggerBindingCreated MessageType = "ClusterTriggerBindingCreated" ClusterTriggerBindingDeleted MessageType = "ClusterTriggerBindingDeleted" ClusterTriggerBindingUpdated MessageType = "ClusterTriggerBindingUpdated" TriggerTemplateCreated MessageType = "TriggerTemplateCreated" TriggerTemplateDeleted MessageType = "TriggerTemplateDeleted" TriggerTemplateUpdated MessageType = "TriggerTemplateUpdated" EventListenerCreated MessageType = "EventListenerCreated" EventListenerDeleted MessageType = "EventListenerDeleted" EventListenerUpdated MessageType = "EventListenerUpdated" )
Reference outside of package
type SocketData ¶
type SocketData struct { MessageType MessageType Payload interface{} }
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
Wrapper return type for subscriptions
func (*Subscriber) SubChan ¶
func (s *Subscriber) SubChan() <-chan SocketData
Read-Only access to the subscription channel Open or nil, never closed
func (*Subscriber) UnsubChan ¶
func (s *Subscriber) UnsubChan() <-chan struct{}
Closed on unsubscribe or when broadcast parent channel closes
Click to show internal directories.
Click to hide internal directories.