snowid-service

command module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 15 Imported by: 0

README

snowid-service

release Docker Pulls

A simple id generation service by snowid

Usage

Environment Variable
  • BIND, address to bind, default to empty
  • PORT, port to listen, default to 8080
  • WORKER_ID, unique worker id, if not set, will guess from hostname (compatible with Kubernetes StatefulSet)
  • EPOCH, epoch of snow id in UTC, default to 2020-01-01 00:00:00
  • GRAIN, snow id grain, default to 1ms, mimimum to 1ms
  • LEADING_BIT, weather to set leading bit, default to false
Invocation
GET /healthz

OK
----------
GET /metrics

...Prometheus Metrics...
----------
GET /any/other/path?size=10

[
  "380651065730707456",
  "380651065730707457",
  "380651065730707458",
  "380651065730707459",
  "380651065730707460",
  "380651065730707461",
  "380651065730707462",
  "380651065730707463",
  "380651065730707464",
  "380651065730707465"
]

Credits

GUO YANKE, MIT License

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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