Documentation ¶
Index ¶
- func CleanPath(name string) string
- type Client
- func (c *Client) Attach(tag uint16, fid, afid uint32, uname, aname string) (lib9p.Qid, error)
- func (c *Client) Auth(tag uint16, afid uint32, uname, aname string) (lib9p.Qid, error)
- func (c *Client) Clunk(tag uint16, fid uint32) error
- func (c *Client) Create(tag uint16, fid uint32, name string, perm lib9p.FileMode, mode lib9p.OpenMode) (lib9p.Qid, uint32, error)
- func (c *Client) Flush(tag, oldtag uint16) error
- func (c *Client) Open(tag uint16, fid uint32, mode lib9p.OpenMode) (qid lib9p.Qid, iounit uint32, err error)
- func (c *Client) Read(tag uint16, fid uint32, offset uint64, count uint32) (data []byte, err error)
- func (c *Client) Remove(tag uint16, fid uint32) error
- func (c *Client) Stat(tag uint16, fid uint32) (*lib9p.Stat, error)
- func (c *Client) Version(tag uint16, msize uint32, version string) (uint32, string, error)
- func (c *Client) Walk(tag uint16, fid, newfid uint32, wnames []string) (wqid []lib9p.Qid, err error)
- func (c *Client) Write(tag uint16, fid uint32, offset uint64, count uint32, data []byte) (uint32, error)
- func (c *Client) Wstat(tag uint16, fid uint32, stat *lib9p.Stat) error
- type FS
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client side of the 9P conversation.
func NewClient ¶
NewClient creates a Client and prepare to transact with a server via r and w. It runs several goroutines to handle requests. And the returned client should be stopped by cancelling ctx afterwards.
func (*Client) Attach ¶
func (*Client) Auth ¶
func (*Client) Create ¶
func (*Client) Open ¶
func (*Client) Read ¶
Read doesn't return io.EOF at the end of file, but returns empty data and nil error.
func (*Client) Version ¶
Version sends Tversion message to the server and returns the resulting data of Rversion or non nil error if any. This function and other Tmessage functions don't have a context.Contex as their argument. The caller can call *Client.Flush to cancel a pending request if the connection to the server is helthy. And even if the connection has some problem sending/recieving, there is no way to cancel blocking reads/writes. In this case, the caller can close the connection.
func (*Client) Walk ¶
func (*Client) Write ¶
type FS ¶ added in v0.5.0
type FS struct {
// contains filtered or unexported fields
}
FS represents the file system the client imports.
func Mount ¶
Mount initiates a 9P session and returns the resulting file system. The 9P session is established by writing to w and reading from r. When fs is not needed anymore, ctx should be canceled to stop the underlying client's goroutines. If non-nil error is returned, underlying client is stopped by this function, and there is no need to cancel ctx.
type File ¶ added in v0.5.0
type File struct {
// contains filtered or unexported fields
}
File is a File for Client.