Documentation ¶
Index ¶
- Constants
- func ConvertFromRawToQcow2(filePath string) error
- func ConvertToStorageAddress(address string) (string, error)
- func CopyFile(srcPath, dstPath string) (int64, error)
- func DetectFileFormat(filePath string) (string, 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 GetSyncingFileConfigFilePath(syncingFilePath string) string
- func IsGRPCErrorMatchingCode(err error, errCode codes.Code) bool
- func IsGRPCErrorNotFound(err error) bool
- func IsHTTPClientErrorNotFound(inputErr error) bool
- func IsLoopbackHost(host string) bool
- func PrintJSON(obj interface{}) error
- func WriteSyncingFileConfig(configFilePath string, config *SyncingFileConfig) (err error)
- type Bitmap
- type DiskConfig
- 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 ¶
This section is empty.
Functions ¶
func ConvertFromRawToQcow2 ¶
func ConvertToStorageAddress ¶
func DetectFileFormat ¶
func ExecuteWithTimeout ¶
func FileModificationTime ¶
func GetDiskConfig ¶
func GetFileChecksum ¶
func GetIPForPod ¶
func IsGRPCErrorNotFound ¶
func IsLoopbackHost ¶
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 SyncingFileConfig ¶
type SyncingFileConfig struct { FilePath string `json:"name"` UUID string `json:"uuid"` Size int64 `json:"size"` 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.