api

package
v0.0.0-...-10d9ced Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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

type ListenRequest struct {
	Data     string `json:"Data"`
	ServerID string `json:"ServerID"`
}

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
)

Jump to

Keyboard shortcuts

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