socket

package module
v0.0.0-...-e17d56d Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2014 License: MIT Imports: 5 Imported by: 0

README

socket.io.go

Documentation

Overview

Copyright 2013 Clustertech Limited. All rights reserved.

Author: jackeychen (jackeychen@clustertech.com)

Copyright 2013 Clustertech Limited. All rights reserved.

Author: jackeychen (jackeychen@clustertech.com)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func (*Conn) Broadcast

func (conn *Conn) Broadcast(e string, msg interface{})

func (*Conn) Get

func (conn *Conn) Get(key string) interface{}

func (*Conn) ID

func (conn *Conn) ID() string

func (*Conn) Process

func (conn *Conn) Process()

func (*Conn) Release

func (conn *Conn) Release()

func (*Conn) Save

func (conn *Conn) Save(key string, data interface{})

func (*Conn) Send

func (conn *Conn) Send(e string, msg interface{})

type Event

type Event struct {
	Name string
	Msg  string
	Conn *Conn
}

type Hub

type Hub struct {
	OnRelease func(conn *Conn)
	// contains filtered or unexported fields
}

func NewHub

func NewHub(upgrader *websocket.Upgrader) *Hub

func (*Hub) Get

func (hub *Hub) Get(id string) *Conn

func (*Hub) On

func (hub *Hub) On(e string, f func(e *Event))

func (*Hub) Release

func (hub *Hub) Release(conn *Conn)

func (*Hub) Upgrade

func (hub *Hub) Upgrade(w http.ResponseWriter, r *http.Request) (*Conn, error)

Jump to

Keyboard shortcuts

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