lib-go

module
v0.0.0-...-06f9af8 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT

README ยถ

lib-go

A library of reusable code for my personal Go projects.

๐Ÿ’ก Motivation

When creating Go projects, there are some code blocks and keep repeating in every project. Ex: Logging, glue code, utilities, etc.

The purpose of this repo, is to provide a personal library of that shared code, so I stop having to repeat it in all the my projects.

๐Ÿ“‹ What is included

  • Logger
  • Tracing Setup with for OpenTelemetry
  • Health checks
  • Database and Migrations
  • Misc utils to work with Pointers, time and more
๐Ÿ“ฆ Dependencies

One of the great features of Go is itยดs rich standard library. This library tries to use standard library functions (Ex: net/http) to make it compatible with different projects and reduce the number of external dependencies.

Still, this is an opinionated library and some abstractions requires external dependencies. (Ex: zap for logging).

๐Ÿš€ Getting started

Install
go get github.com/brpaz/lib-go
Usage

Each package includes a README.md file generated by Gomarkdoc, with includes documentation and examples for that package.

Directories ยถ

Path Synopsis
package health provides functionality for implementing health checks in Go services.
package health provides functionality for implementing health checks in Go services.
checks
Package checks provides a set of common health checks that can be used in Go services.
Package checks provides a set of common health checks that can be used in Go services.
package httputil contains utility structs and functions for working with HTTP requests and responses.
package httputil contains utility structs and functions for working with HTTP requests and responses.
log
Package log provides a structured logging interface for Go applications.
Package log provides a structured logging interface for Go applications.
middleware
Package middleware provides a set of middleware functions for HTTP servers, related to logging, like a request logger.
Package middleware provides a set of middleware functions for HTTP servers, related to logging, like a request logger.
Package ptrutil provides utility functions for working with pointers.
Package ptrutil provides utility functions for working with pointers.
storage
db
Package timeutil contains utility functions for working with Time.
Package timeutil contains utility functions for working with Time.
Package tracing abstracts the OpenTelemetry SDK setup and provides a simple interface to interact with the OpenTelemetry API.
Package tracing abstracts the OpenTelemetry SDK setup and provides a simple interface to interact with the OpenTelemetry API.
instrumentation
Package instrumentation provides a set of helper functions to instrument code with OpenTelemetry.
Package instrumentation provides a set of helper functions to instrument code with OpenTelemetry.

Jump to

Keyboard shortcuts

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