util

package
v0.0.0-...-ef8be34 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Utilities.

Index

Constants

This section is empty.

Variables

View Source
var Net = mynet{}

Network utilities.

View Source
var OS = myos{}

OS utilities.

Functions

func Recover

func Recover()

Recover recovers a panic.

func RetJSON

func RetJSON(w http.ResponseWriter, r *http.Request, res map[string]interface{})

RetJSON writes HTTP response with "Content-Type, application/json".

Types

type WSChannel

type WSChannel struct {
	Sid     string          // wide session id
	Conn    *websocket.Conn // websocket connection
	Request *http.Request   // HTTP request related
	Time    time.Time       // the latest use time
}

WebSocket channel.

func (*WSChannel) Close

func (c *WSChannel) Close()

Close closed the channel.

func (*WSChannel) Refresh

func (c *WSChannel) Refresh()

Refresh refreshes the channel by updating its use time.

Jump to

Keyboard shortcuts

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