Documentation
¶
Overview ¶
Note: this package is not used now, just for websocket in future!
Note: this package is not used now, just for websocket in future!
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConnectClosed = errors.New("connection closed") ErrConnectReconnect = errors.New("connection reconnecting") )
Functions ¶
This section is empty.
Types ¶
type ConnectStatus ¶
type ConnectStatus int32
const ( ConnectOpen ConnectStatus = iota ConnectClosed ConnectReconnect )
type HConn ¶
type HConn struct {
// contains filtered or unexported fields
}
HConn examines the liveness of the underground connection periodically, and reconnects to the remote when the underground connection is unexpectedly closed
func (*HConn) CheckHealth ¶
func (*HConn) Status ¶
func (c *HConn) Status() ConnectStatus
type JsonResponse ¶
type Message ¶
type Message struct { Type MessageType Timestamp string Module Module Session string Payload json.RawMessage }
func NewJsonMessage ¶
func NewMessage ¶
func NewMessage(typ MessageType, mod Module, data []byte) *Message
type MessageBytes ¶
type MessageBytes []byte
func (MessageBytes) Deserialize ¶
func (mb MessageBytes) Deserialize() (Message, error)
type MessageError ¶
type MessageType ¶
type MessageType string
const ( FileType MessageType = "file" CommandType MessageType = "command" JsonType MessageType = "json" )
Click to show internal directories.
Click to hide internal directories.