Documentation ¶
Index ¶
- type Client
- type Fid
- func (f *Fid) Close() error
- func (f *Fid) Create(name string, flags int, perm os.FileMode) error
- func (f *Fid) Link(oldname, newname string) error
- func (f *Fid) Mkdir(name string, perm os.FileMode) error
- func (f *Fid) Mknod(name string, perm os.FileMode, major, minor uint32) error
- func (f *Fid) Num() uint32
- func (f *Fid) Open(flags int) error
- func (f *Fid) ReadAt(p []byte, offset int64) (int, error)
- func (f *Fid) ReadLink(name string) (string, error)
- func (f *Fid) Remove() error
- func (f *Fid) Rename(oldpath, newpath string) error
- func (f *Fid) Stat() (os.FileInfo, error)
- func (f *Fid) Sync() error
- func (f *Fid) Walk(names ...string) (*Fid, error)
- func (f *Fid) WriteAt(p []byte, offset int64) (int, error)
- type Option
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a 9P2000.L client. There may be multiple outstanding calls associated with a single client, and a client may be used by multiple goroutines simultaneously.
func Dial ¶
Dial connects to an 9P2000.L server at the specified network address.
The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context will not affect the connection.
func NewClient ¶
func NewClient(rwc io.ReadWriteCloser, opts ...Option) (*Client, error)
NewClient returns a new client to handle requests to the set of services at the other end of the connection.
func (*Client) Attach ¶
Attach introduces a new user to the server, and establishes Fid as the root for that user on the file tree selected by export.
func (*Client) Auth ¶
Auth initiates an authentication handshake for the given user and root path. An error is returned if authentication is not required. If successful, the returned afid is used to read/write the authentication handshake (protocol does not specify what is read/written), and afid is presented in the attach.
type Fid ¶
type Fid struct {
// contains filtered or unexported fields
}
Fid structures are intended to represent a remote file descriptor in a 9P connection
func (*Fid) Close ¶
Close informs the file server that the current file represented by fid is no longer needed by the client.
func (*Fid) Create ¶
Create asks the file server to create a new file with the name supplied, in the directory represented by fid, and requires write permission in the directory.
Finally, the newly created file is opened according to perm, and fid will represent the newly opened file.
func (*Fid) Mkdir ¶
Mkdir asks the file server to create a new directory with the name supplied, in the directory represented by fid, and requires write permission in the directory.
func (*Fid) Open ¶
Open opens the file represented by fid with specified flags (os.O_RDONLY etc.). If successful, it can be used for I/O.
func (*Fid) Remove ¶
Remove asks the file server both to remove the file represented by fid and to close the fid, even if the remove fails. This request will fail if the client does not have write permission in the parent directory.
It is correct to consider remove to be a clunk with the side effect of removing the file if permissions allow.
type Option ¶
type Option func(interface{}) error
Option sets Server or Client options such as logging, max message size etc.
func WithMaxMessageSize ¶
Directories ¶
Path | Synopsis |
---|---|
Package binary implements little-endian translation between 9P types and byte sequences.
|
Package binary implements little-endian translation between 9P types and byte sequences. |
Package proto provides the definitions and functions used to implement the 9P protocol.
|
Package proto provides the definitions and functions used to implement the 9P protocol. |