UDPush

package
v0.0.0-...-8003347 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2015 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationEngine

type NotificationEngine interface {
	Initialize(id string)
	Attach(Watcher) error
	Detach(Watcher) bool
	Notify()
}

NotificationEngine interface for the notification system Defines the requirements to create a gobox

type Pusher

type Pusher struct {
	ServerID string
	BindedTo uint
	Watchers map[string]Watcher
	Pending  bool
}

Pusher struct that satisfies the NotificationEngine interface

func (*Pusher) Attach

func (e *Pusher) Attach(w Watcher) (err error)

Attach Add a new Watcher to the notification slice

func (*Pusher) Detach

func (e *Pusher) Detach(w Watcher) (err error)

Detach Remove a watcher from the notification slice

func (*Pusher) InitUDPush

func (e *Pusher) InitUDPush() error

InitUDPush 'constructs' the UDP notification engine The e on the reciever stands for event

func (*Pusher) Initialize

func (e *Pusher) Initialize(id string)

Initialize is a 'constructor' for the pusher struct

func (*Pusher) Notify

func (e *Pusher) Notify(sessionkey string)

Notify Tell the watcher {clientID} to update

func (*Pusher) ShowWatchers

func (e *Pusher) ShowWatchers()

ShowWatchers Print current watchers in pusher

type Watcher

type Watcher struct {
	OwnerID    int
	ClientID   int
	SessionKey string
	Action     bool
	Connection net.Conn
}

Watcher Struct that satisfies the WatcherEngine This type requires an auth mecanism in order to work in a safe way

func (*Watcher) Update

func (w *Watcher) Update()

Update Get update from pusher... Golint forces me to do this http://tinyurl.com/lhzjvmm

type WatcherEngine

type WatcherEngine interface {
	Update()
}

WatcherEngine Interface for watcher (Observer) system Defines the requirements to create a gobox notification watcher.

Jump to

Keyboard shortcuts

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