1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 05:52:20 +08:00
Files
kubo/fuse/ipns/link_unix.go
Henry e9074beb6d godeps: update bazil.org/fuse
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
2015-05-30 01:07:14 +02:00

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)