webwire-go: github.com/qbeon/webwire-go Index | Files | Directories

package webwire

import "github.com/qbeon/webwire-go"

Index

Package Files

connection.go connectionOptions.go defaultSessionManager.go encodedPayload.go errors.go genericSessionInfo.go handleMessage.go handleMetadata.go handleRequest.go handleSessionClosure.go handleSessionRestore.go handleSignal.go heartbeat.go interfaces.go listener.go message.go newServer.go serveHttp.go server.go serverOptions.go session.go sessionInfoToVarMap.go sessionLookupResult.go sessionRegistry.go socket.go socketImpl.go translateContextError.go

Constants

const (
    // EncodingBinary represents unencoded binary data
    EncodingBinary PayloadEncoding = pld.Binary

    // EncodingUtf8 represents UTF8 encoding
    EncodingUtf8 = pld.Utf8

    // EncodingUtf16 represents UTF16 encoding
    EncodingUtf16 = pld.Utf16
)
const (
    // UnlimitedConcurrency represents an option for an unlimited
    // number of concurrent handlers of a connection
    UnlimitedConcurrency uint = 0
)

func IsCanceledErr Uses

func IsCanceledErr(err error) bool

IsCanceledErr returns true if the given error is a CanceledErr, otherwise returns false

func IsTimeoutErr Uses

func IsTimeoutErr(err error) bool

IsTimeoutErr returns true if the given error is either a TimeoutErr or a DeadlineExceededErr, otherwise returns false

func SessionInfoToVarMap Uses

func SessionInfoToVarMap(info SessionInfo) map[string]interface{}

SessionInfoToVarMap is a utility function that turns a session info compliant object into a map of variants. This is helpful for serialization of session info objects.

func TranslateContextError Uses

func TranslateContextError(err error) error

TranslateContextError translates context errors to webwire error types

type CanceledErr Uses

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

CanceledErr represents a failure due to cancelation

func NewCanceledErr Uses

func NewCanceledErr(cause error) CanceledErr

NewCanceledErr constructs a new canceled errror instance

func (CanceledErr) Error Uses

func (err CanceledErr) Error() string

Error implements the error interface

type ClientInfo Uses

type ClientInfo struct {
    ConnectionTime time.Time
    UserAgent      string
    RemoteAddr     net.Addr
}

ClientInfo represents basic information about a client connection

type ConnIncompErr Uses

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

ConnIncompErr represents a connection error type indicating that the server requires an incompatible version of the protocol and can't therefore be connected to.

func NewConnIncompErr Uses

func NewConnIncompErr(requiredVersion, supportedVersion string) ConnIncompErr

NewConnIncompErr constructs and returns a new "incompatible protocol version" error based on the required and supported protocol versions

func (ConnIncompErr) Error Uses

func (err ConnIncompErr) Error() string

type ConnUpgrader Uses

type ConnUpgrader interface {
    Upgrade(resp http.ResponseWriter, req *http.Request) (Socket, error)
}

ConnUpgrader defines the abstract interface of an HTTP to WebSocket connection upgrader

type Connection Uses

type Connection interface {
    // IsActive returns true if this connection is in active state
    // ready to accept incoming messages, otherwise returns false
    IsActive() bool

    // Info returns information about this connection including the
    // client agent string, the remote address and the time of creation
    Info() ClientInfo

    // Signal sends a named signal containing the given payload to the client
    Signal(name string, payload Payload) error

    // CreateSession creates a new session for this connection and
    // automatically synchronizes the new session to the remote client.
    // The synchronization happens asynchronously using a signal
    // and doesn't block the calling goroutine.
    // Returns an error if there's already another session active
    CreateSession(attachment SessionInfo) error

    // CloseSession disables the currently active session for this connection
    // and synchronize the closure to the remote client.
    // The session will be destroyed if this is it's last connection remaining.
    // Does nothing if there's no active session
    CloseSession() error

    // HasSession returns true if this connection currently has
    // a session assigned, otherwise returns false
    HasSession() bool

    // Session returns an exact copy of the session object or nil if there's no
    // session currently assigned to this connection
    Session() *Session

    // SessionKey returns the key of the currently assigned session.
    // Returns an empty string if there's no session assigned to this connection
    SessionKey() string

    // SessionCreation returns the creation time
    // of the currently assigned session.
    // Warning: be sure to check whether there's a session beforehand because
    // this function will return garbage if
    // there's currently no session assigned
    SessionCreation() time.Time

    // SessionInfo returns a copy of the session info field value
    // in the form of an empty interface to be casted to either concrete type
    SessionInfo(name string) interface{}

    // Close marks this connection for shutdown.
    // It defers closing the connection until all work on it is done
    // and removes it from the session registry.
    // Does nothing when called multiple times
    Close()
}

Connection represents a connected client

type ConnectionOptions Uses

type ConnectionOptions interface {
    // Accept returns true if the incoming connection shall be accepted,
    // otherwise returns false indicating that the connection shall be refused
    Accept() bool

    // ConcurrencyLimit returns the maximum number of operations to be allowed
    // to concurrently be processed for this particular client connection.
    // If ConcurrencyLimit is 0 then the number of concurrent operations
    // for this particular connection will be unlimited
    ConcurrencyLimit() uint
}

ConnectionOptions represents the connection upgrade options used in the BeforeUpgrade server implementation hook

func AcceptConnection Uses

func AcceptConnection(concurrencyLimit uint) ConnectionOptions

AcceptConnection accepts an incoming connection using the given configuration

func RefuseConnection Uses

func RefuseConnection(reason string) ConnectionOptions

RefuseConnection refuses an incoming connection using the given configuration

type DeadlineExceededErr Uses

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

DeadlineExceededErr represents a failure due to an excess of a user-defined deadline

func NewDeadlineExceededErr Uses

func NewDeadlineExceededErr(cause error) DeadlineExceededErr

NewDeadlineExceededErr constructs a new deadline excess error

func (DeadlineExceededErr) Error Uses

func (err DeadlineExceededErr) Error() string

Error implements the error interface

type DefaultSessionKeyGenerator Uses

type DefaultSessionKeyGenerator struct{}

DefaultSessionKeyGenerator implements the webwire.SessionKeyGenerator interface

func (*DefaultSessionKeyGenerator) Generate Uses

func (gen *DefaultSessionKeyGenerator) Generate() string

Generate implements the webwire.Sessio

type DefaultSessionManager Uses

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

DefaultSessionManager represents a default session manager implementation. It uses files as a persistent storage

func NewDefaultSessionManager Uses

func NewDefaultSessionManager(sessFilesPath string) *DefaultSessionManager

NewDefaultSessionManager constructs a new default session manager instance. Verifies the existence of the given session directory and creates it if it doesn't exist yet

func (*DefaultSessionManager) OnSessionClosed Uses

func (mng *DefaultSessionManager) OnSessionClosed(sessionKey string) error

OnSessionClosed implements the session manager interface. It closes the session by deleting the according session file

func (*DefaultSessionManager) OnSessionCreated Uses

func (mng *DefaultSessionManager) OnSessionCreated(conn Connection) error

OnSessionCreated implements the session manager interface. It writes the created session into a file using the session key as file name

func (*DefaultSessionManager) OnSessionLookup Uses

func (mng *DefaultSessionManager) OnSessionLookup(key string) (
    SessionLookupResult,
    error,
)

OnSessionLookup implements the session manager interface. It searches the session file directory for the session file and loads it. It also updates the file by updating the last lookup session field.

type DisconnectedErr Uses

type DisconnectedErr struct {
    Cause error
}

DisconnectedErr represents an error type indicating that the targeted client is disconnected

func NewDisconnectedErr Uses

func NewDisconnectedErr(err error) DisconnectedErr

NewDisconnectedErr constructs a new DisconnectedErr error based on the actual error

func (DisconnectedErr) Error Uses

func (err DisconnectedErr) Error() string

type EncodedPayload Uses

type EncodedPayload struct {
    Payload pld.Payload
}

EncodedPayload represents an encoded message payload and implements the WebWire payload interface

func (*EncodedPayload) Data Uses

func (pld *EncodedPayload) Data() []byte

Data implements the WebWire payload interface

func (*EncodedPayload) Encoding Uses

func (pld *EncodedPayload) Encoding() PayloadEncoding

Encoding implements the WebWire payload interface

func (*EncodedPayload) Utf8 Uses

func (pld *EncodedPayload) Utf8() (string, error)

Utf8 implements the WebWire payload interface

type GenericSessionInfo Uses

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

GenericSessionInfo defines a default webwire.SessionInfo interface implementation type used by the client when no explicit session info parser is used

func (*GenericSessionInfo) Copy Uses

func (sinf *GenericSessionInfo) Copy() SessionInfo

Copy implements the webwire.SessionInfo interface. It deep-copies the object and returns it's exact clone

func (*GenericSessionInfo) Fields Uses

func (sinf *GenericSessionInfo) Fields() []string

Fields implements the webwire.SessionInfo interface. It returns a constant list of the names of all fields of the object

func (*GenericSessionInfo) Value Uses

func (sinf *GenericSessionInfo) Value(fieldName string) interface{}

Value implements the webwire.SessionInfo interface. It returns an exact deep copy of a session info field value

type JSONEncodedSession Uses

type JSONEncodedSession struct {
    Key        string                 `json:"k"`
    Creation   time.Time              `json:"c"`
    LastLookup time.Time              `json:"l"`
    Info       map[string]interface{} `json:"i,omitempty"`
}

JSONEncodedSession represents a JSON encoded session object. This structure is used during session restoration for unmarshalling TODO: move to internal shared package

type MaxSessConnsReachedErr Uses

type MaxSessConnsReachedErr struct{}

MaxSessConnsReachedErr represents an authentication error type indicating that the given session already reached the maximum number of concurrent connections

func (MaxSessConnsReachedErr) Error Uses

func (err MaxSessConnsReachedErr) Error() string

type Message Uses

type Message interface {
    // MessageType returns the type of the message
    MessageType() byte

    // Identifier returns the message identifier
    Identifier() [8]byte

    // Name returns the name of the message
    Name() string

    // Payload returns the message payload
    Payload() Payload
}

Message represents a WebWire protocol message

type MessageWrapper Uses

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

MessageWrapper wraps a msg.Message pointer to make it implement the Message interface

func NewMessageWrapper Uses

func NewMessageWrapper(message *msg.Message) *MessageWrapper

NewMessageWrapper creates a new Message interface compliant message object

func (*MessageWrapper) Identifier Uses

func (wrp *MessageWrapper) Identifier() [8]byte

Identifier implements the Message interface

func (*MessageWrapper) MessageType Uses

func (wrp *MessageWrapper) MessageType() byte

MessageType implements the Message interface

func (*MessageWrapper) Name Uses

func (wrp *MessageWrapper) Name() string

Name implements the Message interface

func (*MessageWrapper) Payload Uses

func (wrp *MessageWrapper) Payload() Payload

Payload implements the Message interface

type OptionValue Uses

type OptionValue = int32

OptionValue represents the setting value of an option

const (
    // OptionUnset represents the default unset value
    OptionUnset OptionValue = iota

    // Disabled disables an option
    Disabled

    // Enabled enables an option
    Enabled
)

type Payload Uses

type Payload interface {
    // Encoding returns the payload encoding type
    Encoding() PayloadEncoding

    // Data returns the raw payload data
    Data() []byte

    // Utf8 returns a UTF8 representation of the payload data
    Utf8() (string, error)
}

Payload represents a WebWire message payload

func NewPayload Uses

func NewPayload(encoding PayloadEncoding, data []byte) Payload

NewPayload creates a new WebWire message payload

type PayloadEncoding Uses

type PayloadEncoding = pld.Encoding

PayloadEncoding represents the type of encoding of the message payload

type ProtocolErr Uses

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

ProtocolErr represents an error type indicating an error in the protocol implementation

func NewProtocolErr Uses

func NewProtocolErr(err error) ProtocolErr

NewProtocolErr constructs a new ProtocolErr error based on the actual error

func (ProtocolErr) Error Uses

func (err ProtocolErr) Error() string

type ReqErr Uses

type ReqErr struct {
    Code    string
    Message string
}

ReqErr represents an error returned in case of a request that couldn't be processed

func (ReqErr) Error Uses

func (err ReqErr) Error() string

type ReqInternalErr Uses

type ReqInternalErr struct{}

ReqInternalErr represents a request error type indicating that the request failed due to an internal server-side error

func (ReqInternalErr) Error Uses

func (err ReqInternalErr) Error() string

type ReqSrvShutdownErr Uses

type ReqSrvShutdownErr struct{}

ReqSrvShutdownErr represents a request error type indicating that the request cannot be processed due to the server currently being shut down

func (ReqSrvShutdownErr) Error Uses

func (err ReqSrvShutdownErr) Error() string

type ReqTransErr Uses

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

ReqTransErr represents a connection error type indicating that the dialing failed.

func NewReqTransErr Uses

func NewReqTransErr(err error) ReqTransErr

NewReqTransErr constructs and returns a new request transmission error based on the actual error message

func (ReqTransErr) Error Uses

func (err ReqTransErr) Error() string

type Server Uses

type Server interface {
    // ServeHTTP implements the HTTP handler interface
    ServeHTTP(resp http.ResponseWriter, req *http.Request)

    // Run will launch the webwire server blocking the calling goroutine
    // until the server is either gracefully shut down
    // or crashes returning an error
    Run() error

    // Addr returns the address the webwire server is listening on
    Addr() net.Addr

    // Shutdown appoints a server shutdown and blocks the calling goroutine
    // until the server is gracefully stopped awaiting all currently processed
    // signal and request handlers to return.
    // During the shutdown incoming connections are rejected
    // with 503 service unavailable.
    // Incoming requests are rejected with an error while incoming signals
    // are just ignored
    Shutdown() error

    // ActiveSessionsNum returns the number of currently active sessions
    ActiveSessionsNum() int

    // SessionConnectionsNum implements the SessionRegistry interface
    SessionConnectionsNum(sessionKey string) int

    // SessionConnections implements the SessionRegistry interface
    SessionConnections(sessionKey string) []Connection

    // CloseSession closes the session identified by the given key and returns
    // the affected connections, a list of errors for each session session
    // closure attempt and a general error which is not nil if at least
    // of the closeErrors errors is not nil.
    // If no session was closed then (nil, nil, nil) is returned.
    CloseSession(sessionKey string) (
        affectedConnections []Connection,
        closeErrors []error,
        err error,
    )
}

Server defines the interface of a webwire server instance

func NewHeadlessServer Uses

func NewHeadlessServer(
    implementation ServerImplementation,
    opts ServerOptions,
) (instance Server, err error)

NewHeadlessServer creates a new headless WebWire server instance which relies on an external HTTP server to host it

func NewServer Uses

func NewServer(
    implementation ServerImplementation,
    opts ServerOptions,
) (instance Server, err error)

NewServer creates a new headed WebWire server instance with a built-in HTTP server hosting it

type ServerImplementation Uses

type ServerImplementation interface {
    // OnOptions is invoked when the websocket endpoint is examined
    // by the client using the HTTP OPTION method.
    OnOptions(resp http.ResponseWriter)

    // BeforeUpgrade is invoked right before the upgrade of an incoming HTTP
    // connection request to a WebSocket connection and can be used to
    // intercept, configure or prevent incoming connections.
    // BeforeUpgrade must return either the result of the `AcceptConnection`
    // or the result of the `RefuseConnection` functions.
    // Returning nil will refuse the incoming connection without an explanation
    BeforeUpgrade(
        resp http.ResponseWriter,
        req *http.Request,
    ) ConnectionOptions

    // OnClientConnected is invoked when a new client successfully established
    // a connection to the server.
    //
    // This hook will be invoked by the goroutine serving the client and thus
    // will block the initialization process, detaining the client from
    // starting to listen for incoming messages.
    // To prevent blocking the initialization process it is advised to move
    // any time consuming work to a separate goroutine
    OnClientConnected(client Connection)

    // OnClientDisconnected is invoked when a client closes the connection
    // to the server.
    //
    // This hook will be invoked by the goroutine serving
    // the calling client before it's suspended
    OnClientDisconnected(client Connection)

    // OnSignal is invoked when the webwire server receives
    // a signal from a client.
    //
    // This hook will be invoked by the goroutine serving the calling client
    // and will block any other interactions with this client while executing
    OnSignal(ctx context.Context, client Connection, message Message)

    // OnRequest is invoked when the webwire server receives a request
    // from a client. It must return either a response payload or an error.
    //
    // A webwire.ReqErr error can be returned to reply with an error code
    // and an error message, this is useful when the clients user code needs
    // to be able to understand the error and react accordingly.
    // If a non-webwire error type is returned such as an error created by
    // fmt.Errorf() then a special kind of error (internal server error)
    // is returned to the client as a reply, in this case the error will be
    // logged and the error message will not be sent to the client
    // for security reasons as this might accidentally leak
    // sensitive information to the client.
    //
    // This hook will be invoked by the goroutine serving the calling client
    // and will block any other interactions with this client while executing
    OnRequest(
        ctx context.Context,
        client Connection,
        message Message,
    ) (response Payload, err error)
}

ServerImplementation defines the interface of a webwire server implementation

type ServerOptions Uses

type ServerOptions struct {
    Address               string
    Sessions              OptionValue
    SessionManager        SessionManager
    SessionKeyGenerator   SessionKeyGenerator
    SessionInfoParser     SessionInfoParser
    MaxSessionConnections uint
    Heartbeat             OptionValue
    HeartbeatTimeout      time.Duration
    HeartbeatInterval     time.Duration
    WarnLog               *log.Logger
    ErrorLog              *log.Logger
}

ServerOptions represents the options used during the creation of a new WebWire server instance

func (*ServerOptions) SetDefaults Uses

func (srvOpt *ServerOptions) SetDefaults()

SetDefaults sets the defaults for undefined required values

type SessNotFoundErr Uses

type SessNotFoundErr struct{}

SessNotFoundErr represents a session restoration error type indicating that the server didn't find the session to be restored

func (SessNotFoundErr) Error Uses

func (err SessNotFoundErr) Error() string

type Session Uses

type Session struct {
    Key        string
    Creation   time.Time
    LastLookup time.Time
    Info       SessionInfo
}

Session represents a session object. If the key is empty the session is invalid. Info can contain arbitrary attached data

func NewSession Uses

func NewSession(info SessionInfo, generator func() string) Session

NewSession generates a new session object generating a cryptographically random secure key

func (*Session) Clone Uses

func (s *Session) Clone() *Session

Clone returns an exact copy of the session object

type SessionInfo Uses

type SessionInfo interface {
    // Fields must return the exact names of all fields
    // of the session info object. This getter method must be idempotent,
    // which means that it must always return the same list of names
    Fields() []string

    // Value must return an exact deep copy of the value of a session info
    // object field identified by the given field name.
    //
    // Note that returning a shallow copy (such as shallow copies of
    // maps or slices for example) could lead to potentially dangerous
    // race conditions and undefined behavior
    Value(fieldName string) interface{}

    // Copy must return an exact deep copy of the entire session info object.
    //
    // Note that returning a shallow copy (such as shallow copies of
    // maps or slices for example) could lead to potentially dangerous
    // race conditions and undefined behavior
    Copy() SessionInfo
}

SessionInfo represents a session info object implementation interface. It defines a set of important methods that must be implemented carefully in order to avoid race conditions

func GenericSessionInfoParser Uses

func GenericSessionInfoParser(data map[string]interface{}) SessionInfo

GenericSessionInfoParser represents a default implementation of a session info object parser. It parses the info object into a generic session info type implementing the webwire.SessionInfo interface

type SessionInfoParser Uses

type SessionInfoParser func(map[string]interface{}) SessionInfo

SessionInfoParser represents the type of a session info parser function. The session info parser is invoked during the parsing of a newly assigned session on the client, as well as during the parsing of a saved serialized session. It must return a webwire.SessionInfo compliant object constructed from the data given

type SessionKeyGenerator Uses

type SessionKeyGenerator interface {
    // Generate is invoked when the webwire server creates a new session
    // and requires a new session key to be generated.
    // This hook must not be used except the user knows exactly what he/she does
    // as it would compromise security if implemented improperly
    Generate() string
}

SessionKeyGenerator defines the interface of a webwire server's session key generator. This interface must not be implemented (!) unless the default generator doesn't meet the exact needs of the library user, because the default generator already provides a secure implementation

func NewDefaultSessionKeyGenerator Uses

func NewDefaultSessionKeyGenerator() SessionKeyGenerator

NewDefaultSessionKeyGenerator constructs a new default session key generator implementation

type SessionLookupResult Uses

type SessionLookupResult interface {
    // Creation returns the retrieved creation time
    Creation() time.Time

    // LastLookup returns the retrieved last lookup time
    LastLookup() time.Time

    // Info returns the retrieved session information
    // in the form of a JSON compliant variant map
    Info() map[string]interface{}
}

SessionLookupResult represents the result of a session lookup

func NewSessionLookupResult Uses

func NewSessionLookupResult(
    creation time.Time,
    lastLookup time.Time,
    info map[string]interface{},
) SessionLookupResult

NewSessionLookupResult creates a new result of a session lookup operation

type SessionManager Uses

type SessionManager interface {
    // OnSessionCreated is invoked after the synchronization of the new session
    // to the remote client.
    // The actual created session can be retrieved from the provided connection.
    // If OnSessionCreated returns an error then this error is logged
    // but the session will not be destroyed and will remain active!
    // The only consequence of OnSessionCreation failing is that the server
    // won't be able to restore the session after the client is disconnected.
    //
    // This hook will be invoked by the goroutine calling the
    // client.CreateSession connection method
    OnSessionCreated(client Connection) error

    // OnSessionLookup is invoked when the server is looking for a specific
    // session given its key.
    // If the session wasn't found `nil` must be returned without an error,
    // otherwise if the session was found then a SessionLookupResult instance
    // created by wwr.NewSessionLookupResult must be returned with the required
    // parameters set.
    //
    // If an error (that's not a webwire.SessNotFoundErr) is returned then
    // it'll be logged and the session restoration will fail.
    //
    // This hook will be invoked by the goroutine serving the associated client
    // and will block any other interactions with this client while executing
    //
    // WARNING: if this hooks doesn't update the LastLookup field of the found
    // session object then the session garbage collection won't work properly
    OnSessionLookup(key string) (result SessionLookupResult, err error)

    // OnSessionClosed is invoked when the session associated with the given key
    // is closed (thus destroyed) either by the server or the client.
    // A closed session must be permanently deleted and must not be discoverable
    // in the OnSessionLookup hook any longer.
    // If an error is returned then the it is logged.
    //
    // This hook is invoked by either a goroutine calling the method
    // connection.CloseSession(), or the goroutine serving the associated client,
    // in the case of which it will block any other interactions with
    // this client while executing
    OnSessionClosed(sessionKey string) error
}

SessionManager defines the interface of a webwire server's session manager

type SessionsDisabledErr Uses

type SessionsDisabledErr struct{}

SessionsDisabledErr represents an error type indicating that the server has sessions disabled

func (SessionsDisabledErr) Error Uses

func (err SessionsDisabledErr) Error() string

type SockReadErr Uses

type SockReadErr interface {
    // IsAbnormalCloseErr must return true if the error represents
    // an abnormal closure error
    IsAbnormalCloseErr() bool
}

SockReadErr defines the interface of a webwire.Socket.Read error

type Socket Uses

type Socket interface {
    // Dial must connect the socket to the specified server
    Dial(serverAddr string) error

    // Write must send the given data to the other side of the socket
    // while protecting the connection from concurrent writes
    Write(data []byte) error

    // Read must block the calling goroutine and await an incoming message.
    // When a message arrives or an error occurs Read must return
    Read() ([]byte, SockReadErr)

    // IsConnected must return true if the given socket
    // maintains an open connection or otherwise return false
    IsConnected() bool

    // RemoteAddr must return the address of the remote client
    // or nil if the client is not connected
    RemoteAddr() net.Addr

    // Close must close the socket
    Close() error

    // SetReadDeadline must set the readers deadline
    SetReadDeadline(deadline time.Time) error

    // OnPong must set the pong-message handler
    OnPong(handler func(string) error)

    // OnPing must set the ping-message handler
    OnPing(handler func(string) error)

    // WritePing must send a ping-message with the given data appended
    WritePing(data []byte, deadline time.Time) error
}

Socket defines the abstract socket implementation interface

func NewSocket Uses

func NewSocket() Socket

NewSocket creates a new disconnected gorilla/websocket based socket instance

type TimeoutErr Uses

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

TimeoutErr represents a failure due to a timeout

func NewTimeoutErr Uses

func NewTimeoutErr(cause error) TimeoutErr

NewTimeoutErr constructs a new timeout error

func (TimeoutErr) Error Uses

func (err TimeoutErr) Error() string

Error implements the error interface

Directories

PathSynopsis
client
message
payload
requestManager
test

Package webwire imports 19 packages (graph) and is imported by 6 packages. Updated 2018-09-22. Refresh now. Tools for package owners.