vfs

package
v0.0.0-...-5596d3b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeekStart   = SeekPoint(0)
	SeekCurrent = SeekPoint(1)
	SeekEnd     = SeekPoint(2)
)

Variables

View Source
var (
	ErrInvalidFid = errors.New("invalid fid")
)

Functions

func DirModeToOSMode

func DirModeToOSMode(dm uint32) (osmode int)

func DirToQid

func DirToQid(dir plan9.Dir) plan9.Qid

func FileInfoToDir

func FileInfoToDir(stat os.FileInfo) (dir plan9.Dir)

func PackError

func PackError(fc *plan9.Fcall, err error) *plan9.Fcall

func Plan9PermToUnix

func Plan9PermToUnix(p uint32) os.FileMode

Types

type Client

type Client struct {
	*client.Conn
}

func ConnectLocal

func ConnectLocal() (*Client, error)

Connect to a local 9p server running on port 5640

type Context

type Context struct {
	// contains filtered or unexported fields
}

func NewContext

func NewContext() *Context

func (*Context) Clear

func (c *Context) Clear()

func (*Context) Delete

func (c *Context) Delete(k interface{}) (interface{}, bool)

func (*Context) Get

func (c *Context) Get(k interface{}) (interface{}, bool)

func (*Context) MustGet

func (c *Context) MustGet(k interface{}) interface{}

func (*Context) Put

func (c *Context) Put(k, v interface{})

type File

type File struct {
	Name string
	// contains filtered or unexported fields
}

func NewFile

func NewFile(name string, content HasContent) *File

func (*File) Add

func (f *File) Add(c *File)

func (*File) Close

func (f *File) Close() error

func (*File) Contents

func (f *File) Contents() (FileContents, error)

func (*File) Open

func (f *File) Open(mode int, perm int) (FileContents, error)

func (*File) Size

func (f *File) Size() (uint64, error)

func (*File) Sync

func (f *File) Sync() error

func (*File) Walk

func (f *File) Walk(name string) *File

type FileContents

type FileContents interface {
	Read([]byte) (int, error)
	Write([]byte) (int, error)
	Seek(int64, SeekPoint) (int64, error)
	Sync() error
	Close() error
}

type Fileserver

type Fileserver struct {
	ServerFS
}

func (*Fileserver) Call

func (fs *Fileserver) Call(fc *plan9.Fcall, ctx *Context) *plan9.Fcall

type HasContent

type HasContent interface {
	Open(mode int, perm int) (FileContents, error)
	Size() (uint64, error)
	Close() error
}

type InMemory

type InMemory struct {
	// contains filtered or unexported fields
}

func (*InMemory) Bytes

func (in *InMemory) Bytes() []byte

func (*InMemory) Close

func (in *InMemory) Close() error

func (*InMemory) Expand

func (in *InMemory) Expand(sz int)

func (*InMemory) Open

func (in *InMemory) Open(mode int, perm int) (FileContents, error)

func (*InMemory) Read

func (in *InMemory) Read(b []byte) (int, error)

func (*InMemory) Seek

func (in *InMemory) Seek(sz int64, sp SeekPoint) (int64, error)

func (*InMemory) Size

func (in *InMemory) Size() (uint64, error)

func (*InMemory) Sync

func (in *InMemory) Sync() error

func (*InMemory) Write

func (in *InMemory) Write(b []byte) (int, error)

type RPC

type RPC interface {
	Call(*plan9.Fcall, *Context) *plan9.Fcall
	ReleaseContext(*Context) error
}

type SeekPoint

type SeekPoint int

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(fs RPC, listener net.Listener) (*Server, error)

func NewTCPServer

func NewTCPServer(fs RPC, bindAddr string) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

type ServerFS

type ServerFS interface {
	Version(*plan9.Fcall, *Context) *plan9.Fcall
	Attach(*plan9.Fcall, *Context) *plan9.Fcall
	Auth(*plan9.Fcall, *Context) *plan9.Fcall
	Clunk(*plan9.Fcall, *Context) *plan9.Fcall
	Flush(*plan9.Fcall, *Context) *plan9.Fcall
	Open(*plan9.Fcall, *Context) *plan9.Fcall
	Create(*plan9.Fcall, *Context) *plan9.Fcall
	Read(*plan9.Fcall, *Context) *plan9.Fcall
	Write(*plan9.Fcall, *Context) *plan9.Fcall
	Remove(*plan9.Fcall, *Context) *plan9.Fcall
	Stat(*plan9.Fcall, *Context) *plan9.Fcall
	Wstat(*plan9.Fcall, *Context) *plan9.Fcall
	Walk(*plan9.Fcall, *Context) *plan9.Fcall

	ValidFid(*plan9.Fcall, *Context) bool
	ReleaseContext(*Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL