Documentation ¶
Index ¶
- func FuseAttrEq(a *fuse.Attr, b *fuse.Attr) bool
- func ServeRPC(s *Server, rwc io.ReadWriteCloser)
- func SplitPath(name string) (dir, base string)
- type AttrRequest
- type AttrResponse
- type AttributeCache
- func (me *AttributeCache) AddClient(client AttributeCacheClient)
- func (me *AttributeCache) Copy() FileSet
- func (me *AttributeCache) Get(name string) (rep *FileAttr)
- func (me *AttributeCache) GetDir(name string) (rep *FileAttr)
- func (me *AttributeCache) Have(name string) bool
- func (me *AttributeCache) Queue(fs FileSet)
- func (me *AttributeCache) Refresh(prefix string) FileSet
- func (me *AttributeCache) RmClient(client AttributeCacheClient)
- func (me *AttributeCache) Send(client AttributeCacheClient) error
- func (me *AttributeCache) Update(files []*FileAttr)
- func (me *AttributeCache) Verify()
- type AttributeCacheClient
- type Client
- type EncodedAttr
- type FileAttr
- func (me FileAttr) Copy(withdir bool) *FileAttr
- func (me FileAttr) Deletion() bool
- func (me *FileAttr) IsBlock() bool
- func (me *FileAttr) IsChar() bool
- func (me *FileAttr) IsDir() bool
- func (me *FileAttr) IsFifo() bool
- func (me *FileAttr) IsRegular() bool
- func (me *FileAttr) IsSocket() bool
- func (me *FileAttr) IsSymlink() bool
- func (me FileAttr) LongString() string
- func (me *FileAttr) Merge(r FileAttr)
- func (me *FileAttr) ReadFromFs(p string, hashFunc crypto.Hash)
- func (me FileAttr) Status() fuse.Status
- func (me FileAttr) String() string
- func (a *FileAttr) WriteXAttr(p string)
- type FileMode
- type FileSet
- type FileSetWaiter
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeRPC ¶
func ServeRPC(s *Server, rwc io.ReadWriteCloser)
ServeRPC starts an RPC server on rwc. It should typically be used in a goroutine.
Types ¶
type AttrRequest ¶
type AttrResponse ¶
type AttrResponse struct {
Attrs []*FileAttr
}
type AttributeCache ¶
type AttributeCache struct { Paranoia bool // contains filtered or unexported fields }
A in-memory cache of attributes.
Invariants: for all entries, we have their parent directories too
func NewAttributeCache ¶
func NewAttributeCache(getter func(n string) *FileAttr, statter func(n string) *fuse.Attr) *AttributeCache
NewAttributeCache creates a new AttrCache. Its arguments are a function to fetch attributes remotely (for individual attributes), and a stat function (for bulk refreshing data).
func (*AttributeCache) AddClient ¶
func (me *AttributeCache) AddClient(client AttributeCacheClient)
func (*AttributeCache) Copy ¶
func (me *AttributeCache) Copy() FileSet
func (*AttributeCache) Get ¶
func (me *AttributeCache) Get(name string) (rep *FileAttr)
func (*AttributeCache) GetDir ¶
func (me *AttributeCache) GetDir(name string) (rep *FileAttr)
func (*AttributeCache) Have ¶
func (me *AttributeCache) Have(name string) bool
func (*AttributeCache) Queue ¶
func (me *AttributeCache) Queue(fs FileSet)
func (*AttributeCache) Refresh ¶
func (me *AttributeCache) Refresh(prefix string) FileSet
func (*AttributeCache) RmClient ¶
func (me *AttributeCache) RmClient(client AttributeCacheClient)
func (*AttributeCache) Send ¶
func (me *AttributeCache) Send(client AttributeCacheClient) error
func (*AttributeCache) Update ¶
func (me *AttributeCache) Update(files []*FileAttr)
func (*AttributeCache) Verify ¶
func (me *AttributeCache) Verify()
type AttributeCacheClient ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an RPC client for a remote AttrCache.
type EncodedAttr ¶
EncodedAttr is the key that we use for file content equality. It is smaller than syscall.Stat_t and similar structures so it can be efficiently stored as extended attribute.
func (*EncodedAttr) Decode ¶
func (e *EncodedAttr) Decode(in []byte) (hash []byte)
func (*EncodedAttr) Encode ¶
func (e *EncodedAttr) Encode(h string) []byte
func (*EncodedAttr) Eq ¶
func (e *EncodedAttr) Eq(b *EncodedAttr) bool
func (*EncodedAttr) FromAttr ¶
func (e *EncodedAttr) FromAttr(a *fuse.Attr)
func (*EncodedAttr) ReadXAttr ¶
func (e *EncodedAttr) ReadXAttr(path string) (hash []byte)
type FileAttr ¶
type FileAttr struct { // Full path of the file Path string // Attr holds the FUSE attributes *fuse.Attr // Hash holds the cryptographic has of the file, in case of a // normal file. Hash string // Link holds the link target in case of a symlink. Link string // Only filled for directories. NameModeMap map[string]FileMode }
func (FileAttr) LongString ¶
func (*FileAttr) WriteXAttr ¶
type FileSetWaiter ¶
func NewFileSetWaiter ¶
func NewFileSetWaiter(proc func(FileSet) error) *FileSetWaiter
func (*FileSetWaiter) Prepare ¶
func (me *FileSetWaiter) Prepare(id int)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(a *AttributeCache, timings *stats.TimerStats) *Server
NewServer instantiates an RPC server for the given AttributeCache. If timings is optional and will be used for recording timing data.
func (*Server) GetAttr ¶
func (s *Server) GetAttr(req *AttrRequest, rep *AttrResponse) error
GetAttr is an RPC entry point. The name in AttrRequest should be absolute