nwss

package
v0.0.0-...-c1749d8 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NameDPNWSS depthprice
	NameDPNWSS = "depthprice"
	// NameCSNWSS candlesticks
	NameCSNWSS = "candlesticks"
	// NameHTNWSS historytrade
	NameHTNWSS = "historytrade"
	// NameTKNWSS ticker24h
	NameTKNWSS = "ticker24h"
	// NameCRNWSS cerberus
	NameCRNWSS = "cerberus"
	// NameSTNWSS stream
	NameSTNWSS = "stream"
)

Variables

View Source
var MapSymbol = make(map[string]string)

MapSymbol Const

View Source
var TypeTime = map[string]string{
	"1m":  "1m",
	"5m":  "5m",
	"15m": "15m",
	"30m": "30m",
	"1h":  "1h",
	"2h":  "2h",
	"4h":  "4h",
	"6h":  "6h",
	"12h": "12h",
	"1d":  "1d",
	"1w":  "1w",
}

TypeTime type time

Functions

func FDWebsocket

func FDWebsocket(conn net.Conn) int

FDWebsocket get ID from net.Conn

func InitMapSymbol

func InitMapSymbol()

InitMapSymbol init map symbol

func ReloadMapSymbol

func ReloadMapSymbol(listpair string)

ReloadMapSymbol update map symbol

Types

type CRNWSServer

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

CRNWSServer struct

func GetInstanceCR

func GetInstanceCR(name string) *CRNWSServer

GetInstanceCR get instance CR

func NewCRNWSServer

func NewCRNWSServer(name string) *CRNWSServer

NewCRNWSServer new CRNWSServer

func (*CRNWSServer) BroadcastMsgByte

func (nwss *CRNWSServer) BroadcastMsgByte(message []byte)

BroadcastMsgByte broadcast msg byte

func (*CRNWSServer) GetNEpoll

func (nwss *CRNWSServer) GetNEpoll() *NEpoll

GetNEpoll get NEpoll

func (*CRNWSServer) GetName

func (nwss *CRNWSServer) GetName() string

GetName get name

func (*CRNWSServer) Start

func (nwss *CRNWSServer) Start()

Start websocket server

type CSNWSServer

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

CSNWSServer struct

func GetInstanceCS

func GetInstanceCS(name string) *CSNWSServer

GetInstanceCS get instance CS

func NewCSNWSServer

func NewCSNWSServer(name string) *CSNWSServer

NewCSNWSServer new CSNWSServer

func (*CSNWSServer) BroadcastMsgByte

func (nwss *CSNWSServer) BroadcastMsgByte(message []byte)

BroadcastMsgByte broadcast msg byte

func (*CSNWSServer) GetNEpoll

func (nwss *CSNWSServer) GetNEpoll() *NEpoll

GetNEpoll get NEpoll

func (*CSNWSServer) GetName

func (nwss *CSNWSServer) GetName() string

GetName get name

func (*CSNWSServer) Start

func (nwss *CSNWSServer) Start()

Start websocket server

type DPNWSServer

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

DPNWSServer struct

func GetInstanceDP

func GetInstanceDP(name string) *DPNWSServer

GetInstanceDP get instance DP

func NewDPNWSServer

func NewDPNWSServer(name string) *DPNWSServer

NewDPNWSServer new DPNWSServer

func (*DPNWSServer) BroadcastMsgByte

func (nwss *DPNWSServer) BroadcastMsgByte(message []byte)

BroadcastMsgByte broadcast msg byte

func (*DPNWSServer) GetNEpoll

func (nwss *DPNWSServer) GetNEpoll() *NEpoll

GetNEpoll get NEpoll

func (*DPNWSServer) GetName

func (nwss *DPNWSServer) GetName() string

GetName get name

func (*DPNWSServer) Start

func (nwss *DPNWSServer) Start()

Start websocket server

type HTNWSServer

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

HTNWSServer struct

func GetInstanceHT

func GetInstanceHT(name string) *HTNWSServer

GetInstanceHT get instance HT

func NewHTNWSServer

func NewHTNWSServer(name string) *HTNWSServer

NewHTNWSServer new HTNWSServer

func (*HTNWSServer) BroadcastMsgByte

func (nwss *HTNWSServer) BroadcastMsgByte(message []byte)

BroadcastMsgByte broadcast msg byte

func (*HTNWSServer) GetNEpoll

func (nwss *HTNWSServer) GetNEpoll() *NEpoll

GetNEpoll get NEpoll

func (*HTNWSServer) GetName

func (nwss *HTNWSServer) GetName() string

GetName get name

func (*HTNWSServer) Start

func (nwss *HTNWSServer) Start()

Start websocket server

type NEpoll

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

NEpoll struct

func MkNEpoll

func MkNEpoll() (*NEpoll, error)

MkNEpoll new NEpoll. Returns *NEpoll and any write error encountered.

func (*NEpoll) Add

func (e *NEpoll) Add(conn net.Conn) (int, error)

Add add connection to epoll

func (*NEpoll) GetConn

func (e *NEpoll) GetConn(fd int) net.Conn

GetConn get conn from NEpoll

func (*NEpoll) GetTotalConn

func (e *NEpoll) GetTotalConn() int

GetTotalConn get total connections

func (*NEpoll) Remove

func (e *NEpoll) Remove(conn net.Conn) error

Remove delete conn from NEpoll

func (*NEpoll) Wait

func (e *NEpoll) Wait() ([]net.Conn, error)

Wait process batch 100 events from unix.EpollWait

type STNWSServer

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

STNWSServer struct

func GetInstanceST

func GetInstanceST(name string) *STNWSServer

GetInstanceST get instance TK

func NewSTNWSServer

func NewSTNWSServer(name string) *STNWSServer

NewSTNWSServer new STNWSServer

func (*STNWSServer) BroadcastMsgByte

func (nwss *STNWSServer) BroadcastMsgByte(message []byte)

BroadcastMsgByte broadcast msg byte

func (*STNWSServer) GetNEpoll

func (nwss *STNWSServer) GetNEpoll() *NEpoll

GetNEpoll get NEpoll

func (*STNWSServer) GetName

func (nwss *STNWSServer) GetName() string

GetName get name

func (*STNWSServer) Start

func (nwss *STNWSServer) Start()

Start websocket server

type TKNWSServer

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

TKNWSServer struct

func GetInstanceTK

func GetInstanceTK(name string) *TKNWSServer

GetInstanceTK get instance TK

func NewTKNWSServer

func NewTKNWSServer(name string) *TKNWSServer

NewTKNWSServer new TKNWSServer

func (*TKNWSServer) BroadcastMsgByte

func (nwss *TKNWSServer) BroadcastMsgByte(message []byte)

BroadcastMsgByte broadcast msg byte

func (*TKNWSServer) GetNEpoll

func (nwss *TKNWSServer) GetNEpoll() *NEpoll

GetNEpoll get NEpoll

func (*TKNWSServer) GetName

func (nwss *TKNWSServer) GetName() string

GetName get name

func (*TKNWSServer) Start

func (nwss *TKNWSServer) Start()

Start websocket server

Jump to

Keyboard shortcuts

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