transport

package
v0.0.0-...-82b166b Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MaxRequestLength int64 = 1024

MaxRequestLength specifies the amount of bytes accepted on a request Do not let someone hang the service by sending continous stream of data on the request. 10Kb will be big enough for this example.

Variables

This section is empty.

Functions

func StartHTTPServer

func StartHTTPServer(addr string, requestChannel chan<- *keystore.Request)

StartHTTPServer will start a new HTTP server allowing requests to be made to the key store service over a REST interface

func StartTCPServer

func StartTCPServer(addr string, requests chan<- *keystore.Request)

StartTCPServer will start a new TCP server allowing requests to be made to the key store service

func StartUDPServer

func StartUDPServer(addr string, requests chan<- *keystore.Request)

StartUDPServer will start a new UDP service allowing requests to be made to the key store service

Types

type HTTPClient

type HTTPClient struct {
	*keystore.Sync // Adopt the sync struct
	// contains filtered or unexported fields
}

HTTPClient holds the HTTP client connection

func NewHTTPClient

func NewHTTPClient(hostaddr string) *HTTPClient

NewHTTPClient will create a new HTTP connection using the host address

func (*HTTPClient) Close

func (client *HTTPClient) Close()

Close will stop this client connection

func (*HTTPClient) Connect

func (client *HTTPClient) Connect()

Connect will start the event listener for incoming data

func (*HTTPClient) SendRequest

func (client *HTTPClient) SendRequest(request *keystore.Request)

SendRequest will push the request onto the channel

type TCPClient

type TCPClient struct {
	*keystore.Sync // Adopt the sync struct
	// contains filtered or unexported fields
}

TCPClient holds the TCP client connection

func NewTCPClient

func NewTCPClient(hostaddr string) *TCPClient

NewTCPClient will create a new TCP connection using the host address

func (*TCPClient) Close

func (client *TCPClient) Close()

Close will stop this client connection

func (*TCPClient) Connect

func (client *TCPClient) Connect()

Connect will start the event listener for incoming data

func (*TCPClient) SendRequest

func (client *TCPClient) SendRequest(request *keystore.Request)

SendRequest will push the request onto the channel

type TCPClientHandler

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

TCPClientHandler holds the TCP client connection

type TCPServer

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

TCPServer holds the TCP client connection

func (*TCPServer) Disconnect

func (server *TCPServer) Disconnect()

Disconnect will send the shutdown signal to this server connection

type UDPClient

type UDPClient struct {
	*keystore.Sync // Adopt the sync struct
	// contains filtered or unexported fields
}

UDPClient holds the UDP client connection

func NewUDPClient

func NewUDPClient(hostaddr, localaddr string) *UDPClient

NewUDPClient will create a new UDP connection using the host address

func (*UDPClient) Close

func (udp *UDPClient) Close()

Close will stop this client connection

func (*UDPClient) Connect

func (udp *UDPClient) Connect()

Connect will start the event listener for incoming data

func (*UDPClient) SendRequest

func (udp *UDPClient) SendRequest(request *keystore.Request)

SendRequest will push the request onto the channel

type UDPServer

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

UDPServer holds the UDP client connection

Jump to

Keyboard shortcuts

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