event

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2013 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Events = make(chan interface{}, 1000)

All events from all connections go here

Functions

func PostConnect

func PostConnect(cid ConnId, from string)

func PostData

func PostData(cid ConnId, kind EventKind, stamp time.Time, payload []byte)

func PostDisconnect

func PostDisconnect(cid ConnId, dir EventKind)

dir specifies which partner of the connection initiated the close.

func PostGlobal

func PostGlobal(desc string)

func PostGlobalf

func PostGlobalf(s string, a ...interface{})

func PostHttp

func PostHttp(cid ConnId, kind EventKind, stamp time.Time, payload []byte, start []byte, headers textproto.MIMEHeader, body []byte)

Types

type ConnId

type ConnId int

type ConnectEvent

type ConnectEvent struct {
	Event
	From string
}

type DataEvent

type DataEvent struct {
	Event
	Payload []byte
}

Event where interesting data is sent

type DisconnectEvent

type DisconnectEvent struct {
	Event
	Initiator EventKind
}

type Event

type Event struct {
	Cid   ConnId
	Kind  EventKind
	Stamp time.Time
}

A generic event on a specific connection.

type EventKind

type EventKind byte
const (
	Connect EventKind = iota
	Disconnect
	Send
	Receive
	Global
)

func (EventKind) String

func (k EventKind) String() string

type HttpEvent

type HttpEvent struct {
	DataEvent
	Start   []byte
	Headers textproto.MIMEHeader
	Body    []byte
}

HTTP protocol event

type MessageEvent

type MessageEvent struct {
	Event
	Message string
}

Jump to

Keyboard shortcuts

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