meshd

package module
v0.0.0-...-bff1da4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MIT Imports: 5 Imported by: 0

README

meshd

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeTLS

func ServeTLS(addr string) error

Types

type EmailAgent

type EmailAgent interface {
	// TODO: Some interface for polling via IMAP or POP3 or ???
	SendPlainTextEmail(targetEmail string, subject string, body string)
}

type Transport

type Transport interface {
	Open()         // Client will connect, server will listen
	Close()        // Client will disconnect, server will stop listening and disconnect all clients
	OnConnect()    // When we connect or re-connect
	OnDisconnect() // Handle disconnection
	OnMessage()    // When we receive a new message from the other endpoint
	OnError()      // When we have an error

	SendMessage() // Send a new message to the other endpoint
	SendReply()   // Send a response to a message we sent
}

Works for websocket client and server

type WebsocketClient

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

func (WebsocketClient) Close

func (wc WebsocketClient) Close()

func (WebsocketClient) OnConnect

func (wc WebsocketClient) OnConnect()

func (WebsocketClient) OnError

func (wc WebsocketClient) OnError()

func (WebsocketClient) OnMessage

func (wc WebsocketClient) OnMessage()

func (WebsocketClient) Open

func (wc WebsocketClient) Open()

func (WebsocketClient) SendMessage

func (wc WebsocketClient) SendMessage()

func (WebsocketClient) SendReply

func (wc WebsocketClient) SendReply()

type WebsocketServer

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

func (WebsocketServer) Close

func (ws WebsocketServer) Close()

func (WebsocketServer) OnConnect

func (ws WebsocketServer) OnConnect()

func (WebsocketServer) OnError

func (ws WebsocketServer) OnError()

func (WebsocketServer) OnMessage

func (ws WebsocketServer) OnMessage()

func (WebsocketServer) Open

func (ws WebsocketServer) Open()

func (WebsocketServer) SendMessage

func (ws WebsocketServer) SendMessage()

func (WebsocketServer) SendReply

func (ws WebsocketServer) SendReply()

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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