Documentation ¶
Index ¶
- Constants
- func CreateCacheDirectoryIfNotPresentAt(dirPath string, dirPerm os.FileMode) error
- func CreateFile(fileSpec data.FileSpec, flag int) (file *os.File, err error)
- func GetDownloadPath(cacheDir string, objectPath string) string
- func GetObjectPath(bucketName string, objectName string) string
- func IsCacheHandleInvalid(readErr error) bool
Constants ¶
const ( InvalidFileHandleErrMsg = "invalid file handle" InvalidFileDownloadJobErrMsg = "invalid download job" InvalidCacheHandleErrMsg = "invalid cache handle" InvalidFileInfoCacheErrMsg = "invalid file info cache" ErrInSeekingFileHandleMsg = "error while seeking file handle" ErrInReadingFileHandleMsg = "error while reading file handle" FallbackToGCSErrMsg = "read via gcs" FileNotPresentInCacheErrMsg = "file is not present in cache" CacheHandleNotRequiredForRandomReadErrMsg = "cacheFileForRangeRead is false, read type random read and fileInfo entry is absent" )
const ( MiB = 1024 * 1024 KiB = 1024 DefaultFilePerm = os.FileMode(0600) DefaultDirPerm = os.FileMode(0700) FileCache = "gcsfuse-file-cache" )
Variables ¶
This section is empty.
Functions ¶
func CreateCacheDirectoryIfNotPresentAt ¶
CreateCacheDirectoryIfNotPresentAt Creates directory at given path with provided permissions in case not already present, returns error in case unable to create directory or directory is not writable.
func CreateFile ¶
CreateFile creates file with given file spec i.e. permissions and returns file handle for that file opened with given flag.
Note: If directories in path are not present, they are created with directory permissions provided in fileSpec permission.
func GetDownloadPath ¶
GetDownloadPath gives file path to file in cache for given object path.
func GetObjectPath ¶
GetObjectPath gives object path which is concatenation of bucket and object name separated by "/".
func IsCacheHandleInvalid ¶
IsCacheHandleInvalid says either the current cacheHandle is invalid or not, based on the error we got while reading with the cacheHandle. If it's invalid then we should close that cacheHandle and create new cacheHandle for next call onwards.
Types ¶
This section is empty.