Reworked the public interface for mount options.

geesefs-0-30-9
Aaron Jacobs 2015-03-17 15:25:06 +11:00
parent 2d10e03395
commit 5129322fc2
1 changed files with 9 additions and 2 deletions

View File

@ -115,13 +115,20 @@ func (mfs *MountedFileSystem) mountAndServe(
close(mfs.joinStatusAvailable) close(mfs.joinStatusAvailable)
} }
// Optional configuration accepted by Mount.
type MountConfig struct {
}
// Convert to mount options to be passed to package bazilfuse.
func (c *MountConfig) bazilfuseOptions() []bazilfuse.MountOption
// Attempt to mount the supplied file system on the given directory. // Attempt to mount the supplied file system on the given directory.
// mfs.WaitForReady() must be called to find out whether the mount was // mfs.WaitForReady() must be called to find out whether the mount was
// successful. // successful.
func Mount( func Mount(
dir string, dir string,
fs FileSystem, fs FileSystem,
options ...bazilfuse.MountOption) (mfs *MountedFileSystem, err error) { config *MountConfig) (mfs *MountedFileSystem, err error) {
// Create a server object. // Create a server object.
server, err := newServer(fs) server, err := newServer(fs)
if err != nil { if err != nil {
@ -136,7 +143,7 @@ func Mount(
} }
// Mount in the background. // Mount in the background.
go mfs.mountAndServe(server, options) go mfs.mountAndServe(server, config.bazilfuseOptions())
return return
} }