Skip to content
/ go-bits Public

Tiny Go libraries that I keep copying between projects

License

Notifications You must be signed in to change notification settings

sapcc/go-bits

Folders and files

NameName
Last commit message
Last commit date
Mar 25, 2025
Jan 9, 2025
Jan 9, 2025
Feb 4, 2025
Aug 19, 2024
Jan 3, 2025
Apr 3, 2025
Sep 18, 2024
Feb 20, 2025
Feb 20, 2025
Dec 6, 2024
Feb 20, 2025
Feb 17, 2025
Mar 21, 2024
Mar 21, 2024
Aug 3, 2022
Jan 9, 2025
Mar 21, 2024
Aug 23, 2024
Apr 7, 2025
Mar 21, 2024
Mar 21, 2024
Mar 21, 2024
Oct 6, 2023
Apr 3, 2025
Mar 25, 2025
Jan 15, 2025
Jun 20, 2022
Mar 25, 2025
Apr 4, 2025
Mar 17, 2025
Jul 9, 2018
Mar 31, 2025
Apr 4, 2024
Jan 9, 2025
Dec 6, 2024
Apr 10, 2025
Apr 10, 2025
Feb 14, 2025

Repository files navigation

go-bits

GoDoc

Some tiny pieces of Go code, extracted from their original applications for reusability. Feel free to add to this.

Packages

  • assert contains various assertions for unit tests.
  • audittools contains a microframework for establishing a connection to a RabbitMQ server (with sane defaults) and publishing messages to it.
  • easypg is a database library for applications that use PostgreSQL. It integrates golang-migrate/migrate for data definition and imports the libpq-based SQL driver.
  • errext contains convenience functions for handling and propagating errors.
  • gophercloudext contains convenience functions for use with Gophercloud. It is specifically intended as a lightweight replacement for gophercloud/utils with fewer dependencies.
  • gopherpolicy integrates Gophercloud with goslo.policy, for OpenStack services that need to validate client tokens and check permissions.
  • httpapi contains opinionated base machinery for assembling and exposing an API consisting of HTTP endpoints.
  • httpext adds some convenience functions to net/http.
  • httptest builds on net/http/httptest to make process-local HTTP requests inside tests as smooth as possible.
  • jobloop contains the Job trait, which abstracts over reusable implementations of worker loops.
  • liquidapi contains a server runtime and various other utilities for microservices implementing the LIQUID API.
  • logg adds some convenience functions to log.
  • mock contains basic mocks and test doubles.
  • must contains convenience functions for quickly exiting on fatal errors without the need for excessive if err != nil.
  • osext contains extensions to the standard library package "os", mostly relating to parsing of environment variables.
  • pluggable is a tiny plugin factory library, for constructing different objects implementing a common interface based on a configurable type selector.
  • promquery provides a simplified interface for executing Prometheus queries.
  • regexpext contains convenience functions for marshalling regexes to and from string values in YAML and JSON documents.
  • respondwith contains some helper functions for generating responses in HTTP handlers.
  • secrets provides convenience functions for working with auth credentials.
  • sqlext contains helper functions for SQL queries that are not specific to PostgreSQL.
  • vault contains helper functions to work with HashiCorp Vault.

Tools

The tools subdirectory contains small Go programs.

About

Tiny Go libraries that I keep copying between projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages