ex
ex copied to clipboard
Common Go packages for the execution teams
Go service building blocks
This repository contains a collection of packages designed to aid building reliable, observable, zero-downtime services using Go.
Documentation
Browse the docs at pkg.go.dev. See example / template repo here.
What is in here?
config/o11yWiring code for theo11ypackage.config/secretDon't store your secrets in a string that can be accidentally logged. Use asecret.Stringinstead.datadogA basic Datadog API client for retrieving metrics back from Datadog.dbCommon patterns using when talking to an RDBMS. Only supports PostgreSQL at present.httpclientA simple HTTP client that adds observability and resilience to the standard Go HTTP client.httpclient/dnscacheA simple DNS cache for use with the HTTP client.httpserverStarting and stopping the standard Go http server cleanly.httpserver/ginrouterA common base for configuring a Gin router instance.httpserver/healthcheckA healthcheck HTTP server that can accept all the checks from asystem.mongoexExperimental Common patterns using when talking to MongoDB.o11yObservability that is currently backed by Honeycomb. It also supports outputting trace data as JSON and plain or colored text output.o11y/honeycombThe honeycomb-backed implementation ofo11y.o11y/wrappers/o11ygino11ymiddleware for the Gin router.o11y/wrappers/o11ynethttpo11ymiddleware for the standard Go HTTP server.rabbitExperimental RabbitMQ publishing client.redisWiring and observability for Redis.systemManage the startup, running, metrics and shutdown of a Go service.releases/compilerCompile your Go binaries in a consistent way.releases/releaserRelease your Go binaries in a consistent way.terminationA handler to aid signal based service termination. (Used internally by thesystempackage).testing/compilerAt CircleCI we aim to acceptance test whole compiled binaries. This package lets us do that.testing/dbfixtureGet a resettable unique database for each test.testing/downloadDownload releases of binaries for using in end to end service testing.testing/fakemetricsA fake recordingo11ymetrics implementation.testing/fakestatsdA recording statsd server that will listen on a local UDP port.testing/httprecorderRecord HTTP requests inside an HTTP server, and search them.testing/kongtestIf you are using kong for your CLI parsing, this helps in writing golden tests for the CLI definition.testing/miniofixtureGet a temporary bucket to put your objects in.testing/mongofixtureGet an isolated Mongo database for your tests, so they don't interfere.testing/rabbitfixtureGet an isolated RabbitMQ VHost for your tests, so they don't interfere.testing/redisfixtureGet an isolated Redis DB for your tests, so they don't interfere.testing/releasesHelper to determine which binaries to download for end to end tests.testing/runnerRun a binary in an acceptance test (scan output for ports, wait for start).testing/testcontextSetup a background context that includeso11y.workerRun a service worker loop with observability and back-off for no work found.
Who is this for?
These packages are intended to be used internally at CircleCI. While this code is licenced permissively with an MIT licence, this is not a true "open source" project, in that there is no active community using it.
No guaranteed API stability
While we do not intentionally aim to break compatibility, we make no promises that we will maintain a stable API if there are good reasons to break it.