helpers

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: MIT Imports: 7 Imported by: 4

Documentation

Overview

Package helpers implements the functions, types, and interfaces for the module.

Package helpers for toolkits

Package helpers implements the functions, types, and interfaces for the module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToUint64

func BytesToUint64(buf []byte) []uint64

BytesToUint64 converts a byte slice to a slice of uint64 values. Each 8 bytes in the byte slice are decoded as a single uint64 value in big-endian order. The resulting slice of uint64 values can be used to retrieve the original uint64 values from the byte slice.

Parameters: - buf: a byte slice containing the encoded uint64 values.

Returns: - a slice of uint64 values decoded from the byte slice.

func DurationToInt64 added in v0.3.2

func DurationToInt64(duration time.Duration) int64

func Int64ToDuration added in v0.3.2

func Int64ToDuration(seconds int64) time.Duration

Int64ToDuration converts an integer value to a time.Duration type.

func ServiceDiscovery added in v0.3.2

func ServiceDiscovery(serviceName string) string

ServiceDiscovery ...

func ServiceDiscoveryEndpoint added in v0.0.92

func ServiceDiscoveryEndpoint(endpoint, scheme, host, addr string) string

ServiceDiscoveryEndpoint ... Deprecated: use ServiceEndpoint

func ServiceEndpoint added in v0.1.6

func ServiceEndpoint(scheme, host, hostPort string) (string, error)

ServiceEndpoint get the local ip address and port Deprecated: move to runtime.service

func ServiceName added in v0.1.6

func ServiceName(serviceName string) string

ServiceName ... Deprecated: use ServiceDiscovery

func Uint64ToBytes

func Uint64ToBytes(ints ...uint64) []byte

Uint64ToBytes converts a slice of uint64 values to a byte slice. Each uint64 value is encoded as 8 bytes in big-endian order. The resulting byte slice can be used to store the uint64 values in a binary format.

Parameters: - ints: a slice of uint64 values to be converted to bytes.

Returns: - a byte slice containing the encoded uint64 values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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