sio

package
v0.0.0-...-4ea3bf1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagJson     = 1 << 0
	FlagVolatile = 1 << 1
	FlagLocal    = 1 << 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

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

func NewAdapter

func NewAdapter(namespace *Namespace) *Adapter

func (*Adapter) Add

func (a *Adapter) Add(id string, rooms ...string)

func (*Adapter) Del

func (a *Adapter) Del(id string, room string)

func (*Adapter) DelAll

func (a *Adapter) DelAll(id string)

func (*Adapter) GetClientsIn

func (a *Adapter) GetClientsIn(rooms ...string) []*Socket

func (*Adapter) GetRoomsOf

func (a *Adapter) GetRoomsOf(id string) []string

type Client

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

func NewClient

func NewClient(server *Server, conn *eio.Socket) *Client

func (*Client) Connect

func (c *Client) Connect(name string, query string)

type EmitData

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

type F

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

type IAdapter

type IAdapter interface {
	Add(id string, rooms ...string)
	Del(id string, room string)
	DelAll(id string)

	GetClientsIn(rooms ...string) []*Socket
	GetRoomsOf(id string) []string
}

type Namespace

type Namespace struct {
	OnConnect NamespaceMiddleware
	// contains filtered or unexported fields
}

func NewNamespace

func NewNamespace(server *Server, name string) *Namespace

func (*Namespace) Add

func (n *Namespace) Add(client *Client, query string) *Socket

type NamespaceMiddleware

type NamespaceMiddleware func(socket *Socket, next NamespaceMiddleware) NamespaceMiddleware

type Server

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

func NewServer

func NewServer() (*Server, error)

func (*Server) HandleConnection

func (s *Server) HandleConnection(socket *eio.Socket)

func (*Server) Of

func (s *Server) Of(name string) *Namespace

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ServerOptions

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

type Socket

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

func NewSocket

func NewSocket(namespace *Namespace, client *Client, query string) *Socket

func (*Socket) Join

func (s *Socket) Join(rooms ...string)

func (*Socket) Leave

func (s *Socket) Leave(room string)

func (*Socket) LeaveAll

func (s *Socket) LeaveAll()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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