utils

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2025 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinPort              int    = 1
	MaxPort              int    = 65535
	MinIops              int    = 100
	MaxIops              int    = 13000
	DefaultIops          int32  = 150
	MaxSize              int    = 14901
	TestAccVmType        string = "tinav6.c2r2p2"
	LinkedPolicyNotFound string = "5102"
	InvalidState         string = "InvalidState"
	SuffixConfigFilePath string = "/.osc/config.json"

	VolumeIOPSError string = `` /* 198-byte string literal not displayed */

)

PrintToJSON method helper to debug responses

Variables

This section is empty.

Functions

func CheckPath

func CheckPath(path string) error

func CheckThrottling

func CheckThrottling(httpResp *http.Response, err error) *resource.RetryError

func FiltersTimesToStringSlice

func FiltersTimesToStringSlice(filterValues []string, filterName string) ([]string, error)

func GetBsuId

func GetBsuId(vmResp oscgo.Vm, deviceName string) string

func GetBsuTagsMaps

func GetBsuTagsMaps(vmResp oscgo.Vm, conn *oscgo.APIClient) (map[string]interface{}, error)

func GetEnvVariableValue

func GetEnvVariableValue(envVariables []string) string

func GetErrorResponse

func GetErrorResponse(err error) error

func GetRegion

func GetRegion() string

func I32toa

func I32toa(i int32) string

func InterfaceSliceToStringList

func InterfaceSliceToStringList(slice []interface{}) *[]string

func InterfaceSliceToStringSlice

func InterfaceSliceToStringSlice(slice []interface{}) []string

func InterfaceSliceToStringSlicePtr

func InterfaceSliceToStringSlicePtr(slice []interface{}) *[]string

func IsResponseEmpty

func IsResponseEmpty(len int, name, id string) bool

func IsResponseEmptyOrMutiple

func IsResponseEmptyOrMutiple(rLen int, resName string) error

func LogManuallyDeleted

func LogManuallyDeleted(name, id string)

func ParseStringToInt32

func ParseStringToInt32(str string) int32

func ParsingfilterToDateFormat

func ParsingfilterToDateFormat(filterName, value string) (time.Time, error)

func PrintToJSON

func PrintToJSON(v interface{}, msg string)

func RandIntRange

func RandIntRange(min, max int) int

func RandVpcCidr

func RandVpcCidr() string

func SetToStringSlice

func SetToStringSlice(set *schema.Set) []string

func SetToStringSlicePtr

func SetToStringSlicePtr(set *schema.Set) *[]string

func String

func String(s string) int

String hashes a string to a unique hashcode.

crc32 returns a uint32, but for our use we need and non negative integer. Here we cast to an integer and invert it if the result is negative.

func StringSlicePtrToInterfaceSlice

func StringSlicePtrToInterfaceSlice(list *[]string) []interface{}

func StringSliceToFloat32Slice

func StringSliceToFloat32Slice(src []string) (res []float32)

StringSliceToFloat32Slice converts []string to []float32 ...

func StringSliceToInt32Slice

func StringSliceToInt32Slice(src []string) (res []int32)

StringSliceToInt32Slice converts []string to []int32 ...

func StringSliceToInt64Slice

func StringSliceToInt64Slice(src []string) (res []int64)

StringSliceToInt64Slice converts []string to []int64 ...

func StringSliceToPtrInt64Slice

func StringSliceToPtrInt64Slice(src []*string) []*int64

StringSliceToPtrInt64Slice ...

func StringSliceToTimeSlice

func StringSliceToTimeSlice(filterValues []string, filterName string) ([]time.Time, error)

func Strings

func Strings(strings []string) string

Strings hashes a list of strings to a unique hashcode.

func ToJSONString

func ToJSONString(v interface{}) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL