-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
quarantine.go
43 lines (35 loc) · 1.1 KB
/
quarantine.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2018 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.
//
//go:build !windows
// +build !windows
package libfuse
import (
"bazil.org/fuse"
"bazil.org/fuse/fs"
"golang.org/x/net/context"
)
// XattrHandler is an interface that includes fuse Get/Set/Remove calls for
// xattr.
type XattrHandler interface {
fs.NodeGetxattrer
fs.NodeSetxattrer
fs.NodeRemovexattrer
}
// NoXattrHandler is a Xattr handler that always returns fuse.ENOTSUP.
type NoXattrHandler struct{}
var _ XattrHandler = NoXattrHandler{}
// Getxattr implements the fs.NodeGetxattrer interface.
func (h NoXattrHandler) Getxattr(context.Context,
*fuse.GetxattrRequest, *fuse.GetxattrResponse) error {
return fuse.ENOTSUP
}
// Setxattr implements the fs.NodeSetxattrer interface.
func (h NoXattrHandler) Setxattr(context.Context, *fuse.SetxattrRequest) error {
return fuse.ENOTSUP
}
// Removexattr implements the fs.NodeRemovexattrer interface.
func (h NoXattrHandler) Removexattr(context.Context, *fuse.RemovexattrRequest) error {
return fuse.ENOTSUP
}