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 FileModificationTime(filePath string) string
- func GetDiskConfig(diskPath string) (string, error)
- func GetFileChecksum(filePath string) (string, error)
- func GetFileRealSize(filePath string) (int64, 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 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 (
SyncingFileConfigFileSuffix = ".cfg"
)
Variables ¶
View Source
var (
MaximumBackingImageNameSize = 64
)
View Source
var NoProxyTransport = func() *http.Transport { t := http.DefaultTransport.(*http.Transport).Clone() t.Proxy = nil return t }()
NoProxyTransport is a copy of http.DefaultTransport with Proxy disabled. Use it for all intra-pod HTTP calls so that requests are never forwarded to an external proxy. Ref: https://github.com/longhorn/longhorn/issues/12779
Functions ¶
func CheckBackupType ¶ added in v1.6.0
func ConvertFromQcow2ToRaw ¶ added in v1.7.0
func ConvertFromRawToQcow2 ¶
func FileModificationTime ¶
func GetDiskConfig ¶
func GetFileChecksum ¶
func GetFileRealSize ¶ added in v1.8.0
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 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"`
VirtualSize int64 `json:"virtualSize"`
RealSize int64 `json:"realSize"`
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.