Documentation
¶
Index ¶
Constants ¶
View Source
const ( Dial string = "/clientconn" Listen string = "/serverconn" Accept string = "/servercallback" )
handles for our api
View Source
const ( MTLS string = "https://" TCP string = "http://" )
address prefixes
Variables ¶
This section is empty.
Functions ¶
func MarshalToSSEEvent ¶
func MarshalToSSEEvent(connReq *ConnectionRequest) (string, error)
Types ¶
type ConnectionAccept ¶
type ConnectionAccept struct { Data string `json:"Data"` ClientID string `json:"ClientID"` ServerID string `json:"ServerID"` }
ConnectionAccept is sent by an exporter to an importer
type ConnectionRequest ¶
type ConnectionRequest struct { Data string `json:"Data"` ClientID string `json:"ClientID"` ServerID string `json:"ServerID"` }
ConnectionRequest is sent by an impoerter to an exporter
func UnmarshalFromSSEEvent ¶
func UnmarshalFromSSEEvent(sseEvent string) (*ConnectionRequest, error)
func (*ConnectionRequest) FromJSON ¶
func (cr *ConnectionRequest) FromJSON(data []byte) error
func (*ConnectionRequest) ToJSON ¶
func (cr *ConnectionRequest) ToJSON() ([]byte, error)
type ForwardingSuccessNotification ¶
type ForwardingSuccessNotification struct { Message Notification Error error }
ForwardingSuccessNotification informs whether a ConnectionRequest was passed on successfully to the listening server by the relay
type ListenRequest ¶
ListenRequest is sent by an exporter opening a persistent connection to a relay
type Notification ¶
type Notification string
const ( NotePassed Notification = "connection request passed to server" //success NoteServerConnLost Notification = "connection request failed server disconnected" NoteServerNoExist Notification = "server requested not registered with relay" NoteFail Notification = "connection request failed" // generic fail )
Click to show internal directories.
Click to hide internal directories.