instance

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

README

server/instance

Import path: github.com/InsideGallery/core/server/instance

instance exposes stable identifiers for the current process instance.

Main APIs

  • GetInstanceID() string: returns the package-level unique instance ID.
  • GetShortInstanceID() string: lazily returns a short instance ID.

Usage

slog.Info("serving request",
	"instance_id", instance.GetInstanceID(),
	"siid", instance.GetShortInstanceID(),
)

Operational Notes

The full instance ID is initialized when the package is loaded. The short ID is initialized once on first use with sync.Once; if short ID generation fails, the error is logged and the returned value can be empty.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInstanceID

func GetInstanceID() string

GetInstanceID return current instance id

func GetShortInstanceID

func GetShortInstanceID() string

GetShortInstanceID return current short instance id

Types

This section is empty.

Jump to

Keyboard shortcuts

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