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
2015-03-04 07:34:04 -08:00

28 lines
588 B
Go

package ipns
import (
"os"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/bazil.org/fuse"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs"
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
)
type Link struct {
Target string
}
func (l *Link) Attr() fuse.Attr {
log.Debug("Link attr.")
return fuse.Attr{
Mode: os.ModeSymlink | 0555,
}
}
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)