lib9p

Go 9P library.
Log | Files | Refs | LICENSE

commit 8a1874c1406a36c8064378df09840e875c259ee3
parent 3e1f5fa69227a0154cc40bb035df30ecf13c0490
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Thu,  2 Nov 2023 08:27:49 +0900

add comment

Diffstat:
Miofs/fs.go | 2++
Mserver.go | 5+++--
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/iofs/fs.go b/iofs/fs.go @@ -14,6 +14,8 @@ type FS struct { qidPool *QidPool } +// NewFS converts the fs.FS to FS +// It can then be used as the lib9p.FS argument for lib9p.NewServer. func NewFS(fsys fs.FS) *FS { fs := &FS{ fs: fsys, diff --git a/server.go b/server.go @@ -53,18 +53,19 @@ type Server struct { // listener goroutine. listenChan <-chan *Req // r is the io.Reader which the listener goroutine reads from. + // It should be accessed only by the listener goroutine. r io.Reader // The channel to which outgoing replies are sent to the speaker // goroutine. speakChan chan<- *Req // w is the io.Writer which the speaker goroutine writes to. + // It should be accessed only by the speaker goroutine. w io.Writer // Auth is called when Tauth message arrives. // If authentication is desired, the Auth functions should - // set Req.Afid.Qid and Req.ofcall.Qid. - // TODO: export Req.ofcall. + // set Req.Afid.Qid and Req.Ofcall.Qid. // If this is nil, no authentication is performed. Auth func(context.Context, *Req) }