Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultDialTimeout provides default auth timeout to remote server. DefaultDialTimeout = 5 * time.Second // DefaultDeadline provides default deadline to tcp read/write operations. DefaultDeadline = 5 * time.Second // MaxCommandLen is an artificial restriction, but it will help in case of random // large queries. MaxCommandLen = 1000 )
View Source
const RandIdentifierLimit = 1000
Variables ¶
View Source
var ( // ErrAuthFailed is returned when the package id from authentication // response is -1. ErrAuthFailed = errors.New("authentication failed") // ErrCommandTooLong is returned when executed command length is bigger // than MaxCommandLen characters. ErrCommandTooLong = errors.New("command too long") // ErrCommandEmpty is returned when executed command length equal 0. ErrCommandEmpty = errors.New("command too small") )
View Source
var DefaultSettings = Settings{ // contains filtered or unexported fields }
DefaultSettings provides default deadline settings to Conn.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a WebSocket connection.
func (*Conn) RemoteAddr ¶ added in v1.0.0
RemoteAddr returns the remote network address.
type Message ¶
type Message struct {
// Message field is a string command to send to the server and response
// message from RemoteServer.
Message string `json:"Message"`
// Identifier field is a 32-bit little endian integer chosen by the
// client for each request. It may be set to any positive integer.
// When the RemoteServer responds to the request, the response packet
// will have the same Identifier as the original request.
// It need not be unique, but if a unique packet id is assigned,
// it can be used to match incoming responses to their corresponding requests.
Identifier int `json:"Identifier"`
// Type is the type of message that was sent or received.
// Can take the following values: Generic, Log, Warning, Error.
// When sending a request, you can leave it blank.
Type string `json:"Type"`
Stacktrace string `json:"stacktrace"`
}
Message is both requests and responses are sent as packets wia WebSocket. Their payload follows the following basic structure.
type Option ¶
type Option func(s *Settings)
Option allows to inject settings to Settings.
func SetDeadline ¶
SetDeadline injects read/write Timeout to Settings.
func SetDialTimeout ¶
SetDialTimeout injects dial Timeout to Settings.
Click to show internal directories.
Click to hide internal directories.