Documentation ¶
Overview ¶
This package contains the tools that frequently used by other packages
Index ¶
- func GrpcConnect(addr string, tlsEnabled bool) (*grpc.ClientConn, error)
- func HttpGetReqPersist(url string, opts ...ReqOption) ([]byte, error)
- func HttpPostReqPersist(url string, payload io.Reader, opts ...ReqOption) ([]byte, error)
- func NewError(code int, text string) error
- func NewErrorf(code int, format string, a ...interface{}) error
- func PrettyPrint(v any, prefix ...string)
- func RandomBool(chancePercent int) bool
- func RandomNumberF(rangeLower float64, rangeUpper float64) float64
- func RandomNumberI(rangeLower int64, rangeUpper int64) int64
- func RandomString(length int) string
- func UniqueStringSlice(input []string) []string
- func WaitCountdown(s time.Duration, msg string)
- type CodeError
- type ReqOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GrpcConnect ¶
func GrpcConnect(addr string, tlsEnabled bool) (*grpc.ClientConn, error)
func HttpPostReqPersist ¶
func RandomBool ¶
It generates a random boolean status the `chancePercent` should be between 0 and 100
func RandomNumberF ¶
This function receives a pair of min and max float64 numbers and generates a random number in that range (inclusive)
func RandomNumberI ¶
This function receives a pair of min and max int64 numbers and generates a random number in that range (inclusive)
func RandomString ¶
This function receives the length of a string and generates a random string
func UniqueStringSlice ¶
func WaitCountdown ¶
Types ¶
type ReqOption ¶
type ReqOption interface {
// contains filtered or unexported methods
}
func HttpAddHeader ¶
func HttpWithRetry ¶
func HttpWithTimeout ¶
Click to show internal directories.
Click to hide internal directories.