utils

package
v5.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 22 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoDecode

func AutoDecode(in []byte) ([]byte, error)

func CompareAddress

func CompareAddress(a1, a2 []*v2.Address) bool

func CompareEndpoints

func CompareEndpoints(e1, e2 *v2.Endpoints) bool

func DumpStacks

func DumpStacks() string

func FromTraceParentHeader

func FromTraceParentHeader(header string) (*trace.SpanContext, bool)

func GZIPDecode

func GZIPDecode(in []byte) ([]byte, error)

func GenClientID

func GenClientID() string

func GetMacAddress

func GetMacAddress() []byte

func GetOsDescription

func GetOsDescription() string

func GetRequestID

func GetRequestID(ctx context.Context) string

func GetenvWithDef

func GetenvWithDef(key, def string) string

func HostName

func HostName() string

func Lz4Decode

func Lz4Decode(in []byte) ([]byte, error)

func MatchMessageType

func MatchMessageType(mq *v2.MessageQueue, messageType v2.MessageType) bool

func Mod

func Mod(n int32, m int) int

func Mod64

func Mod64(n int64, m int) int

func ParseAddress

func ParseAddress(address *v2.Address) string

func ParseTarget

func ParseTarget(target string) (*v2.Endpoints, error)

func SelectAnAddress

func SelectAnAddress(endpoints *v2.Endpoints) *v2.Address

func ToTraceParentHeader

func ToTraceParentHeader(sc *trace.SpanContext) string

func ZlibDecode

func ZlibDecode(in []byte) ([]byte, error)

func ZstdDecode

func ZstdDecode(in []byte) ([]byte, error)

Types

type CompressionType

type CompressionType int32
const (
	Unknown CompressionType = 0
	GZIP    CompressionType = 1
	Zlib    CompressionType = 2
	LZ4     CompressionType = 3
	ZSTD    CompressionType = 4
)

func MatchCompressionAlgorithm

func MatchCompressionAlgorithm(in []byte) CompressionType

Jump to

Keyboard shortcuts

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