~moody/ninep

7b4c0484154111591a670ce6807bfbda3e864f36 — Jacob Moody a month ago 3f31f08
More docs touchup
link to pkg.go.dev, godocs does not display examples correctly.
2 files changed, 9 insertions(+), 12 deletions(-)

M README.md
M fs.go
M README.md => README.md +2 -2
@@ 1,6 1,6 @@
[![godocs.io](https://godocs.io/git.sr.ht/~moody/ninep?status.svg)](https://godocs.io/git.sr.ht/~moody/ninep)
[![Go Reference](https://pkg.go.dev/badge/git.sr.ht/~moody/ninep.svg)](https://pkg.go.dev/git.sr.ht/~moody/ninep)

Ninep is a go library for writing 9p2000 servers. It is heavily influenced by the design of the plan9 lib9p C library.
The godocs link has some examples and more specific details for library usage.
The go.dev link has some examples and more specific details for library usage.

It is reccomended to have some familiarity with 9p itself. The best resource to learn what the server is responsible for is reading through [section 5 of the manual](http://man.cat-v.org/9front/5/).

M fs.go => fs.go +7 -10
@@ 11,10 11,9 @@ import "errors"
//instead.
type FS interface {
	//Attach is the first message sent on a session, for which
	//the root Qid should be returned. Attach and Walk are the
	//only functions for which new Qid structs are allocated
	//by the server.
	//the root Qid should be returned.
	Attach(t *Tattach)

	//Walk is called multiple times for a single Twalk request,
	//once for each walk elemenent within the message. For each
	//call cur is set to the directory from which the walk is


@@ 24,18 23,16 @@ type FS interface {
	//or nil if the file does not exist.
	Walk(cur *Qid, next string) *Qid

	//The Qid passed to Create and Open both represent
	//the directory for which the request is operating in.
	//As a point of convention IOUnit should typcially be
	//8192, the size of a plan9 cat(1) buffer.
	//The Qid passed to create is the directory for which
	//the new file is to be created in.
	Create(t *Tcreate, q *Qid)
	Open(t *Topen, q *Qid)

	//For Read, Write, Stat, Wstat, and Remove. The Qid passed
	//represents the specific file the client which to operate on.
	//For Open, Read, Write, Stat, Wstat, and Remove. The Qid passed
	//represents the specific file the client wishes to operate on.
	//Read is also the message called for listing files within
	//a directory, a helper function ReadDir is included for
	//this case.
	Open(t *Topen, q *Qid)
	Read(t *Tread, q *Qid)
	Write(t *Twrite, q *Qid)
	Stat(t *Tstat, q *Qid)