Documentation ¶
Index ¶
- Constants
- Variables
- func CheckBackupType(backupTarget string) (string, error)
- func ConvertFromQcow2ToRaw(sourcePath, targetPath string) error
- func ConvertFromRawToQcow2(filePath string) error
- func CopyFile(srcPath, dstPath string) (int64, error)
- func DetectGRPCServerAvailability(address string, waitIntervalInSecond int, shouldAvailable bool) bool
- func DetectHTTPServerAvailability(url string, waitIntervalInSecond int, shouldAvailable bool) bool
- func Execute(envs []string, binary string, args ...string) (string, error)
- func ExecuteWithTimeout(timeout time.Duration, envs []string, binary string, args ...string) (string, error)
- func FileModificationTime(filePath string) string
- func GetDiskConfig(diskPath string) (string, error)
- func GetFileChecksum(filePath string) (string, error)
- func GetHTTPClientErrorPrefix(stateCode int) string
- func GetIPForPod() (ip string, err error)
- func GetLocalIPv4fromInterface(name string) (ip string, err error)
- func GetSyncServiceAddressWithPodIP(address string) (string, error)
- func GetSyncingFileConfigFilePath(syncingFilePath string) string
- func GunzipFile(filePath string, dstFilePath string) error
- func IsGRPCErrorMatchingCode(err error, errCode codes.Code) bool
- func IsGRPCErrorNotFound(err error) bool
- func IsHTTPClientErrorNotFound(inputErr error) bool
- func PrintJSON(obj interface{}) error
- func ValidBackingImageName(name string) bool
- func WriteSyncingFileConfig(configFilePath string, config *SyncingFileConfig) (err error)
- type Bitmap
- type DiskConfig
- type QemuImgInfo
- type SyncingFileConfig
Constants ¶
View Source
const ( HTTPClientErrorPrefixTemplate = "resp.StatusCode(%d) != http.StatusOK(200)" EnvPodIP = "POD_IP" StorageNetworkInterface = "lhnet1" )
View Source
const (
DiskConfigFile = "longhorn-disk.cfg"
)
DiskConfigFile should be the same as the schema in longhorn-manager/util
View Source
const (
QemuImgBinary = "qemu-img"
)
View Source
const (
SyncingFileConfigFileSuffix = ".cfg"
)
Variables ¶
View Source
var (
MaximumBackingImageNameSize = 64
)
Functions ¶
func CheckBackupType ¶ added in v1.6.0
func ConvertFromQcow2ToRaw ¶ added in v1.7.0
func ConvertFromRawToQcow2 ¶
func ExecuteWithTimeout ¶
func FileModificationTime ¶
func GetDiskConfig ¶
func GetFileChecksum ¶
func GetIPForPod ¶
func GetSyncServiceAddressWithPodIP ¶ added in v1.5.4
func GunzipFile ¶ added in v1.5.4
func IsGRPCErrorNotFound ¶
func ValidBackingImageName ¶ added in v1.6.0
func WriteSyncingFileConfig ¶
func WriteSyncingFileConfig(configFilePath string, config *SyncingFileConfig) (err error)
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
func (*Bitmap) ReleaseRange ¶
type DiskConfig ¶
type DiskConfig struct {
DiskUUID string `json:"diskUUID"`
}
type QemuImgInfo ¶ added in v1.5.5
type QemuImgInfo struct { // For qcow2 files, VirtualSize may be larger than the physical // image size on disk. For raw files, `qemu-img info` will report // VirtualSize as being the same as the physical file size. VirtualSize int64 `json:"virtual-size"` Format string `json:"format"` }
func GetQemuImgInfo ¶ added in v1.5.5
func GetQemuImgInfo(filePath string) (imgInfo QemuImgInfo, err error)
type SyncingFileConfig ¶
type SyncingFileConfig struct { FilePath string `json:"name"` UUID string `json:"uuid"` Size int64 `json:"size"` VirtualSize int64 `json:"virtualSize"` ExpectedChecksum string `json:"expectedChecksum"` CurrentChecksum string `json:"currentChecksum"` ModificationTime string `json:"modificationTime"` }
func ReadSyncingFileConfig ¶
func ReadSyncingFileConfig(configFilePath string) (*SyncingFileConfig, error)
Click to show internal directories.
Click to hide internal directories.