Datastore is a generic layer of abstraction for data store and database access. It is a simple API with the aim to enable application development in a datastore-agnostic way, allowing datastores to be swapped seamlessly without changing application code. Thus, one can leverage different datastores with different strengths without committing the application to one datastore throughout its lifetime.
Datastore is a generic layer of abstraction for data store and database access. It is a simple API with the aim to enable application development in a datastore-agnostic way, allowing datastores to be swapped seamlessly without changing application code. Thus, one can leverage different datastores with different strengths without committing the application to one datastore throughout its lifetime.
Package errors provides a robust error handling library with support for error wrapping, stack traces, context storage, and retry mechanisms. It extends the standard library's error interface with features like HTTP-like status codes, error categorization, and JSON serialization, while maintaining compatibility with `errors.Is`, `errors.As`, and `errors.Unwrap`. The package is thread-safe and optimized with object pooling for performance.
This package provides Go libraries that are shared across Prometheus components.
config- common configuration structuresexpfmt- decoding and encoding for the exposition formatmodel- shared data structurespromslog- a logging wrapper around log/slogroute- a routing wrapper around httprouter using context.Contextserver- common serversversionversion information and metrics
ChunkReader is a io.Reader wrapper that minimizes IO reads and memory allocations. It allocates memory in chunks and will read as much as will fit in the current buffer in a single call regardless of how large a read is actually requested. The memory returned via Next is owned by the caller. This avoids the need for an additional copy. It extracted from original implementation in https://github.com/jackc/pgx.
Suture provides Erlang-ish supervisor trees for Go. "Supervisor trees" -> "sutree" -> "suture" -> holds your code together when it's trying to die.
It is intended to deal gracefully with the real failure cases that can occur with supervision trees (such as burning all your CPU time endlessly restarting dead services), while also making no unnecessary demands on the "service" code, and providing hooks to perform adequate logging with in a production environment
DHCPv4 and DHCPv6 decoding/encoding library for Golang. This package is split in several logical parts:
dhcpv4- implementation of DHCPv4 packet, client and servernetboot- network booting wrappers on top of dhcpv6 and dhcpv4iana- several IANA constants, and helpers used by dhcpv6 and dhcpv4rfc1035label- simple implementation of RFC1035 labels, used by dhcpv6 and dhcpv4interfaces- a thin layer of wrappers around network interfaces
Ironwood is a routing library with a net.PacketConn-compatible interface using ed25519.PublicKeys as addresses. Basically, you use it when you want to communicate with some other nodes in a network, but you can't guarantee that you can directly connect to every node in that network. It was written to test improvements to / replace the routing logic in Yggdrasil, but it may be useful for other network applications.
This package provides a library for calling C functions from Go without Cgo.
Featues:
build for other platforms easily without a C compiler
efficiently cache entirely Go builds
using Cgo generates a C wrapper function for each C function called
load symbols at runtime and use it as a plugin system
call into other languages that are compiled into shared objects
works even with
CGO_ENABLED=1so incremental porting is possible
Package netns allows ultra-simple network namespace handling. NsHandles can be retrieved and set. Note that the current namespace is thread local so actions that set and reset namespaces should use LockOSThread to make sure the namespace doesn't change due to a goroutine switch. It is best to close NsHandles when you are done with them. This can be accomplished via a `defer ns.Close()` on the handle. Changing namespaces requires elevated privileges, so in most cases this code needs to be run as root.
BunRouter is a fast HTTP router for Go with unique combination of features:
middlewares allow to extract common operations from HTTP handlers into reusable functions
error handling allows to further reduce the size of HTTP handlers by handling errors in middlewares
routes priority enables meaningful matching priority for routing rules: first static nodes, then named nodes, lastly wildcard nodes
net/httpcompatible API which means using minimal API without constructing huge wrappers that try to do everything: from serving static files to XML generation (for example,gin.Contextorecho.Context)
Accelerate SHA256 computations in pure Go using AVX512 and AVX2 for Intel and ARM64 for ARM. On AVX512 it provides an up to 8x improvement (over 3 GB/s per core) in comparison to AVX2.
This package is designed as a replacement for crypto/sha256. For Intel CPUs it has two flavors for AVX512 and AVX2 (AVX/SSE are also supported). For ARM CPUs with the Cryptography Extensions, advantage is taken of the SHA2 instructions resulting in a massive performance improvement.
This package uses Golang assembly. The AVX512 version is based on the Intel's "multi-buffer crypto library for IPSec" whereas the other Intel implementations are described in "Fast SHA-256 Implementations on Intel Architecture Processors" by J. Guilford et al.
This source package is a collection of utilities intended to make it easier for Go programs to work with System Package Data Exchange files. It currently works with files conformant to versions 2.1, 2.2 and 2.3 of the SPDX specification and provides the following packages:
spdx - in-memory data model for the sections of an SPDX document
tagvalue - tag-value document reader and writer
rdf - RDF document reader
json - JSON document reader and writer
yaml - YAML document reader and writer
builder - builds empty SPDX document (with hashes) for directory contents
idsearcher - searches for SPDX short-form IDs and builds an SPDX document
licensediff - compares concluded licenses between files in two packages
reporter - generates basic license count report from an SPDX document
spdxlib - various utility functions for manipulating SPDX documents in memory
utils - various utility functions that support the other tools-golang packages
Package archiver facilitates convenient, cross-platform, high-level archival and compression operations for a variety of formats and compression algorithms.
Features:
stream-oriented APIs
automatically identify archive and compression formats
traverse directories, archive files, and any other file uniformly as
io/fsfile systemscompress and decompress files
create and extract archive files
walk or traverse into archive files
extract only specific files from archives
insert (append) into .tar and .zip archives
read from password-protected 7-Zip files
numerous archive and compression formats supported
extensible (add more formats just by registering them)
cross-platform, static binary
pure Golang (no cgo)
multithreaded Gzip
adjust compression levels
automatically add compressed files to zip archives without re-compressing
open password-protected rar archives
Supported compression formats:
brotli (.br)
bzip2 (.bz2)
flate (.zip)
gzip (.gz)
lz4 (.lz4)
lzip (.lz)
snappy (.sz)
xz (.xz)
zlib (.zz)
zstandard (.zst)
Supported archive formats:
.zip
.tar (including any compressed variants like .tar.gz)
.rar (read-only)
.7z (read-only)
Package aurora implements ANSI-colors
compress provides various compression algorithms.
This package provides generic implementations for Go.
Package strcase converts strings to various cases.
This package provides a statistical library for Golang.
This package implements column-formatted output for Golang.
Package sortorder implements sort orders and comparison functions.
This package provides additions to Go's stdlib testing.
This package provides additions to Go's stdlib testing.