Documentation
¶
Index ¶
- Constants
- func BlueString(s string) string
- func EncodedUserdata(content string) string
- func Filter[T any](items []T, filterFun func(x T) bool) []T
- func GetAllIpaddress() ([]string, error)
- func GetStructTags(i interface{}) []string
- func GreenString(s string) string
- func LoadUserData(file string) (string, error)
- func LogError(err error, message string, exit bool)
- func LogIfError(err error, exit bool, format string, args ...interface{})
- func MatchPingResult(text string) []string
- func OneOfBoolean(values ...bool) bool
- func OneOfNumber[...](values ...T) T
- func OneOfString(strs ...string) string
- func OneOfStringArrays(arraysList ...[]string) []string
- func RaiseIfError(err error, msg string)
- func RedString(s string) string
- func Retry(condition RetryCondition, function func() bool) error
- func RetryError(condition RetryCondition, function func() (bool, error)) error
- func RetryWithContext(ctx context.Context, condition RetryCondition, function func() error) error
- func RetryWithErrors(condition RetryCondition, matchErrors []string, function func() error) error
- func Split(s string, sep string) []string
- func Sum[T int | int32 | int64 | float32 | float64](numbers ...T) T
- func UnmarshalJsonKey(bytes []byte, key string, v any) error
- func UrlJoin(path ...string) string
- func UrlValues(m map[string]string) url.Values
- func VersionUrl(endpoint, version string) string
- func WatchFileSize(filePath string, size int)
- type ActionNotFinishedError
- type ColorFormater
- type ColorStatus
- type DefaultInterval
- type ErrArgs
- type GuestHasNoIpaddressError
- type GuestNoIpaddressError
- type ImageNotActive
- type Interval
- type PingLossPackage
- type ReaderWithProcess
- type RetryCondition
- type ServerNotBooted
- type ServerNotStopped
- type SnapshotIsNotAvailable
- type StepInterval
- type StringRing
- type VolumeHasTaskError
Constants ¶
View Source
const ( KB = 1024 MB = KB * 1024 GB = MB * 1024 TB = GB * 1024 )
Variables ¶
This section is empty.
Functions ¶
func BlueString ¶
func EncodedUserdata ¶
func GetAllIpaddress ¶
func GetStructTags ¶
func GetStructTags(i interface{}) []string
func GreenString ¶
func LoadUserData ¶
func LogIfError ¶
func MatchPingResult ¶
func OneOfBoolean ¶
func OneOfNumber ¶
func OneOfString ¶
func OneOfStringArrays ¶
func RaiseIfError ¶
func Retry ¶
func Retry(condition RetryCondition, function func() bool) error
func RetryError ¶
func RetryError(condition RetryCondition, function func() (bool, error)) error
func RetryWithContext ¶
func RetryWithContext(ctx context.Context, condition RetryCondition, function func() error) error
func RetryWithErrors ¶
func RetryWithErrors(condition RetryCondition, matchErrors []string, function func() error) error
func VersionUrl ¶
func WatchFileSize ¶
Types ¶
type ActionNotFinishedError ¶
type ActionNotFinishedError ErrArgs
func NewActionNotFinishedError ¶
func NewActionNotFinishedError(args ...interface{}) ActionNotFinishedError
func (ActionNotFinishedError) Error ¶
func (e ActionNotFinishedError) Error() string
type ColorFormater ¶
type ColorStatus ¶
type ColorStatus struct { Formater ColorFormater // contains filtered or unexported fields }
func NewColorStatus ¶
func NewColorStatus(s string) ColorStatus
func (ColorStatus) String ¶
func (s ColorStatus) String() string
type DefaultInterval ¶
func (DefaultInterval) Next ¶
func (i DefaultInterval) Next() time.Duration
type GuestHasNoIpaddressError ¶
type GuestHasNoIpaddressError ErrArgs
func NewGuestHasNoIpaddressError ¶
func NewGuestHasNoIpaddressError(ipAddress []string) GuestHasNoIpaddressError
func (GuestHasNoIpaddressError) Error ¶
func (e GuestHasNoIpaddressError) Error() string
type GuestNoIpaddressError ¶
type GuestNoIpaddressError ErrArgs
func NewGuestNoIpaddressError ¶
func NewGuestNoIpaddressError() GuestNoIpaddressError
func (GuestNoIpaddressError) Error ¶
func (e GuestNoIpaddressError) Error() string
type ImageNotActive ¶
type ImageNotActive ErrArgs
func NewImageNotActiveError ¶
func NewImageNotActiveError(imageId string) ImageNotActive
func (ImageNotActive) Error ¶
func (e ImageNotActive) Error() string
type PingLossPackage ¶
type PingLossPackage ErrArgs
func NewPingLossPackage ¶
func NewPingLossPackage(lossed int) PingLossPackage
func (PingLossPackage) Error ¶
func (e PingLossPackage) Error() string
type ReaderWithProcess ¶
func NewProcessReader ¶
func NewProcessReader(reader io.ReadCloser, size int) *ReaderWithProcess
type RetryCondition ¶
type RetryCondition struct { Timeout time.Duration IntervalMin time.Duration IntervalMax time.Duration IntervalStep time.Duration // contains filtered or unexported fields }
func (*RetryCondition) NextInterval ¶
func (c *RetryCondition) NextInterval() time.Duration
type ServerNotBooted ¶
type ServerNotBooted ErrArgs
func NewServerNotBootedError ¶
func NewServerNotBootedError(serverId string) ServerNotBooted
func (ServerNotBooted) Error ¶
func (e ServerNotBooted) Error() string
type ServerNotStopped ¶
type ServerNotStopped ErrArgs
func NewServerNotStopped ¶
func NewServerNotStopped(serverId string) ServerNotStopped
func (ServerNotStopped) Error ¶
func (e ServerNotStopped) Error() string
type SnapshotIsNotAvailable ¶
type SnapshotIsNotAvailable ErrArgs
func NewSnapshotIsNotAvailable ¶
func NewSnapshotIsNotAvailable(snapshotId string) SnapshotIsNotAvailable
func (SnapshotIsNotAvailable) Error ¶
func (e SnapshotIsNotAvailable) Error() string
type StepInterval ¶
type StepInterval struct { Min time.Duration Max time.Duration Step time.Duration // contains filtered or unexported fields }
func (*StepInterval) Next ¶
func (i *StepInterval) Next() time.Duration
type StringRing ¶
type StringRing struct { Items []string // contains filtered or unexported fields }
func (*StringRing) Next ¶
func (r *StringRing) Next() string
func (*StringRing) Sample ¶
func (r *StringRing) Sample(count int) []string
type VolumeHasTaskError ¶
type VolumeHasTaskError ErrArgs
func NewVolumeHasTaskError ¶
func NewVolumeHasTaskError(volumeId string) VolumeHasTaskError
func (VolumeHasTaskError) Error ¶
func (e VolumeHasTaskError) Error() string
Click to show internal directories.
Click to hide internal directories.