fs: more vss related unexports

This commit is contained in:
Michael Eischer
2026-06-06 22:53:47 +02:00
parent d3ef21f870
commit 3eb5f83db3
3 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -44,8 +44,8 @@ type ErrorHandler func(item string, err error)
// MessageHandler is used to report errors/messages via callbacks.
type MessageHandler func(msg string, args ...interface{})
// VolumeFilter is used to filter volumes by their mount point or GUID path.
type VolumeFilter func(volume string) bool
// volumeFilter is used to filter volumes by their mount point or GUID path.
type volumeFilter func(volume string) bool
// LocalVss is a wrapper around the local file system which uses windows volume
// shadow copy service (VSS) in a transparent way.
@@ -185,7 +185,7 @@ func (fs *LocalVss) snapshotPath(path string) string {
} else {
fs.msgMessage("creating VSS snapshot for [%s]\n", vssVolume)
var includeVolume VolumeFilter
var includeVolume volumeFilter
if !fs.excludeAllMountPoints {
includeVolume = func(volume string) bool {
return fs.isMountPointIncluded(volume)
+6 -6
View File
@@ -8,23 +8,23 @@ import (
"github.com/restic/restic/internal/errors"
)
// MountPoint is a dummy for non-windows platforms to let client code compile.
type MountPoint struct {
// mountPoint is a dummy for non-windows platforms to let client code compile.
type mountPoint struct {
}
// IsSnapshotted is true if this mount point was snapshotted successfully.
func (p *MountPoint) IsSnapshotted() bool {
func (p *mountPoint) IsSnapshotted() bool {
return false
}
// GetSnapshotDeviceObject returns root path to access the snapshot files and folders.
func (p *MountPoint) GetSnapshotDeviceObject() string {
func (p *mountPoint) GetSnapshotDeviceObject() string {
return ""
}
// vssSnapshot is a dummy for non-windows platforms to let client code compile.
type vssSnapshot struct {
mountPointInfo map[string]MountPoint
mountPointInfo map[string]mountPoint
}
// HasSufficientPrivilegesForVSS returns nil if the user is allowed to use VSS.
@@ -41,7 +41,7 @@ func getVolumeNameForVolumeMountPoint(mountPoint string) (string, error) {
// newVssSnapshot creates a new vss snapshot. If creating the snapshots doesn't
// finish within the timeout an error is returned.
func newVssSnapshot(_ string,
_ string, _ time.Duration, _ VolumeFilter, _ ErrorHandler) (vssSnapshot, error) {
_ string, _ time.Duration, _ volumeFilter, _ ErrorHandler) (vssSnapshot, error) {
return vssSnapshot{}, errors.New("VSS snapshots are only supported on windows")
}
+1 -1
View File
@@ -886,7 +886,7 @@ func getVolumeNameForVolumeMountPoint(mountPoint string) (string, error) {
// newVssSnapshot creates a new vss snapshot. If creating the snapshots doesn't
// finish within the timeout an error is returned.
func newVssSnapshot(provider string,
volume string, timeout time.Duration, filter VolumeFilter, msgError ErrorHandler) (vssSnapshot, error) {
volume string, timeout time.Duration, filter volumeFilter, msgError ErrorHandler) (vssSnapshot, error) {
is64Bit, err := isRunningOn64BitWindows()
if err != nil {
return vssSnapshot{}, newVssTextError(fmt.Sprintf(