Files
overlayfs/overlayfs_fuse.go
Matheus Sampaio Queiroga 4961744ccd
Some checks are pending
Golang test / go-test (windows-latest) (push) Waiting to run
Golang test / go-test (ubuntu-latest) (push) Successful in 35s
Update fuse struct
2025-07-22 13:46:04 -03:00

30 lines
675 B
Go

//go:build windows || darwin || freebsd || netbsd || openbsd
package overlayfs
// Use fuse to emulate overlayfs
import (
"os"
"sirherobrine23.com.br/Sirherobrine23/cgofuse/fs"
)
type internalType = fs.FileSystemMount[*os.File, fs.FileSystem[*os.File]]
// Unmount overlayfs fuse
func (overlay *Overlayfs) Unmount() (err error) {
if overlay.ProcessInternal != nil {
return overlay.ProcessInternal.Unmount()
}
return
}
// Attempt mount overlayfs with fuse
func (overlay *Overlayfs) Mount() (err error) {
if overlay.ProcessInternal != nil {
return ErrMounted
}
overlay.ProcessInternal = fs.New(overlay.Target, overlay)
return overlay.ProcessInternal.Mount()
}