promcasautils

package
v0.0.0-...-b5dcede Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorBlack  Color = "\u001b[30m"
	ColorRed          = "\u001b[31m"
	ColorGreen        = "\u001b[32m"
	ColorYellow       = "\u001b[33m"
	ColorBlue         = "\u001b[34m"
	ColorReset        = "\u001b[0m"
)

Variables

View Source
View Source
var UUIDArray = [...]string{"callid", "session_id", "uuid", "sid", "cid", "correlation_id"}

Functions

func CheckBooleanValue

func CheckBooleanValue(val interface{}) bool

import checkFloatValue

func CheckFloatValue

func CheckFloatValue(val interface{}) float64

import checkFloatValue

func CheckIntValue

func CheckIntValue(val interface{}) int

import checkFloatValue

func CheckStringValue

func CheckStringValue(val interface{}) string

import checkFloatValue

func CheckTypeValue

func CheckTypeValue(val interface{}) reflect.Kind

import CheckTypeValue

func Colorize

func Colorize(color Color, message string)

colorize message

func ColorizeSprintf

func ColorizeSprintf(color Color, message string) string

colorize message

func ConvertPayloadTypeToString

func ConvertPayloadTypeToString(val float64) (string, string)

import convertPayloadTypeToString

func ConvertProtoStringToInt

func ConvertProtoStringToInt(val string) int

import convertProtoTypeToString

func ConvertProtoTypeToString

func ConvertProtoTypeToString(val float64) string

import convertProtoTypeToString

func ElementExists

func ElementExists(arr []string, elem string) bool

check if the element exists

func ElementExistsPosition

func ElementExistsPosition(arr []string, elem string) int

check if the element exists

func ElementRealExists

func ElementRealExists(arr []string, elem string) bool

check if the element exists

func FileExists

func FileExists(filename string) bool

fileExists checks if a file exists and is not a directory before we try using it to prevent further errors.

func GenCodeChallengeS256

func GenCodeChallengeS256(s string) string

make a genCodeChallengeS256

func GenerateToken

func GenerateToken() string

func Hash32

func Hash32(s string) uint32

make a hash

func Hash64

func Hash64(s string) uint64

make a hash

func HashString

func HashString(s string) uint32

func IsupToHex

func IsupToHex(s string) string

isup to HEX

func ItemExists

func ItemExists(arr []string, elem string) bool

check if the element exists

func KeyExists

func KeyExists(arr []uint32, elem uint32) bool

check if the element exists

func LookupIP

func LookupIP(ip string) (string, error)

LookupIP looks up host using the local resolver. It returns a slice of that host's IPv4 and IPv6 addresses.

func MakeTimestamp

func MakeTimestamp() uint64

func QueryCheck

func QueryCheck(query string) error

func Sanitize

func Sanitize(text string) string

func SanitizeIntArray

func SanitizeIntArray(valArray []string) []int

func SanitizeProto

func SanitizeProto(text string) string

func SanitizeTextArray

func SanitizeTextArray(valArray []string) []string

func YesNo

func YesNo(table string) bool

import YesNo

func YesNoPromptText

func YesNoPromptText(promptText string) bool

import YesNo

Types

type Color

type Color string

type UUID

type UUID [16]byte

func UUIDFromTime

func UUIDFromTime(aTime time.Time) UUID

UUIDFromTime generates a new time based UUID (version 1) as described in RFC 4122. This UUID contains the MAC address of the node that generated the UUID, the given timestamp and a sequence number.

func (UUID) String

func (u UUID) String() string

String returns the UUID in it's canonical form, a 32 digit hexadecimal number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.

Jump to

Keyboard shortcuts

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