Documentation ¶
Index ¶
- Constants
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) IncomingHandshake(handshakeCallback bus.HandshakeCallback) error
- func (c *Conn) OutgoingHandshake(handshake *bus.TransportHandshake) (*bus.TransportHandshakeAck, error)
- func (c *Conn) ReadMsg() (bus.Message, *bus.Withdraw, error)
- func (c *Conn) SendMsg(msg bus.Message) error
- func (c *Conn) SendWithdraw(withdraw *bus.Withdraw) error
- func (c *Conn) WriteMessage(messageType int, data []byte) error
- type Transport
Constants ¶
const (
MsgTypeWebsocketMessage = "websocket.message"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn implements transport.Connection and represents a websocket connection
func (*Conn) IncomingHandshake ¶
func (c *Conn) IncomingHandshake(handshakeCallback bus.HandshakeCallback) error
IncomingHandshake performs a connection handshake and returns the UUID of the node that we're connected to so that it can be validated against the UUID that was provided in discovery (or if none was provided)
func (*Conn) OutgoingHandshake ¶
func (c *Conn) OutgoingHandshake(handshake *bus.TransportHandshake) (*bus.TransportHandshakeAck, error)
OutgoingHandshake performs a connection handshake and returns the UUID of the node that we're connected to so that it can be validated against the UUID that was provided in discovery (or if none was provided)
func (*Conn) SendWithdraw ¶
SendWithdraw sends a withdraw message to the peer
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a transport that connects Grav nodes via standard websockets
func (*Transport) Connect ¶
func (t *Transport) Connect(endpoint string) (bus.Connection, error)
Connect adds a websocket endpoint to emit messages to
func (*Transport) HTTPHandlerFunc ¶
func (t *Transport) HTTPHandlerFunc() http.HandlerFunc
HTTPHandlerFunc returns an http.HandlerFunc for incoming connections
func (*Transport) Setup ¶
func (t *Transport) Setup(opts *bus.MeshOptions, connFunc bus.ConnectFunc) error
Setup sets up the transport