ninep

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: BSD-3-Clause, MIT Imports: 2 Imported by: 1

Documentation

Overview

Package ninep contains helper routines for implementing a 9P2000 protocol server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirRead

func DirRead(ofcall, ifcall *plan9.Fcall, gen func(i int) *plan9.Dir) int

DirRead sets ofcall.Data to at most ifcall.Count bytes of directory entries read from offset ifcall.Offset. The function gen is called to obtain the n-th directory entry. Gen should return nil on end of directory. DirRead returns the number of directory entries read. This function is similar to dirread9p(3) in lib9p.

func ReadBuffer

func ReadBuffer(ofcall, ifcall *plan9.Fcall, src []byte)

ReadBuffer sets Count and Data in response ofcall based the request ifcall and full data src. The Data is set to a sub-slice of src and the Count is set to the length of the sub-slice. This function is similar to readbuf(3) in lib9p.

func ReadString

func ReadString(ofcall, ifcall *plan9.Fcall, src string)

ReadString is the same as ReadBuffer but for a string src. It trims src info blocks without respecting utf8 boundaries, as it's generally the reader's responsibility to do more reads to get full runes. This function is similar to readstr(3) in lib9p.

func UnmarshalDirs

func UnmarshalDirs(b []byte) ([]plan9.Dir, error)

UnmarshalDirs decodes and returns one or more directory entries in b. This function exists because plan9.UnmarshalDir cannot deal with multiple entries.

Types

This section is empty.

Jump to

Keyboard shortcuts

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