ws

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Accept

Accept accepts a WebSocket handshake from a client and upgrades the the connection to a WebSocket.

Types

type Inbound

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

Inbound http(ws) type.

func NewInbound

func NewInbound(internalAddr, externalAddr, certFile, keyFile string) (*Inbound, error)

NewInbound creates a new WebSocket inbound transport instance.

func (*Inbound) Endpoint

func (i *Inbound) Endpoint() string

Endpoint provides the http(ws) connection details.

func (*Inbound) Start

func (i *Inbound) Start(prov transport.Provider) error

Start the http(ws) server.

func (*Inbound) Stop

func (i *Inbound) Stop() error

Stop the http(ws) server.

type OutboundClient

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

OutboundClient websocket outbound.

func NewOutbound

func NewOutbound() *OutboundClient

NewOutbound creates a client for Outbound WS transport.

func (*OutboundClient) Accept

func (cs *OutboundClient) Accept(url string) bool

Accept checks for the url scheme.

func (*OutboundClient) AcceptRecipient

func (cs *OutboundClient) AcceptRecipient(keys []string) bool

AcceptRecipient checks if there is a connection for the list of recipient keys.

func (*OutboundClient) Send

func (cs *OutboundClient) Send(data []byte, destination *service.Destination) (string, error)

Send sends a2a data via WS.

func (*OutboundClient) Start

func (cs *OutboundClient) Start(prov transport.Provider) error

Start starts the outbound transport.

Jump to

Keyboard shortcuts

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