mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-24 20:07:45 +08:00
fuse: Attr() now has a Context parameter and error return value
~GOPATH/src/bazil.org/fuse:master$ git shortlog 48c34fb7780b88aca1696bf865508f6703aa47f1..e4fcc9a2c7567d1c42861deebeb483315d222262
Tommi Virtanen (8):
Remove dead code
Make saveLookup take Context, return error
Make serveNode.attr take Context, return error
Make nodeAttr take Context, return error
API change: Move attribute validity time inside Attr
Set attribute validity default time in one place
API change: Attr method takes Context, returns error
Set LookupResponse validity times up front, instead of after the handler
31 lines
640 B
Go
31 lines
640 B
Go
// +build !nofuse
|
|
|
|
package ipns
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse"
|
|
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs"
|
|
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
|
)
|
|
|
|
type Link struct {
|
|
Target string
|
|
}
|
|
|
|
func (l *Link) Attr(ctx context.Context, a *fuse.Attr) error {
|
|
log.Debug("Link attr.")
|
|
*a = fuse.Attr{
|
|
Mode: os.ModeSymlink | 0555,
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (l *Link) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (string, error) {
|
|
log.Debugf("ReadLink: %s", l.Target)
|
|
return l.Target, nil
|
|
}
|
|
|
|
var _ fs.NodeReadlinker = (*Link)(nil)
|