Documentation
¶
Index ¶
Constants ¶
View Source
const (
// BlockSize - max length of an encoding symbol that can fit into a single wire packet.
BlockSize = maxUDPLength - 8 - 2 - 2 - 4 - 4
)
Variables ¶
View Source
var ( // ErrTooLargeUDP packet cannot fit into default MTU of 1500. ErrTooLargeUDP = errors.New("packet cannot fit into default MTU of 1500") )
Functions ¶
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is based on fountain.newRaptorDecoder.
func NewDecoder ¶
NewDecoder creates a wrapper decoder of fountain.Decoder.
type Encoder ¶
type Encoder struct {
SymbolAlignmentSize uint16
// output parameters.
PaddingSize uint16
NumSourceSymbols int
// contains filtered or unexported fields
}
Encoder is wrapper around Raptor RFC5053 from gofountain.EncodeLTBlocks.
func NewEncoder ¶
func NewEncoder(message []byte, maxPacketSize uint16, redundancyFactor uint8, symbolAlignmentSize uint16) (*Encoder, error)
NewEncoder creates a Raptor RFC5053 wrapper.
func (*Encoder) GenerateBlocks ¶
GenerateBlocks encodes raptor codes. NB: This method is destructive to the w.message array.
func (*Encoder) TransferLength ¶
TransferLength is the number of message plus calculated padding.
type MessageCollector ¶
MessageCollector callback to be run on a newly decoded message.
type Packet ¶
type Packet struct {
NumSourceSymbols uint16
PaddingSize uint16
// contains filtered or unexported fields
}
Packet is the UDP packet that consists of encoding symbol data unit and raptor-specific data.
type UDPReader ¶
type UDPReader struct {
// contains filtered or unexported fields
}
UDPReader that supports decoding Raptor codes packets.
func NewUDPReader ¶
func NewUDPReader(lAddr *net.UDPAddr, h MessageCollector) (*UDPReader, error)
NewUDPReader instantiate a UDP reader of raptor code packets.
Click to show internal directories.
Click to hide internal directories.