chat

package
Version: v0.0.0-...-9720efe Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents client(browser) connected via websocket

func NewClient

func NewClient(ws *websocket.Conn, hub *Hub) *Client

NewClient creates new Client instance

func (*Client) Process

func (c *Client) Process()

Process ...

type Cmd

type Cmd struct {
	ConnId     string
	CmdId      int
	Database   string
	Query      string
	Parameters []string
	Executable bool
}

Cmd represents MySQL command to be executed.

type CmdResult

type CmdResult struct {
	ConnId   string
	CmdId    int
	Result   byte
	Error    string
	Duration string
}

CmdResult represents MySQL command execution result.

type ConnState

type ConnState struct {
	ConnId string
	State  byte
}

ConnState represents tcp connection state.

type Hub

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

Hub ...

func NewHub

func NewHub(
	cmdChan chan Cmd,
	cmdResultChan chan CmdResult,
	connStateChan chan ConnState,
) *Hub

NewHub ...

func (*Hub) RegisterClient

func (h *Hub) RegisterClient(client *Client)

RegisterClient...

func (*Hub) Run

func (h *Hub) Run()

Run ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL