id

package
v3.12.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(format string, a ...interface{}) string

Generate creates a UUID based on a hashed string derived from the input format and arguments. This function is used primarilty in generating the NGINX Id

Parameters:

  • format: A format string, similar to fmt.Sprintf.
  • a: Variadic arguments to be substituted into the format string.

Process:

  1. Creates a SHA-256 hash from the formatted string (using `fmt.Sprintf`).
  2. Converts the hash to a hexadecimal string.
  3. Generates an MD5-based UUID using the hashed string.

Returns:

A string representation of the generated UUID.

func GenerateMessageID

func GenerateMessageID() string

GenerateMessageID generates a unique message ID, falling back to sha256 and timestamp if UUID generation fails.

Types

type UUIDGenerator

type UUIDGenerator func() (uuid.UUID, error)

UUIDGenerator defines a function type for generating UUIDs.

Jump to

Keyboard shortcuts

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