limits_windows.go raw

   1  //go:build windows
   2  
   3  package storage
   4  
   5  import (
   6  	"errors"
   7  )
   8  
   9  // FilesystemStats holds information about filesystem space usage.
  10  type FilesystemStats struct {
  11  	Total     uint64 // Total bytes on filesystem
  12  	Available uint64 // Available bytes (for unprivileged users)
  13  	Used      uint64 // Used bytes
  14  }
  15  
  16  // GetFilesystemStats returns filesystem space information for the given path.
  17  // Windows implementation is not yet supported.
  18  func GetFilesystemStats(path string) (stats FilesystemStats, err error) {
  19  	// TODO: Implement using syscall.GetDiskFreeSpaceEx
  20  	err = errors.New("filesystem stats not implemented on Windows")
  21  	return
  22  }
  23  
  24  // CalculateMaxStorage calculates the maximum storage limit for the relay.
  25  // If configuredMax > 0, it returns that value directly.
  26  // Windows auto-detection is not yet supported.
  27  func CalculateMaxStorage(dataDir string, configuredMax int64) (int64, error) {
  28  	if configuredMax > 0 {
  29  		return configuredMax, nil
  30  	}
  31  	return 0, errors.New("auto-detect storage limit not implemented on Windows; set ORLY_MAX_STORAGE_BYTES manually")
  32  }
  33  
  34  // GetCurrentStorageUsage calculates the current storage usage of the data directory.
  35  // Windows implementation is not yet supported.
  36  func GetCurrentStorageUsage(dataDir string) (int64, error) {
  37  	return 0, errors.New("storage usage detection not implemented on Windows")
  38  }
  39