util

package
v0.3.360 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

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 added in v0.1.2

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 added in v0.1.2

func CheckEmail(name string) error

func CheckEndTime added in v0.1.2

func CheckEndTime(time int64) error

func CheckId added in v0.1.2

func CheckId(id string) error

func CheckIntRange added in v0.1.2

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

func CheckInteger added in v0.1.2

func CheckInteger(v string, field string) error

func CheckIp added in v0.1.2

func CheckIp(ip string) error

func CheckMaxFloat added in v0.1.2

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

func CheckMaxLen added in v0.1.2

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

Enabled the filed has maz length

func CheckMaxSum added in v0.1.2

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

func CheckMaxValue added in v0.1.2

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

Enabled the filed has maz length

func CheckMinFloat added in v0.1.2

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

func CheckMinLen added in v0.1.2

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

check the a field has max len

func CheckMinValue added in v0.1.2

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

func CheckMinValue64 added in v0.1.2

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

func CheckName added in v0.1.2

func CheckName(name string) error

Generic name validation

func CheckNotEmpty added in v0.1.2

func CheckNotEmpty(s string, field string) error

check the the field is not empty

func CheckNotNull added in v0.1.2

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

CheckNotNull checks that a field is not null

func CheckPathExist added in v0.1.2

func CheckPathExist(path string, field string) error

func CheckStartTime added in v0.1.2

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 added in v0.1.2

func IgnoreNotFound(err error) error

func Int32Ptr

func Int32Ptr(i int32) *int32

func Int64Ptr

func Int64Ptr(i int64) *int64

func IsNotEmpty added in v0.1.2

func IsNotEmpty(s *string) bool

func IsNotFound added in v0.1.2

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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