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 4b33cdd0 2015-11-30 stephen.d Read(ctx context.Context, fid Fid, p []byte, offset int64) (n int, err error)
23 4b33cdd0 2015-11-30 stephen.d Write(ctx context.Context, fid Fid, p []byte, offset int64) (n int, err error)
24 4b33cdd0 2015-11-30 stephen.d Open(ctx context.Context, fid Fid, mode Flag) (Qid, uint32, error)
25 4b33cdd0 2015-11-30 stephen.d Create(ctx context.Context, parent Fid, name string, perm uint32, mode Flag) (Qid, uint32, error)
26 4b33cdd0 2015-11-30 stephen.d Stat(ctx context.Context, fid Fid) (Dir, error)
27 4b33cdd0 2015-11-30 stephen.d WStat(ctx context.Context, fid Fid, dir Dir) error
28 4b33cdd0 2015-11-30 stephen.d
29 4b33cdd0 2015-11-30 stephen.d // Version returns the supported version and msize of the session. This
30 4b33cdd0 2015-11-30 stephen.d // can be affected by negotiating or the level of support provided by the
31 4b33cdd0 2015-11-30 stephen.d // session implementation.
32 4b33cdd0 2015-11-30 stephen.d Version() (msize int, version string)
33 4b33cdd0 2015-11-30 stephen.d }