patron

Microservice framework following best cloud practices with a focus on productivity.


Project maintained by beatlabs Hosted on GitHub Pages — Theme by mattgraham

Architecture

Patron has two basic concepts:

Component

A Component implements the following interface:

type Component interface {
  Run(ctx context.Context) error  
}

This allows a Service to start and then gracefully shutdown a Component via context cancellation.
The framework distinguishes between two types of components:

The following component implementations are available:

Service

The Service has the role of gluing all the above together:

The service has some default settings which can be changed via environment variables:

The service provides also the option to bypass the legacy created HTTP component and use the new v2 component. This will effectively disable the default legacy HTTP component.

err = service.WithRouter(router).WithSIGHUP(sig).Run(ctx)
    if err != nil {
    log.Fatalf("failed to create and run service %v", err)
}

This above builder extension is temporary until we fully replace the legacy HTTP component with our v2 component.