Skip to content
nbgrpPublic

About

Useful go modules

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

pkg

A collection of small, standalone Go packages.

Every package is a separate Go module with its own dependencies, so importing one of them does not pull anything else in.

Modules

Module Description
closer Collection of cleanup functions, run once — explicitly, or on a context cancel or an OS signal.
ctxkey Unique, pointer-backed context keys.
deferred Helpers for the defer calls.
dispatcher Routing of keyed events to handlers, with priorities, propagation control and wildcards.
prommetrics Registration of the Prometheus collectors and the context-aware creation of the metrics.
protomap Deserialization of protobuf messages by their descriptor name.
slogger A log/slog logger with a configurable format, a hot-reloadable level and context helpers.
slogger/grpcslog A grpclog.LoggerV2 implementation that writes the gRPC messages to the logger.
strcase Detection of the case of a string and conversion between the case styles.
sync A sync.Once that keeps retrying until the guarded function succeeds.
time A duration type that is serialized as a human-readable string.

Each module has its own README with the description of the API and the examples of the usage.

Usage

The packages are imported by their module path:

import (
    "github.com/nbgrp/pkg/closer"
    "github.com/nbgrp/pkg/strcase"
)

License

BSD 3-Clause

About

Useful go modules

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages