Skip to content

greghart/powerputtygo

Repository files navigation

powerputty

powerputty Go is a collection of general use packages, to help build web services with Golang.

powerputty is built as a multi-module workspace. All packages are appended with p to help avoid naming collisions (eg. don't collide with stdlib sql package, use sqlp or "SQL Putty")

I'm also just using it as a central place to keep my learnings and knowledge in a structured place.

Packages

  • Persistence layer
    • A primary goal here is to avoid becoming an ORM. There should be relatively little magic; we are building composable tools, not prescribing an ORM solution
    • sqlp SQL extensions
    • queryp Helpers to write SQL queries more cleanly
    • mapperp Map flat rows of data into domain models, "orm lite"
  • servicep Web service utilities to help your REST / gRPC / other APIs.
  • clientp Convenient helpers for consuming (ie. being a client)
  • utilp More general utilities, eg. basic generic map function
  • errcmp error matcher for tests
    • (source)
    • slight addition for extra context

Observability

Logging

When applicable, all packages take in a slog.Logger instance to customize logging. By default, only logs to slog.LevelDebug.

Metrics

When applicable, powerputty packages will take Metric interfaces that align with prometheus metric types.

  • MetricCounter -- corresponds to prometheus.NewCounter
  • MetricHistogram -- corresponds to prometheus.NewHistogram

About

Power putty is used to strengthen your hands and improve flexibility, but for Golang!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages