Blame


1 4b33cdd0 2015-11-30 stephen.d package p9p
2 4b33cdd0 2015-11-30 stephen.d
3 529e2b2e 2016-11-14 noreply import "context"
4 4b33cdd0 2015-11-30 stephen.d
5 4b33cdd0 2015-11-30 stephen.d // Session provides the central abstraction for a 9p connection. Clients
6 4b33cdd0 2015-11-30 stephen.d // implement sessions and servers serve sessions. Sessions can be proxied by
7 4b33cdd0 2015-11-30 stephen.d // serving up a client session.
8 4b33cdd0 2015-11-30 stephen.d //
9 4b33cdd0 2015-11-30 stephen.d // The interface is also wired up with full context support to manage timeouts
10 4b33cdd0 2015-11-30 stephen.d // and resource clean up.
11 4b33cdd0 2015-11-30 stephen.d //
12 4b33cdd0 2015-11-30 stephen.d // Session represents the operations covered in section 5 of the plan 9 manual
13 4b33cdd0 2015-11-30 stephen.d // (http://man.cat-v.org/plan_9/5/). Requests are managed internally, so the
14 4b33cdd0 2015-11-30 stephen.d // Flush method is handled by the internal implementation. Consider preceeding
15 4b33cdd0 2015-11-30 stephen.d // these all with context to control request timeout.
16 4b33cdd0 2015-11-30 stephen.d type Session interface {
17 4b33cdd0 2015-11-30 stephen.d Auth(ctx context.Context, afid Fid, uname, aname string) (Qid, error)
18 4b33cdd0 2015-11-30 stephen.d Attach(ctx context.Context, fid, afid Fid, uname, aname string) (Qid, error)
19 4b33cdd0 2015-11-30 stephen.d Clunk(ctx context.Context, fid Fid) error
20 4b33cdd0 2015-11-30 stephen.d Remove(ctx context.Context, fid Fid) error
21 4b33cdd0 2015-11-30 stephen.d Walk(ctx context.Context, fid Fid, newfid Fid, names ...string) ([]Qid, error)
22 c74282f8 2016-11-16 noreply
23 c74282f8 2016-11-16 noreply // Read follows the semantics of io.ReaderAt.ReadAtt method except it takes
24 c74282f8 2016-11-16 noreply // a contxt and Fid.
25 4b33cdd0 2015-11-30 stephen.d Read(ctx context.Context, fid Fid, p []byte, offset int64) (n int, err error)
26 c74282f8 2016-11-16 noreply
27 c74282f8 2016-11-16 noreply // Write follows the semantics of io.WriterAt.WriteAt except takes a context and an Fid.
28 c74282f8 2016-11-16 noreply //
29 c74282f8 2016-11-16 noreply // If n == len(p), no error is returned.
30 c74282f8 2016-11-16 noreply // If n < len(p), io.ErrShortWrite will be returned.
31 4b33cdd0 2015-11-30 stephen.d Write(ctx context.Context, fid Fid, p []byte, offset int64) (n int, err error)
32 c74282f8 2016-11-16 noreply
33 4b33cdd0 2015-11-30 stephen.d Open(ctx context.Context, fid Fid, mode Flag) (Qid, uint32, error)
34 4b33cdd0 2015-11-30 stephen.d Create(ctx context.Context, parent Fid, name string, perm uint32, mode Flag) (Qid, uint32, error)
35 4b33cdd0 2015-11-30 stephen.d Stat(ctx context.Context, fid Fid) (Dir, error)
36 4b33cdd0 2015-11-30 stephen.d WStat(ctx context.Context, fid Fid, dir Dir) error
37 4b33cdd0 2015-11-30 stephen.d
38 4b33cdd0 2015-11-30 stephen.d // Version returns the supported version and msize of the session. This
39 4b33cdd0 2015-11-30 stephen.d // can be affected by negotiating or the level of support provided by the
40 4b33cdd0 2015-11-30 stephen.d // session implementation.
41 4b33cdd0 2015-11-30 stephen.d Version() (msize int, version string)
42 4b33cdd0 2015-11-30 stephen.d }