interfaces

package
v0.0.0-...-c475b33 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 4 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckThread

type CheckThread int

CheckThread -

const (
	//FirstOnly -
	FirstOnly CheckThread = iota
	//All -
	All
)

type ClientURL

type ClientURL struct {
	Host     string
	Scheme   string
	Path     string
	Port     int
	Origin   string
	Username string
	Password string
	WithAuth bool
}

ClientURL -

type IWebsocketClient

type IWebsocketClient interface {
	New(*WebsocketClientOption)
	Send(msg []byte)
	SendID(idx int, msg []byte)
	SendGob(interface{})
	SendGobID(idx int, msg interface{})
	SendJSON(interface{})
	SendJSONID(idx int, msg interface{})
	ChangeURL(ClientURL, bool, ClientURL)
	Close(int)
	CloseAll()
	Destroy()
}

IWebsocketClient -

type WebsocketClient

type WebsocketClient struct {
	IWebsocketClient
}

WebsocketClient -

type WebsocketClientOption

type WebsocketClientOption struct {
	NoOfThreads       int
	Prefix            string
	TimeOutMsg        time.Duration
	Logger            *logging.Logger
	OnTickerTimeOut   func(string, int, time.Time, time.Duration)
	CheckInterval     time.Duration
	CheckThread       CheckThread
	OnConnect         func(string, int)
	OnMessage         func(string, int, *[]byte)
	OnClose           func(string, int, error)
	OnError           func(string, int, error)
	OnDestroy         func(string, int, error)
	UseProxy          bool
	SocketURL         ClientURL
	ProxyURL          ClientURL
	TimeOutReconnect  time.Duration
	UserAgent         string
	Counter           *counter.RateCounter
	EnableCompression gob.CompressType
	ShowSendLog       bool
}

WebsocketClientOption -

Jump to

Keyboard shortcuts

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