handshake

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AckType = "/handshake.ack"
)
View Source
const (
	SynAckType = "/handshake.syn-ack"
)
View Source
const (
	SynType = "/handshake.syn"
)

Variables

This section is empty.

Functions

func New

func New(local *peer.LocalPeer, discoverer discovery.Discoverer) net.Middleware

NewHandshake ...

Types

type Ack

type Ack struct {
	Nonce     string            `json:"nonce:s"`
	Signature *crypto.Signature `json:"@signature:o"`
}

func (*Ack) FromObject

func (s *Ack) FromObject(o object.Object) error

FromObject populates the struct from a f12n object

func (Ack) GetType

func (s Ack) GetType() string

GetType returns the object's type

func (Ack) ToObject

func (s Ack) ToObject() object.Object

ToObject returns a f12n object

type Handshake

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

Handshake ..

func (*Handshake) Handle

func (hs *Handshake) Handle() net.MiddlewareHandler

TODO needs to be able to handle both server and client interactions

type Syn

type Syn struct {
	Nonce string     `json:"nonce:s"`
	Peer  *peer.Peer `json:"peer:o,omitempty"`
}

func (*Syn) FromObject

func (s *Syn) FromObject(o object.Object) error

FromObject populates the struct from a f12n object

func (Syn) GetType

func (s Syn) GetType() string

GetType returns the object's type

func (Syn) ToObject

func (s Syn) ToObject() object.Object

ToObject returns a f12n object

type SynAck

type SynAck struct {
	Nonce     string            `json:"nonce:s"`
	Peer      *peer.Peer        `json:"peer:o,omitempty"`
	Signature *crypto.Signature `json:"@signature:o"`
}

HandshakeSynAck is the response in the second leg of our net handshake

func (*SynAck) FromObject

func (s *SynAck) FromObject(o object.Object) error

FromObject populates the struct from a f12n object

func (SynAck) GetType

func (s SynAck) GetType() string

GetType returns the object's type

func (SynAck) ToObject

func (s SynAck) ToObject() object.Object

ToObject returns a f12n object

Jump to

Keyboard shortcuts

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