util

package
v2.0.0-alpha56 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Emoji = "\U0001F430" + " Keploy:"

Functions

func AdaptiveK

func AdaptiveK(length, kMin, kMax, N int) int

func ConvertIPv6ToUint32Array

func ConvertIPv6ToUint32Array(ip net.IP) ([4]uint32, error)

func ConvertToIPV4

func ConvertToIPV4(ip net.IP) (uint32, bool)

func CreateShingles

func CreateShingles(data []byte, k int) map[string]struct{}

func CreateYamlFile

func CreateYamlFile(path string, fileName string, Logger *zap.Logger) (bool, error)

createYamlFile is used to create the yaml file along with the path directory (if does not exists)

func GetLocalIPv4

func GetLocalIPv4() (net.IP, error)

func GetLocalIPv6

func GetLocalIPv6() (net.IP, error)

func IPToDotDecimal

func IPToDotDecimal(ip net.IP) string

func IsDockerRelatedCommand

func IsDockerRelatedCommand(cmd string) (bool, string)

It checks if the cmd is related to docker or not, it also returns if its a docker compose file

func JaccardSimilarity

func JaccardSimilarity(setA, setB map[string]struct{}) float64

JaccardSimilarity computes the Jaccard similarity between two sets of shingles.

func Passthrough

func Passthrough(clientConn, destConn net.Conn, requestBuffer [][]byte, recover func(id int), logger *zap.Logger) ([]byte, error)

func PeekBytes

func PeekBytes(reader *bufio.Reader) ([]byte, error)

func ReadBuffConn

func ReadBuffConn(conn net.Conn, bufferChannel chan []byte, errChannel chan error, logger *zap.Logger) error

func ReadBytes

func ReadBytes(reader io.Reader) ([]byte, error)

ReadBytes function is utilized to read the complete message from the reader until the end of the file (EOF). It returns the content as a byte array.

func ToIP4AddressStr

func ToIP4AddressStr(ip uint32) string

ToIP4AddressStr converts the integer IP4 Address to the octet format

func ToIPv6AddressStr

func ToIPv6AddressStr(ip [4]uint32) string

func ValidatePath

func ValidatePath(path string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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