gogarage

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 0 Imported by: 0

README

PkgGoDev License

go-garage

The framework for fast creating microservice with logger, http, db, metrics, queues

Purposes

For fast creating simple microservices, without designing architecture, with simple config.

Features

go-garage supports:

  • databases:
  • caches:
    • redis
  • opcua:
  • metrics (each may be extended in user service):
    • alive handler
    • ready handler (includes communicate with databases and cache)
    • prometheus metrics (includes communicate with databases and cache, current cache size, database metrics from sql.DBStats)
  • config parser based on vrischmann/envconfig
  • http servers (with swagger):
    • router (labstack/echo)(github.com/labstack/echo)
  • logger based (rs/zerolog)[github.com/rs/zerolog]
  • http clients pool
  • service meta informations
  • wrapper for cli based on spf13/cobra
  • utils for strings and time
  • null types (nullmeta, nullstring, nulltime)

How it works

Databases, cache, metrics, config parsers, logger, http servers all of it is providers in go-garage. All providers stored in special object Providers in contex.Context.
For user code used domains, they stored in special object Domains in contex.Context.
When you initilize your service you must add all providers and domains in context (funcs with prefix Registrate) after it you can get any object from context (funcs with prefix Get).
All providers have config structures which can be automated parsed by config parser for getting parameters from environment.
The framework supports swagger specifiation. In each REST API handler you can add swagger description via soldatov-s/go-swagger

Example

You can find example of using go-garage in go-garage-example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GarageItem

type GarageItem string

Directories

Path Synopsis
clients
crypto
db
x
rejson
Based on KromDaniel/rejonson Based on KromDaniel/rejonson Based on KromDaniel/rejonson
Based on KromDaniel/rejonson Based on KromDaniel/rejonson Based on KromDaniel/rejonson
sql

Jump to

Keyboard shortcuts

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