ndn6file

package
v0.0.0-...-40bead5 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: NIST-PD-fallback Imports: 11 Imported by: 0

Documentation

Overview

Package ndn6file implements ndn6-file-server protocol. https://github.com/yoursunny/ndn6-tools/blob/main/file-server.md

Index

Constants

View Source
const (
	TtSegmentSize = 0xF500
	TtSize        = 0xF502
	TtMode        = 0xF504
	TtAtime       = 0xF506
	TtBtime       = 0xF508
	TtCtime       = 0xF50A
	TtMtime       = 0xF50C
)

Assigned numbers.

Variables

KeywordLs is the 32=ls component.

Functions

This section is empty.

Types

type DirectoryListing

type DirectoryListing []fs.DirEntry

DirectoryListing contains a list of files and directories in a directory.

func (DirectoryListing) MarshalBinary

func (ls DirectoryListing) MarshalBinary() (value []byte, e error)

MarshalBinary encodes to segmented object payload.

func (DirectoryListing) String

func (ls DirectoryListing) String() string

func (*DirectoryListing) UnmarshalBinary

func (ls *DirectoryListing) UnmarshalBinary(value []byte) (e error)

UnmarshalBinary decodes from segmented object payload.

type Metadata

type Metadata struct {
	rdr.Metadata
	FinalBlock  ndn.NameComponent
	SegmentSize int
	Size        int64
	Mode        uint16
	Atime       time.Time
	Btime       time.Time
	Ctime       time.Time
	Mtime       time.Time
}

Metadata represents RDR metadata packet with file server extensions.

func (Metadata) IsDir

func (m Metadata) IsDir() bool

IsDir determines whether Mode indicates a directory.

func (Metadata) IsFile

func (m Metadata) IsFile() bool

IsFile determines whether Mode indicates a regular file.

func (Metadata) MarshalBinary

func (m Metadata) MarshalBinary() (value []byte, e error)

MarshalBinary encodes to TLV-VALUE.

func (Metadata) SegmentEnd

func (m Metadata) SegmentEnd() uint64

SegmentEnd returns the last segment number plus one. If FinalBlock is unset, returns zero.

func (*Metadata) UnmarshalBinary

func (m *Metadata) UnmarshalBinary(value []byte) error

UnmarshalBinary decodes from TLV-VALUE.

Jump to

Keyboard shortcuts

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