block

package
v0.0.0-...-07164a9 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const BlockSize = 512
View Source
const PayloadMaxSize = 500

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Type    BlockType
	ID      uint32
	Payload []byte
}

func NewBlock

func NewBlock(payload []byte, id uint32, typ BlockType) *Block

func NewBlockFromBytes

func NewBlockFromBytes(buf []byte) (*Block, error)

func (*Block) ToBytes

func (b *Block) ToBytes() []byte

type BlockType

type BlockType uint8
const (
	TypeData BlockType = iota
	TypeKeepalive
)

Jump to

Keyboard shortcuts

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