go
package grpcmw

import (
  "context"
  "time"

gRPC unary interceptor for auth and timing logs

go grpc observability
by Leah Thompson 1 tab
go
package middleware

import (
  "context"
  "net/http"
  "strings"

JWT verification with cached JWKS (handles key rotation)

go http security
by Leah Thompson 1 tab
go
package api

import (
  "io"
  "net/http"
  "os"

Safe multipart uploads using temp files (bounded memory)

go http uploads
by Leah Thompson 1 tab
go
package api

import (
  "encoding/json"
  "errors"
  "io"

Streaming JSON decoding with DisallowUnknownFields

go http json
by Leah Thompson 1 tab
go
package middleware

import (
  "compress/gzip"
  "net/http"
  "strings"

Gzip compression middleware with correct Vary header

go http middleware
by Leah Thompson 1 tab
go
package middleware

import (
  "net/http"

  "go.uber.org/zap"

Panic recovery middleware for HTTP servers

go http middleware
by Leah Thompson 1 tab
go
package domain

import (
  "errors"
  "fmt"
)

Error wrapping that stays inspectable with errors.Is and errors.As

go errors api
by Leah Thompson 1 tab
go
package health

import (
  "context"
  "net"
  "net/http"

Readiness and liveness probes with dependency checks

go http kubernetes
by Leah Thompson 1 tab
go
package paging

import (
  "encoding/base64"
  "encoding/json"
  "time"

Cursor pagination: opaque tokens with stable ordering

go api pagination
by Leah Thompson 1 tab
go
package cache

import (
  "context"
  "sync"
  "time"

Singleflight cache fill to prevent thundering herd

go cache concurrency
by Leah Thompson 1 tab
go
package deps

import (
  "net"
  "net/http"
  "time"

HTTP client tuned for production: timeouts, transport, and connection reuse

go http client
by Leah Thompson 1 tab
go
package store

import (
  "context"

  "github.com/jackc/pgx/v5"

Postgres transaction pattern with pgx: defer rollback, commit explicitly

go postgres pgx
by Leah Thompson 1 tab