server

package
v0.0.0-...-3af23c0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start()

Start the Server service

Types

type Connection

type Connection interface {
	Send(msg Message)
	Receive() (string, error)
	Close()
}

type Message

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

Message from users

type TCPConnection

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

func (*TCPConnection) Close

func (c *TCPConnection) Close()

func (*TCPConnection) Receive

func (c *TCPConnection) Receive() (string, error)

func (*TCPConnection) Send

func (c *TCPConnection) Send(msg Message)

type User

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

User that enters to the server

func (*User) Handle

func (u *User) Handle(conn Connection)

Handle a connection

func (*User) SendMessage

func (u *User) SendMessage(message Message)

SendMessage to the user

func (*User) SetOutgoingChannel

func (u *User) SetOutgoingChannel(channel chan Message)

SetOutgoingChannel to use

type WSConnection

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

func (*WSConnection) Close

func (c *WSConnection) Close()

func (*WSConnection) Receive

func (c *WSConnection) Receive() (string, error)

func (*WSConnection) Send

func (c *WSConnection) Send(msg Message)

type WSIncomingMessage

type WSIncomingMessage struct {
	Body string `json:"body"`
}

type WSOutgoingMessage

type WSOutgoingMessage struct {
	User string `json:"user"`
	Body string `json:"body"`
}

Jump to

Keyboard shortcuts

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