Categorygithub.com/autom8ter/grpcx
modulepackage
0.11.2
Repository: https://github.com/autom8ter/grpcx.git
Documentation: pkg.go.dev

# README

gRPCX

GoDoc

gRPCX is a framework for building enterprise-grade Saas applications with gRPC. It is meant to be a batteries-included framework for building enterprise-grade gRPC services.

go get github.com/autom8ter/grpcx

Features

  • gRPC
  • gRPC-gateway
  • Serve Gateway/gRPC same port(cmux)
  • Flexible Provider/Interface based architecture: use the same code with different providers depending on tech stack
  • Metrics(prometheus)
  • File Storage dependency injection(local, gcs)
  • Structured Logging(slog)
  • Database Migrations(golang-migrate)
  • Database dependency injection(sqlite,mysql,postgres)
  • Cache dependency injection(redis)
  • Stream dependency injection(redis,nats)
  • Email dependency injection(smtp)
  • Payment Processing dependency injection(stripe)
  • Context Tagging Middleware/Interceptor
  • Authentication with protoc-gen-authenticate
  • Authorization with protoc-gen-authorize
  • Rate-limiting with protoc-gen-ratelimit
  • Request Validation with protoc-gen-validate
  • Compatible with protoc-gen-validate
  • Flexible configuration(viper)
  • Graceful Shutdown
  • Panic Recovery middleware/interceptor
  • CORS middleware(for gRPC-gateway)
  • Can be run completely in-memory for testing

Other gRPC Projects

TODO

  • Add more tests
  • Add more examples
  • Add more documentation
  • Add kafka stream provider
  • Add rabbitmq stream provider
  • Add sendgrid email provider
  • Add mailgun email provider
  • Add tracing support

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

NewServer creates a new server with the given config and options.
WithAuth adds an auth provider to the server (see github.com/autom8ter/protoc-gen-authenticate) If no selectors are provided, the auth provider will be used for all requests This method can be called multiple times to add multiple auth providers.
WithAuthz adds an authorizer to the server (see github.com/autom8ter/protoc-gen-authorize) This method can be called multiple times to add multiple authorizers Options can be added to add a userExtractor and selectors.
WithCache adds a cache provider.
WithCors adds cors middleware to the rest-gateway.
WithCustomHTTPRoute adds a custom http route to the rest-gateway.
WithDatabase adds a database provider.
WithEmail adds an email provider.
WithGatewayOpts adds options to the grpc gateway.
WithGrpcHealthCheck adds a grpc health check to the server.
WithLogger adds a logging provider.
WithMetrics adds a metrics provider to the server.
WithPaymentProcessor adds a payment processor to the server.
WithRateLimit adds a rate limiter to the server (see protoc-gen-ratelimit) If no selectors are provided, the rate limiter will be used for all requests This method can be called multiple times to add multiple rate limiters.
WithStorage adds a storage provider.
WithStream adds a stream provider.
WithStreamInterceptors adds interceptors to the grpc server.
WithTagsProvider adds a context tagger to the server.
WithUnaryInterceptors adds unary interceptors to the server.
WithValidation enables grpc validation interceptors for validating requests.

# Structs

CustomHTTPRoute is a custom route that can be added to the rest-gateway.
Server is a highly configurable grpc server with a built-in rest-gateway(grpc-gateway) The server supports the following features via ServerOptions: - Logging Interface (slog) - Metrics Interface (prometheus) - Database Interface (sqlite/mysql/postgres) - Cache Interface (redis) - Stream Interface (nats/redis) - Context Tags - Authentication (see github.com/autom8ter/protoc-gen-authenticate) - Authorization (see github.com/autom8ter/protoc-gen-authorize) - Rate Limiting (see github.com/autom8ter/protoc-gen-ratelimit).
ServiceRegistrationConfig is the config passed to a service registration function.

# Interfaces

Service is a an interface that registers a service with the server.

# Type aliases

ServerOption is a function that configures the server.
ServiceRegistration is a function that registers a service with the server.