Documentation ¶
Index ¶
- Constants
- func StartHTTPServer(addr string, requestChannel chan<- *keystore.Request)
- func StartTCPServer(addr string, requests chan<- *keystore.Request)
- func StartUDPServer(addr string, requests chan<- *keystore.Request)
- type HTTPClient
- type TCPClient
- type TCPClientHandler
- type TCPServer
- type UDPClient
- type UDPServer
Constants ¶
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 ¶
StartHTTPServer will start a new HTTP server allowing requests to be made to the key store service over a REST interface
func StartTCPServer ¶
StartTCPServer will start a new TCP server allowing requests to be made to the key store service
func StartUDPServer ¶
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) 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 ¶
NewTCPClient will create a new TCP connection using the host address
func (*TCPClient) Connect ¶
func (client *TCPClient) Connect()
Connect will start the event listener for incoming data
func (*TCPClient) SendRequest ¶
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 ¶
NewUDPClient will create a new UDP connection using the host address
func (*UDPClient) Connect ¶
func (udp *UDPClient) Connect()
Connect will start the event listener for incoming data
func (*UDPClient) SendRequest ¶
SendRequest will push the request onto the channel