broadcaster

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

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"
	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"
)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL