util

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BS16

func BS16(v uint16) uint16

func BS32

func BS32(v uint32) uint32

func ConvertIPToUint32

func ConvertIPToUint32(ip net.IP) uint32

func ConvertUint32ToIP

func ConvertUint32ToIP(nn uint32) net.IP

func FileUnmarshalAsYaml

func FileUnmarshalAsYaml(in string, v interface{}) error

func GetClangVersion

func GetClangVersion() (string, error)

GetClangVersion returns the version string of clang as semver-formant This string format can be compared by semver buitin package. ref: // https://pkg.go.dev/golang.org/x/mod/semver#Major clang may not work well because version output results may differ depending on the platform.

DOCKER-TESTED: [centos:centos7, ubuntu:22.04, fedora:37]

func GetIproute2Version

func GetIproute2Version() (string, string, error)

func GetKernelVersion

func GetKernelVersion() (string, error)

func KtimeToReal

func KtimeToReal(ktime uint64) (uint64, error)

func KtimeToRealMilli

func KtimeToRealMilli(ktimeMilli uint64) (uint64, error)

func KtimeToRealNano

func KtimeToRealNano(ktime uint64) (uint64, error)

func LocalExecute

func LocalExecute(cmd string) (string, error)

func LocalExecutef

func LocalExecutef(fs string, a ...interface{}) (string, error)

func NewCmdCompletion

func NewCmdCompletion(rootCmd *cobra.Command) *cobra.Command

func NewCommandVersion added in v0.0.4

func NewCommandVersion() *cobra.Command

func NewTableWriter

func NewTableWriter(writer io.Writer) *tablewriter.Table

func SetLocalExecuteSilence

func SetLocalExecuteSilence(v bool)

func TimeNow

func TimeNow() uint64

func TimeNowNano

func TimeNowNano() uint64

func UdpTransmit

func UdpTransmit(local, remote string, buf *bytes.Buffer) error

func VersionBuildDate added in v0.0.4

func VersionBuildDate() string

VersionBuildDate returns date when your binary is built

func VersionGitBranch added in v0.0.4

func VersionGitBranch() string

VersionGitBranch returns current Git branch name

func VersionGitSHA added in v0.0.4

func VersionGitSHA() string

VersionGitSHA returns Git hash string

func VersionGitTag added in v0.0.4

func VersionGitTag() string

VersionGitTag returns Git tag string

Types

This section is empty.

Jump to

Keyboard shortcuts

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