Documentation ¶
Index ¶
- Constants
- Variables
- func Blobfuse2Version_() 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 GetDiskUsageFromStatfs(path string) (float64, float64, error)
- func GetFuseMinorVersion() int
- func GetIdLength(id string) int64
- func GetUsage(path string) (float64, error)
- func IsDirectoryEmpty(path string) bool
- func IsDirectoryMounted(path string) bool
- func ListMountPoints() ([]string, error)
- func MonitorBfs() bool
- func NewUUID() (u uuid)
- func NewUUIDWithLength(length int64) []byte
- func NormalizeObjectName(name string) string
- func NotifyMountToParent() 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 Version
Constants ¶
const ( DefaultMaxLogFileSize = 512 DefaultLogFileCount = 10 FileSystemName = "blobfuse2" 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 * MbToBytes BfuseStats = "blobfuse_stats" FuseAllowedFlags = "" /* 229-byte string literal not displayed */ UserAgentHeader = "User-Agent" )
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 BlobFuse2WarningsURL = "https://aka.ms/blobfuse2warnings"
const Blobfuse2ListContainerURL = "https://blobfuse2.blob.core.windows.net/release"
Variables ¶
var BfsDisabled = false
var Blobfuse2Version = Blobfuse2Version_()
var DefaultLogFilePath = filepath.Join(DefaultWorkDir, "blobfuse2.log")
var DefaultWorkDir = "$HOME/.blobfuse2"
var ELogLevel = LogLevel(0).INVALID()
var EnableMonitoring = false
var ForegroundMount bool
var MountPath string
var PollingPipe = "/tmp/pollPipe"
var RootMount bool
var StatsConfigFilePath = filepath.Join(DefaultWorkDir, "stats_monitor.cfg")
var TransferPipe = "/tmp/transferPipe"
Functions ¶
func Blobfuse2Version_ ¶
func Blobfuse2Version_() 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 blobfuse2 command.
func GetDiskUsageFromStatfs ¶
GetDiskUsageFromStatfs: Current disk usage of temp path
func GetFuseMinorVersion ¶
func GetFuseMinorVersion() int
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 ListMountPoints ¶
List all mount points which were mounted using blobfuse2
func MonitorBfs ¶
func MonitorBfs() 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 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' or '-preview' attached. Examples: 10.1.0, 11.2.0-preview.1, 11.2.0~preview.1