Documentation ¶
Index ¶
- Constants
- func DiscoveryService(s ...ServiceDiscovery) func(cfg *Config) error
- func ExchangeKeys(s string) func(cfg *Config) error
- func FromBase64(bb string) func(cfg *Config) error
- func FromYaml(path string) func(cfg *Config) error
- func Handlers(h ...Handler) func(cfg *Config) error
- func Insecure(b bool) func(cfg *Config) error
- func LibP2PLogLevel(l log.LogLevel) func(cfg *Config) error
- func ListenAddresses(ss ...string) func(cfg *Config) error
- func Logger(l log.StandardLogger) func(cfg *Config) error
- func MaxMessageSize(i int) func(cfg *Config) error
- func Message(template string, opts ...interface{}) []byte
- func NetLinkBootstrap(b bool) func(cfg *Config) error
- func RoomName(s string) func(cfg *Config) error
- func SealKeyInterval(i int) func(cfg *Config) error
- func SealKeyLength(i int) func(cfg *Config) error
- func WithInterface(i *water.Interface) func(cfg *Config) error
- func WithInterfaceAddress(i string) func(cfg *Config) error
- func WithInterfaceMTU(i int) func(cfg *Config) error
- func WithInterfaceName(i string) func(cfg *Config) error
- func WithInterfaceType(d water.DeviceType) func(cfg *Config) error
- func WithLibp2pAdditionalOptions(i ...libp2p.Option) func(cfg *Config) error
- func WithLibp2pOptions(i ...libp2p.Option) func(cfg *Config) error
- func WithMaxBlockChainSize(i int) func(cfg *Config) error
- func WithPacketMTU(i int) func(cfg *Config) error
- func WithStreamHandler(id protocol.ID, h StreamHandler) func(cfg *Config) error
- type Config
- type EdgeVPN
- func (e *EdgeVPN) ConnectToService(ledger *blockchain.Ledger, serviceID string, srcaddr string) error
- func (e *EdgeVPN) ExposeService(ledger *blockchain.Ledger, serviceID, dstaddress string)
- func (e *EdgeVPN) Host() host.Host
- func (e *EdgeVPN) Join(ledger *blockchain.Ledger) error
- func (e *EdgeVPN) Logger() log.StandardLogger
- func (e *EdgeVPN) MessageWriter(opts ...hub.MessageOption) (*MessageWriter, error)
- func (e *EdgeVPN) ReceiveFile(ledger *blockchain.Ledger, fileID string, path string) error
- func (e *EdgeVPN) SendFile(ledger *blockchain.Ledger, fileID, filepath string) error
- func (e *EdgeVPN) Start() error
- func (e *EdgeVPN) Stop()
- type Handler
- type MessageWriter
- type OTP
- type OTPConfig
- type Option
- type ServiceDiscovery
- type StreamHandler
- type YAMLConnectionConfig
Constants ¶
View Source
const ( Protocol = "/edgevpn/0.1" ServiceProtocol = "/edgevpn/service/0.1" FileProtocol = "/edgevpn/file/0.1" )
View Source
const ( ServicesLedgerKey = "services" UsersLedgerKey = "users" )
View Source
const (
FilesLedgerKey = "files"
)
View Source
const MachinesLedgerKey = "machines"
Variables ¶
This section is empty.
Functions ¶
func DiscoveryService ¶
func DiscoveryService(s ...ServiceDiscovery) func(cfg *Config) error
DiscoveryService Adds the service given as argument to the discovery services
func ExchangeKeys ¶
func FromBase64 ¶ added in v0.0.6
func LibP2PLogLevel ¶ added in v0.2.2
func ListenAddresses ¶
func MaxMessageSize ¶
func NetLinkBootstrap ¶ added in v0.0.3
func SealKeyInterval ¶
func SealKeyLength ¶
func WithInterfaceAddress ¶
func WithInterfaceMTU ¶
func WithInterfaceName ¶
func WithInterfaceType ¶
func WithInterfaceType(d water.DeviceType) func(cfg *Config) error
func WithLibp2pAdditionalOptions ¶ added in v0.0.4
func WithLibp2pOptions ¶ added in v0.0.3
WithLibp2pOptions Overrides defaults options
func WithMaxBlockChainSize ¶ added in v0.0.5
func WithPacketMTU ¶ added in v0.0.5
func WithStreamHandler ¶ added in v0.1.0
func WithStreamHandler(id protocol.ID, h StreamHandler) func(cfg *Config) error
StreamHandlers adds a handler to the list that is called on each received message
Types ¶
type Config ¶
type Config struct { // ExchangeKey is a Symmetric key used to seal the messages ExchangeKey string // RoomName is the gossip room where all peers are subscribed to RoomName string // ListenAddresses is the discovery peer initial bootstrap addresses ListenAddresses []discovery.AddrList // Insecure disables secure p2p e2e encrypted communication Insecure bool // Handlers are a list of handlers subscribed to messages received by the vpn interface Handlers []Handler MaxMessageSize int SealKeyInterval int Interface *water.Interface InterfaceName string InterfaceAddress string InterfaceMTU int MTU int DeviceType water.DeviceType ServiceDiscovery []ServiceDiscovery Logger log.StandardLogger SealKeyLength int MaxBlockChainLength int NetLinkBootstrap bool // Handle is a handle consumed by HumanInterfaces to handle received messages Handle func(bool, *hub.Message) StreamHandlers map[protocol.ID]StreamHandler AdditionalOptions, Options []libp2p.Option LedgerSyncronizationTime, LedgerAnnounceTime time.Duration }
type EdgeVPN ¶
func (*EdgeVPN) ConnectToService ¶ added in v0.2.0
func (*EdgeVPN) ExposeService ¶ added in v0.2.0
func (e *EdgeVPN) ExposeService(ledger *blockchain.Ledger, serviceID, dstaddress string)
func (*EdgeVPN) Join ¶ added in v0.1.0
func (e *EdgeVPN) Join(ledger *blockchain.Ledger) error
Join the network with the ledger. It does the minimal action required to be connected without any active packet routing
func (*EdgeVPN) MessageWriter ¶
func (e *EdgeVPN) MessageWriter(opts ...hub.MessageOption) (*MessageWriter, error)
MessageWriter returns a new MessageWriter bound to the edgevpn instance with the given options
func (*EdgeVPN) ReceiveFile ¶ added in v0.2.1
func (*EdgeVPN) SendFile ¶ added in v0.2.1
func (e *EdgeVPN) SendFile(ledger *blockchain.Ledger, fileID, filepath string) error
type MessageWriter ¶
type MessageWriter struct {
// contains filtered or unexported fields
}
func (*MessageWriter) WriteString ¶ added in v0.0.5
func (mw *MessageWriter) WriteString(p string) (n int, err error)
type ServiceDiscovery ¶
type StreamHandler ¶ added in v0.1.0
type YAMLConnectionConfig ¶
type YAMLConnectionConfig struct { OTP OTP `yaml:"otp"` RoomName string `yaml:"room"` Rendezvous string `yaml:"rendezvous"` MDNS string `yaml:"mdns"` }
func GenerateNewConnectionData ¶
func GenerateNewConnectionData() (*YAMLConnectionConfig, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.