Documentation ¶
Overview ¶
TODO: Supply clients' http.Request info
Index ¶
- Variables
- func ContentLength() int64
- func Echo(message string, args ...interface{})
- func Handle(handler map[string]interface{}, callEvents <-chan Context)
- func Out(data []byte) (n int, err error)
- func RemoteAddress() string
- func Run(handler func(args map[string]string), handlers ...interface{})
- func SetHeader(key string, value interface{}) error
- func SetHttpCode(statusCode int)
- func SetWriter(sessionId int64, writer ContentWriter)
- func SystemMessage(message string)
- func With(handlers ...interface{}) []interface{}
- type ContentWriter
- type Context
- func (context *Context) Call(functionName string, packet *EchoPacket, ack *bool) error
- func (context *Context) Lock()
- func (context *Context) SetContentType(mime string)
- func (context *Context) Unlock()
- func (context *Context) Write(buf []byte) (n int, err error)
- func (context *Context) WriteHeader(statusCode int) error
- type EchoPacket
- type Handler
- type HandlerSessions
- type Message
- type Mime
- type SessionId
- type SessionSignals
- type WriterSessions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TextHtml = Mime("text/html") TextCss = Mime("text/css") TextCsv = Mime("text/csv") Javascript = Mime("application/javascript") Multipart = Mime("multipart/form-data") MessagePartial = Mime("message/partial") ImagePng = Mime("image/png") ImageGif = Mime("image/gif") ImageJpeg = Mime("image/jpeg") ImageIcon = Mime("image/x-icon") ImageTiff = Mime("image/tiff") AudioMpeg = Mime("audio/mpeg") AudioOgg = Mime("audio/ogg") AudioWav = Mime("audio/wav") VideoMp4 = Mime("video/mp4") ArchiveRar = Mime("application/x-rar-compressed") ArchiveTar = Mime("application/x-tar") ArchiveZip = Mime("application/zip") Archive7z = Mime("application/x-7z-compressed") ArchiveBzip = Mime("application/x-bzip") ArchiveBzip2 = Mime("application/x-bzip2") FormatJson = Mime("application/json") FormatXml = Mime("application/xml") FormatBinary = Mime("application/octet-stream") FormatPdf = Mime("application/pdf") FormatShell = Mime("application/x-sh") FontTtf = Mime("font/ttf") FontWoff = Mime("font/woff") FontWoff2 = Mime("font/woff2") )
Functions ¶
func ContentLength ¶
func ContentLength() int64
func RemoteAddress ¶
func RemoteAddress() string
func SetHttpCode ¶
func SetHttpCode(statusCode int)
func SetWriter ¶
func SetWriter(sessionId int64, writer ContentWriter)
func SystemMessage ¶
func SystemMessage(message string)
Types ¶
type ContentWriter ¶
type Context ¶
type Context struct { Name string SessionId [32]byte Method string StatusCode *int Message Arguments map[string]string Rpc func(string, interface{}, interface{}) error *sync.Mutex }
func (*Context) Call ¶
func (context *Context) Call(functionName string, packet *EchoPacket, ack *bool) error
func (*Context) SetContentType ¶
func (*Context) WriteHeader ¶
type EchoPacket ¶
type HandlerSessions ¶
func (HandlerSessions) Get ¶
func (handlerSession HandlerSessions) Get(sessionId SessionId) (handler Handler, ok bool)
func (HandlerSessions) Set ¶
func (handlerSession HandlerSessions) Set(sessionId SessionId, handler Handler)
type SessionSignals ¶
type SessionSignals map[SessionId]chan chan func()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.