Categorygithub.com/beatlabs/patron
modulepackage
0.74.0
Repository: https://github.com/beatlabs/patron.git
Documentation: pkg.go.dev

# README

patron CI codecov Go Report Card GoDoc GitHub releaseFOSSA Status

Patron is a framework for creating microservices, originally created by Sotiris Mantzaris (https://github.com/mantzas). This fork is maintained by Beat Engineering (https://thebeat.co)

Patron is french for template or pattern, but it means also boss which we found out later (no pun intended).

The entry point of the framework is the Service. The Service uses Components to handle the processing of sync and async requests. The Service starts by default an HTTP Component which hosts the /debug, /alive, /ready and /metrics endpoints. Any other endpoints will be added to the default HTTP Component as Routes. Alongside Routes one can specify middleware functions to be applied ordered to all routes as MiddlewareFunc. The service sets up by default logging with slog, tracing and metrics with OpenTelemetry.

Patron provides abstractions for the following functionality of the framework:

  • service, which orchestrates everything
  • components and processors, which provide an abstraction of adding processing functionality to the service
    • asynchronous message processing (RabbitMQ, Kafka, AWS SQS)
    • synchronous processing (HTTP)
    • gRPC support
  • metrics and tracing
  • logging

Patron provides the same defaults for making the usage as simple as possible. Patron needs Go 1.22 as a minimum.

Code coverage

Code coverage

Table of Contents

# Packages

Package cache provides abstractions to allow the creation of concrete implementations.
No description provided by the author
No description provided by the author
Package correlation provides support for correlation id's and propagation.
Package encoding provides abstractions for supporting concrete encoding implementations.
No description provided by the author
Package observability provides functionality for initializing OpenTelemetry's traces and metrics.
No description provided by the author

# Functions

New creates a new Service instance.
WithJSONLogger to use Go's slog package.
WithLogFields options to pass in additional log fields.
WithSIGHUP adds a custom handler for handling WithSIGHUP.

# Structs

Service is responsible for managing and setting up everything.

# Interfaces

Component interface for implementing Service components.

# Type aliases

No description provided by the author