util

package
v0.5.534 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const MAX_NAME = 256

Variables

View Source
var EPSILON float64 = 0.00000001

Functions

func AddFin

func AddFin(m *metav1.ObjectMeta, GroupName string)

func AllCombs

func AllCombs(levels [][]string) []string

func Assert

func Assert(tb testing.TB, condition bool, msg string, v ...interface{})

assert fails the test if the condition is false.

func BoolPtr

func BoolPtr(v bool) *bool

func CheckEmail

func CheckEmail(name string) error

func CheckEndTime

func CheckEndTime(time int64) error

func CheckId

func CheckId(id string) error

func CheckIntRange

func CheckIntRange(v int32, min int32, max int32, field string) error

func CheckInteger

func CheckInteger(v string, field string) error

func CheckIp

func CheckIp(ip string) error

func CheckMaxFloat

func CheckMaxFloat(v float64, field string, max float64) error

func CheckMaxLen

func CheckMaxLen(s string, field string, max int) error

Enabled the filed has maz length

func CheckMaxSum

func CheckMaxSum(x float64, y float64, a string, b string, max float64) error

func CheckMaxValue

func CheckMaxValue(v int32, field string, max int32) error

Enabled the filed has maz length

func CheckMinFloat

func CheckMinFloat(v float64, field string, min float64) error

func CheckMinLen

func CheckMinLen(s string, field string, min int) error

check that a field has max len

func CheckMinValue

func CheckMinValue(v int32, field string, min int32) error

func CheckMinValue64

func CheckMinValue64(v int64, field string, min int64) error

func CheckName

func CheckName(name string) error

Generic name validation

func CheckNotEmpty

func CheckNotEmpty(s string, field string) error

check the field is not empty

func CheckNotNull

func CheckNotNull(field interface{}, fieldname string) error

CheckNotNull checks that a field is not null

func CheckPathExist

func CheckPathExist(path string, field string) error

func CheckStartTime

func CheckStartTime(time int64) error

func ConvertBoolPtrToYN

func ConvertBoolPtrToYN(v *bool) string

func EmptyOrVal

func EmptyOrVal(s *string) string

func Float64Ptr

func Float64Ptr(v float64) *float64

func FloatPtr

func FloatPtr(v float64) *float64

func FloatToA

func FloatToA(v float64) string

func FtoA

func FtoA(v *float64) string

func HasFin

func HasFin(m *metav1.ObjectMeta, GroupName string) bool

func IgnoreNotFound

func IgnoreNotFound(err error) error

func Int32Ptr

func Int32Ptr(i int32) *int32

func Int64Ptr

func Int64Ptr(i int64) *int64

func IsNotEmpty

func IsNotEmpty(s *string) bool

func IsNotFound

func IsNotFound(err error) bool

func ItoA

func ItoA(v *int32) string

func MinInt

func MinInt(a, b int) int

func OK

func OK(tb testing.TB, err error)

ok fails the test if an err is not nil.

func RemoveFin

func RemoveFin(m *metav1.ObjectMeta, GroupName string)

func StrPtr

func StrPtr(s string) *string

func TenantUri added in v0.5.179

func TenantUri(tenantName, uri string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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