utils

package
v5.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 25 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 CompareAssignment added in v5.1.3

func CompareAssignment(a *v2.Assignment, b *v2.Assignment) bool

func CompareAssignments added in v5.1.3

func CompareAssignments(a *[]*v2.Assignment, b *[]*v2.Assignment) bool

func CompareBroker added in v5.1.3

func CompareBroker(a *v2.Broker, b *v2.Broker) bool

func CompareEndpoints

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

func CompareMessageQueue added in v5.1.3

func CompareMessageQueue(a *v2.MessageQueue, b *v2.MessageQueue) bool

func CompareResource added in v5.1.3

func CompareResource(a *v2.Resource, b *v2.Resource) bool

func CountSyncMapSize added in v5.1.3

func CountSyncMapSize(m *sync.Map) int32

func DumpStacks

func DumpStacks() string

func EndpointsToString added in v5.1.3

func EndpointsToString(endpoints *v2.Endpoints) 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 GetNextAttemptDelay added in v5.1.3

func GetNextAttemptDelay(retryPolicy *v2.RetryPolicy, attempt int) time.Duration

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 IsAssignmentsEmpty added in v5.1.3

func IsAssignmentsEmpty(a *[]*v2.Assignment) bool

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

type MessageQueueStr added in v5.1.3

type MessageQueueStr string

func ParseMessageQueue2Str added in v5.1.3

func ParseMessageQueue2Str(m *v2.MessageQueue) MessageQueueStr

Jump to

Keyboard shortcuts

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