transport

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package transport contains transport related logic for MVDS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelTransport

type ChannelTransport struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ChannelTransport implements a basic MVDS transport using channels for basic testing purposes.

func NewChannelTransport

func NewChannelTransport(offline int, in <-chan Packet) *ChannelTransport

func (*ChannelTransport) AddOutput

func (t *ChannelTransport) AddOutput(id state.PeerID, c chan<- Packet)

func (*ChannelTransport) Send

func (t *ChannelTransport) Send(sender state.PeerID, peer state.PeerID, payload protobuf.Payload) error

func (*ChannelTransport) Watch

func (t *ChannelTransport) Watch() Packet

type Packet

type Packet struct {
	Sender  state.PeerID
	Payload protobuf.Payload
}

type Transport

type Transport interface {
	Watch() Packet
	Send(sender state.PeerID, peer state.PeerID, payload protobuf.Payload) error
}

Transport defines an interface allowing for agnostic transport implementations.

Jump to

Keyboard shortcuts

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