utils

package
v0.0.0-...-3c94193 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesHtohl

func BytesHtohl(b []byte) uint32

func BytesNtohl

func BytesNtohl(b []byte) uint32

func BytesNtohll

func BytesNtohll(b []byte) uint64

func BytesNtohs

func BytesNtohs(b []byte) uint16

func CertToPEMString

func CertToPEMString(cert *x509.Certificate) string

CertToPEMString taxes an x509 cert and returns a PEM encoded string version.

func ExecCmd

func ExecCmd(cmdName string, args ...string) (string, string, error)

func FileExists

func FileExists(name string) bool

func HashByteToUint64

func HashByteToUint64(data []byte) uint64

func IPv4Ntoa

func IPv4Ntoa(ip uint32) string

Ipv4_Ntoa transforms an IP4 address in it's dotted notation

func LoadPlugins

func LoadPlugins(path string, funcName string, skipError bool) (map[string]plugin.Symbol, error)

func ModularByte

func ModularByte(data []byte, mod uint64) uint64

func NewLogger

func NewLogger(logLevel string, prod bool) (*zap.Logger, error)

func ParseInteger

func ParseInteger(intStr string, defaultValue int) int

func RandomBytes

func RandomBytes(length int) ([]byte, error)

RandomBytes return a slice of random bytes of the defined length

func ReadString

func ReadString(s []byte) (string, error)

ReadString extracts the first null terminated string from a slice of bytes.

func RstripSpace

func RstripSpace(buf []byte) []byte

func ToJSON

func ToJSON(data []byte) (map[string]interface{}, error)

func VerifyRequires

func VerifyRequires(params map[string]string, requires []string) error

func WaitForSignals

func WaitForSignals(callback func(os.Signal), sigs ...os.Signal)

Types

This section is empty.

Jump to

Keyboard shortcuts

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