events

package
v0.1.9-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	Header  *Header     `json:"header"`
	Message interface{} `json:"message"`
}

Envelope is the data structure that holds the information to be published by the Broker

func (*Envelope) AddHeader

func (e *Envelope) AddHeader(key, value string)

AddHeader adds a new header for a particular Envelope

func (*Envelope) Encode

func (e *Envelope) Encode() ([]byte, error)

Encode returns the encoded version of the Envelope. This is useful when sending non structure data on the wire

type Event

type Event interface {
	EventSource() EventSource
	EventType() EventType
}

Event is the contract for events handled by EventHandlers

type EventMessage

type EventMessage struct {
	Body interface{}
}

EventMessage is the data structure for messages that are resulting of reconcile events.

func (*EventMessage) Content

func (e *EventMessage) Content() interface{}

Content extracts the body of the EventMessage

type EventSource

type EventSource string
var (
	EventSourceOnAdd    EventSource = "OnAdd"
	EventSourceOnUpdate EventSource = "OnUpdate"
	EventSourceOnDelete EventSource = "OnDelete"
)

type EventType

type EventType string

func (EventType) String

func (t EventType) String() string

String returns the string representation of a EventType

type GameServerEvent

type GameServerEvent struct {
	Source EventSource
	Type   GameServerEventType
	Message
}

GameServerEvent is the data structure for reconcile events associated with Agones GameServers It holds the event source (OnAdd, OnUpdate, OnDelete) and the event type (Added, Updated, Deleted).

func GameServerAdded

func GameServerAdded(message Message) *GameServerEvent

GameServerAdded is the data structure for reconcile events of type Add

func GameServerDeleted

func GameServerDeleted(message Message) *GameServerEvent

GameServerDeleted is the data structure for reconcile events of type Delete

func GameServerUpdated

func GameServerUpdated(message Message) *GameServerEvent

GameServerUpdates is the data structure for reconcile events of type Update

func (*GameServerEvent) EventSource

func (t *GameServerEvent) EventSource() EventSource

EventSource return the event source that generated the event. For example: OnAdd, OnUpdate, OnDelete

func (*GameServerEvent) EventType

func (t *GameServerEvent) EventType() EventType

EventType returns the type of the reconcile event for a GameServer. For example: Added, Updated, Deleted

type GameServerEventType

type GameServerEventType string
var (
	GameServerEventAdded   GameServerEventType = "gameserver.events.added"
	GameServerEventUpdated GameServerEventType = "gameserver.events.updated"
	GameServerEventDeleted GameServerEventType = "gameserver.events.deleted"
)

func (GameServerEventType) String

func (t GameServerEventType) String() string

String is a helper method that returns the string version of a GameServerType

type Header struct {
	Headers map[string]string `json:"headers"`
}

Header is the data structure for headers used when building Envelopes. It is a flexible way of storing information to be used in any part of the publishing process

type Message

type Message interface {
	Content() interface{}
}

Message is the contract for messages published by Brokers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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