Documentation ¶
Index ¶
- type Broadcaster
- func (b *Broadcaster) Build() error
- func (b *Broadcaster) OnAdd(obj interface{}) error
- func (b *Broadcaster) OnDelete(obj interface{}) error
- func (b *Broadcaster) OnUpdate(oldObj interface{}, newObj interface{}) error
- func (b *Broadcaster) Publish(event events.Event) error
- func (b *Broadcaster) Start(ctx context.Context) error
- func (b *Broadcaster) WithWatcherFor(obj client.Object) *Broadcaster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Broadcaster ¶
type Broadcaster struct { brokers.Broker Manager *manager.Manager // contains filtered or unexported fields }
Broadcaster receives events (Add, Update and Delete) sent by the controller and uses a Broker to publish those events.
func New ¶
func New(config *rest.Config, broker brokers.Broker, syncPeriod time.Duration, serverPort int, metricsBindAddress string) *Broadcaster
New returns a new GameServer broadcaster It required a config to be passed to the GameServer controller and a broker that will be publishing messages
func (*Broadcaster) Build ¶
func (b *Broadcaster) Build() error
Build will check for required broadcaster components e return error if the requirements are not satisfied
func (*Broadcaster) OnAdd ¶
func (b *Broadcaster) OnAdd(obj interface{}) error
OnAdd is the event handler that reacts to Add events
func (*Broadcaster) OnDelete ¶
func (b *Broadcaster) OnDelete(obj interface{}) error
OnDelete is the event handler that reacts to Delete events
func (*Broadcaster) OnUpdate ¶
func (b *Broadcaster) OnUpdate(oldObj interface{}, newObj interface{}) error
OnUpdate is the event handler that reacts to Update events
func (*Broadcaster) Publish ¶
func (b *Broadcaster) Publish(event events.Event) error
Publish will publish the event wrapped on a envelope using the broker available
func (*Broadcaster) Start ¶
func (b *Broadcaster) Start(ctx context.Context) error
Start run the controller that sends events back to the broadcaster event handlers
func (*Broadcaster) WithWatcherFor ¶
func (b *Broadcaster) WithWatcherFor(obj client.Object) *Broadcaster
WithWatcherFor adds a controller for the specified obj. The controller reports back to the broadcaster events of type OnAdd, OnUpdate and OnDelete associated to that particular resource type. Examples of obj arguments are: &v1.GameServer and &v1.Fleet