id

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOrderedID

func NewOrderedID() uint64

单机顺序id

func UniqueID

func UniqueID() string

Types

type RandomID

type RandomID [16]byte

func NewRandomID

func NewRandomID() RandomID

func (RandomID) IsValid

func (t RandomID) IsValid() bool

IsValid checks whether the trace TraceID is valid. A valid trace ID does not consist of zeros only.

func (RandomID) MarshalJSON

func (t RandomID) MarshalJSON() ([]byte, error)

MarshalJSON implements a custom marshal function to encode TraceID as a hex string.

func (RandomID) String

func (t RandomID) String() string

String returns the hex string representation form of a TraceID.

Jump to

Keyboard shortcuts

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