Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
e1375f33
Commit
e1375f33
authored
Mar 20, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NewFileSystem
parent
2fe7597c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
samples/flushfs/flush_fs.go
samples/flushfs/flush_fs.go
+12
-2
samples/flushfs/flush_fs_test.go
samples/flushfs/flush_fs_test.go
+10
-1
No files found.
samples/flushfs/flush_fs.go
View file @
e1375f33
...
...
@@ -14,7 +14,10 @@
package
flushfs
import
"github.com/jacobsa/fuse"
import
(
"github.com/jacobsa/fuse"
"github.com/jacobsa/fuse/fuseutil"
)
// Create a file system containing a single file named "foo".
//
...
...
@@ -23,4 +26,11 @@ import "github.com/jacobsa/fuse"
// called with the current contents of the file.
func
NewFileSystem
(
reportFlush
func
(
string
),
reportFsync
func
(
string
))
(
fs
fuse
.
FileSystem
,
err
error
)
reportFsync
func
(
string
))
(
fs
fuse
.
FileSystem
,
err
error
)
{
fs
=
&
flushFS
{}
return
}
type
flushFS
struct
{
fuseutil
.
NotImplementedFileSystem
}
samples/flushfs/flush_fs_test.go
View file @
e1375f33
...
...
@@ -44,6 +44,8 @@ type FlushFSTest struct {
func
init
()
{
RegisterTestSuite
(
&
FlushFSTest
{})
}
func
(
t
*
FlushFSTest
)
SetUp
(
ti
*
TestInfo
)
{
var
err
error
// Set up a file system.
reportTo
:=
func
(
slice
*
[]
string
)
func
(
string
)
{
return
func
(
s
string
)
{
...
...
@@ -53,9 +55,16 @@ func (t *FlushFSTest) SetUp(ti *TestInfo) {
}
}
t
.
FileSystem
=
flushfs
.
NewFileSystem
(
t
.
FileSystem
,
err
=
flushfs
.
NewFileSystem
(
reportTo
(
&
t
.
flushes
),
reportTo
(
&
t
.
fsyncs
))
if
err
!=
nil
{
panic
(
err
)
}
// Mount it.
t
.
SampleTest
.
SetUp
(
ti
)
}
////////////////////////////////////////////////////////////////////////
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment