fileMessage

package
v4.7.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: BSD-2-Clause, BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PartMessage

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

PartMessage contains part of the data being transferred and 256-bit nonce that is used as a nonce.

func NewPartMessage

func NewPartMessage(externalPayloadSize int) PartMessage

NewPartMessage generates a new part message that fits into the specified external payload size. An error is returned if the external payload size is too small to fit the part message.

func UnmarshalPartMessage

func UnmarshalPartMessage(b []byte) (PartMessage, error)

UnmarshalPartMessage converts the bytes into a PartMessage. An error is returned if the size of the data is too small for a PartMessage.

func (PartMessage) GetPart

func (m PartMessage) GetPart() []byte

GetPart returns the file part data from the message.

func (PartMessage) GetPartNum

func (m PartMessage) GetPartNum() uint16

GetPartNum returns the file part number.

func (PartMessage) GetPartSize

func (m PartMessage) GetPartSize() int

GetPartSize returns the number of bytes available to store part data.

func (PartMessage) Marshal

func (m PartMessage) Marshal() []byte

Marshal returns the byte representation of the PartMessage.

func (PartMessage) SetPart

func (m PartMessage) SetPart(b []byte)

SetPart sets the PartMessage part to the given bytes. An error is returned if the size of the provided part data is too large to store.

func (PartMessage) SetPartNum

func (m PartMessage) SetPartNum(num uint16)

SetPartNum sets the file part number.

Jump to

Keyboard shortcuts

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