Documentation ¶
Index ¶
- Constants
- Variables
- func CloudfuseVersion_() string
- func DecryptData(cipherData []byte, key []byte) ([]byte, error)
- func DirectoryExists(path string) bool
- func EncryptData(plainData []byte, key []byte) ([]byte, error)
- func ExpandPath(path string) string
- func FuseIgnoredFlags() []string
- func GetCurrentDistro() string
- func GetCurrentUser() (uint32, uint32, error)
- func GetDefaultWorkDir() string
- func GetDiskUsageFromStatfs(path string) (float64, float64, error)
- func GetIdLength(id string) int64
- func GetUsage(path string) (float64, error)
- func IsDirectoryEmpty(path string) bool
- func IsDirectoryMounted(path string) bool
- func IsDriveLetter(path string) bool
- func JoinUnixFilepath(elem ...string) string
- func ListMountPoints() ([]string, error)
- func MonitorCfs() bool
- func NewUUID() (u uuid)
- func NewUUIDWithLength(length int64) []byte
- func NormalizeObjectName(name string) string
- func NotifyMountToParent() error
- func Open(name string) (*os.File, error)
- func OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- type BitMap16
- type Block
- type BlockOffsetList
- type KeyedMutex
- type LockMap
- type LockMapItem
- type LogConfig
- type LogLevel
- func (LogLevel) INVALID() LogLevel
- func (LogLevel) LOG_CRIT() LogLevel
- func (LogLevel) LOG_DEBUG() LogLevel
- func (LogLevel) LOG_ERR() LogLevel
- func (LogLevel) LOG_INFO() LogLevel
- func (LogLevel) LOG_OFF() LogLevel
- func (LogLevel) LOG_TRACE() LogLevel
- func (LogLevel) LOG_WARNING() LogLevel
- func (l *LogLevel) Parse(s string) error
- func (l LogLevel) String() string
- type Statfs_t
- type Version
Constants ¶
const ( DefaultMaxLogFileSize = 512 DefaultLogFileCount = 10 FileSystemName = "cloudfuse" DefaultConfigFilePath = "config.yaml" MaxConcurrency = 40 DefaultConcurrency = 20 MaxDirListCount = 5000 DefaultFilePermissionBits os.FileMode = 0755 DefaultDirectoryPermissionBits os.FileMode = 0775 DefaultAllowOtherPermissionBits os.FileMode = 0777 MbToBytes = 1024 * 1024 GbToBytes = 1024 * 1024 * 1024 PbToBytes = 1024 * 1024 * 1024 * 1024 * 1024 CfuseStats = "cloudfuse_stats" FuseAllowedFlags = "" /* 229-byte string literal not displayed */ )
Standard config default values
const ( BlockFlagUnknown uint16 = iota DirtyBlock TruncatedBlock RemovedBlocks )
Flags for blocks
const ( BolFlagUnknown uint16 = iota SmallFile )
Flags for block offset list
const CloudfuseReleaseURL = "https://api.github.com/repos/Seagate/cloudfuse/releases"
const SectorSize = 4096
Sector size of disk
Variables ¶
var BuildDate = "undated"
var CfsDisabled = false
var CloudfuseVersion = CloudfuseVersion_()
var DefaultLogFilePath string
var DefaultWorkDir string
var ELogLevel = LogLevel(0).INVALID()
var EnableMonitoring = false
var ForegroundMount bool
var GitCommit = "**local_build**"
var GoVersion = runtime.Version()
var PollingPipe = "/tmp/pollPipe"
var RootMount bool
var StatsConfigFilePath string
var TransferPipe = "/tmp/transferPipe"
Functions ¶
func CloudfuseVersion_ ¶
func CloudfuseVersion_() string
func DecryptData ¶
Decrypt given data using the key provided
func DirectoryExists ¶
DirectoryExists is a utility function that returns true if the directory at that path exists and returns false if it does not exist.
func EncryptData ¶
Encrypt given data using the key provided
func FuseIgnoredFlags ¶
func FuseIgnoredFlags() []string
func GetCurrentDistro ¶
func GetCurrentDistro() string
func GetCurrentUser ¶
GetCurrentUser is a utility function that returns the UID and GID of the user that invokes the cloudfuse command.
func GetDefaultWorkDir ¶ added in v1.1.0
func GetDefaultWorkDir() string
func GetDiskUsageFromStatfs ¶
GetDiskUsageFromStatfs: Current disk usage of temp path
func GetIdLength ¶
func IsDirectoryEmpty ¶
IsDirectoryEmpty is a utility function that returns true if the directory at that path is empty or not
func IsDirectoryMounted ¶
IsDirectoryMounted is a utility function that returns true if the directory is already mounted using fuse
func IsDriveLetter ¶
IsDriveLetter returns true if the path is a drive letter on Windows, such as 'D:' or 'f:'. Returns false otherwise.
func JoinUnixFilepath ¶
JoinUnixFilepath uses filepath.join to join a path and ensures that path only uses unix path delimiters.
func ListMountPoints ¶
List all mount points which were mounted using cloudfuse
func MonitorCfs ¶
func MonitorCfs() bool
check if health monitor is enabled and blofuse stats monitor is not disabled
func NewUUIDWithLength ¶
NewUUIDWithLength returns a new uuid using RFC 4122 algorithm with the given length.
func NormalizeObjectName ¶
normalizeObjectName : If file contains \\ in name replace it with ..
func NotifyMountToParent ¶
func NotifyMountToParent() error
NotifyMountToParent : Send a signal to parent process about successful mount
Types ¶
type BitMap16 ¶
type BitMap16 uint16
type Block ¶
type BlockOffsetList ¶
type BlockOffsetList struct { BlockList []*Block //blockId to offset mapping Flags BitMap16 BlockIdLength int64 Size int64 Mtime time.Time }
list that holds blocks containing ids and corresponding offsets
func (BlockOffsetList) BinarySearch ¶
func (bol BlockOffsetList) BinarySearch(offset int64) (bool, int)
return true if item found and index of the item
func (BlockOffsetList) FindBlocks ¶
func (bol BlockOffsetList) FindBlocks(offset, length int64) ([]*Block, bool)
returns index of first mod block, size of mod data, does the new data exceed current size?, is it append only?
func (BlockOffsetList) FindBlocksToModify ¶
returns index of first mod block, size of mod data, does the new data exceed current size?, is it append only?
func (*BlockOffsetList) SmallFile ¶
func (bol *BlockOffsetList) SmallFile() bool
Dirty : Handle is dirty or not
type KeyedMutex ¶
type KeyedMutex struct {
// contains filtered or unexported fields
}
type LockMap ¶
type LockMap struct {
// contains filtered or unexported fields
}
Map holding locks for all the files
func NewLockMap ¶
func NewLockMap() *LockMap
func (*LockMap) Get ¶
func (l *LockMap) Get(name string) *LockMapItem
Get the lock item based on file name, if item does not exists create it
type LockMapItem ¶
type LockMapItem struct {
// contains filtered or unexported fields
}
Lock item for each file
func (*LockMapItem) DownloadTime ¶
func (l *LockMapItem) DownloadTime() time.Time
Get the download time of the file
func (*LockMapItem) Lock ¶
func (l *LockMapItem) Lock()
Lock Item level operation Lock this file exclusively
func (*LockMapItem) SetDownloadTime ¶
func (l *LockMapItem) SetDownloadTime()
Set the download time of the file
type Statfs_t ¶
type Statfs_t struct { Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Frsize int64 Flags int64 Namemax uint64 }
Statfs type used by component in replace of syscall.Statfs_t as defined by cgofuse https://pkg.go.dev/github.com/winfsp/cgofuse/fuse#Statfs_t
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
func ParseVersion ¶
To keep the code simple, we assume we only use a simple subset of semantic versions. Namely, the version is either a normal stable version, or a pre-release version with '-preview' attached. Examples: 10.1.0, 11.2.0-preview.1