aw

package module
v0.4.0-6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 11 Imported by: 0

README

🌪 airwave

GoDoc Go Report Coverage Status

A flexible P2P networking library for upgradable distributed systems. The core mission of airwave is to provide a simple P2P interface that can support a wide variety of different algorithms, with a focus on backwards compatible. The P2P interface supports:

  • Peer discovery
  • Handshake
  • Casting (send to one)
  • Multicasting (send to many)
  • Broadcasting (send to everyone)
Handshake

Airwave uses a 3 way sync handshake method to authorize peers in the network. The process is as follows:

The client sends a signed rsa public key on connect. The server validates the signature, generates a random challenge, and sends the signed random challenge encrypted with the client's public key; and the server's public key. The client validates the server's signature decrypts the challenge encrypts it with the server's publickey, signs it and sends it back.

Built with ❤ by Ren.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder added in v0.4.0

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

func New

func New() *Builder

func (*Builder) Build added in v0.4.0

func (builder *Builder) Build() *Node

func (*Builder) WithAddr added in v0.4.0

func (builder *Builder) WithAddr(addr wire.Address) *Builder

func (*Builder) WithContentResolver

func (builder *Builder) WithContentResolver(contentResolver dht.ContentResolver) *Builder

func (*Builder) WithHost added in v0.4.0

func (builder *Builder) WithHost(host string) *Builder

func (*Builder) WithPort added in v0.4.0

func (builder *Builder) WithPort(port uint16) *Builder

func (*Builder) WithPrivKey added in v0.4.0

func (builder *Builder) WithPrivKey(privKey *id.PrivKey) *Builder

type ContentResolver

type ContentResolver = dht.ContentResolver

type Node added in v0.4.0

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

func (*Node) Addr added in v0.4.0

func (node *Node) Addr() wire.Address

func (*Node) Broadcast added in v0.4.0

func (node *Node) Broadcast(ctx context.Context, subnet id.Hash, dataType uint8, data []byte)

func (*Node) DHT added in v0.4.0

func (node *Node) DHT() dht.DHT

func (*Node) Gossiper added in v0.4.0

func (node *Node) Gossiper() *gossip.Gossiper

func (*Node) Identity added in v0.4.0

func (node *Node) Identity() id.Signatory

func (*Node) Peer added in v0.4.0

func (node *Node) Peer() *peer.Peer

func (*Node) Run added in v0.4.0

func (node *Node) Run(ctx context.Context)

func (*Node) Send added in v0.4.0

func (node *Node) Send(ctx context.Context, signatory id.Signatory, dataType uint8, data []byte)

func (*Node) Sync

func (node *Node) Sync(ctx context.Context, subnet, hash id.Hash, dataType uint8) ([]byte, error)

func (*Node) Transport added in v0.4.0

func (node *Node) Transport() *transport.Transport

type Options added in v0.4.0

type Options struct {
	Logger *zap.Logger
}

func DefaultOptions added in v0.4.0

func DefaultOptions() Options

func (Options) WithLogger added in v0.4.0

func (opts Options) WithLogger(logger *zap.Logger) Options

Directories

Path Synopsis
dht

Jump to

Keyboard shortcuts

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