add protovalidate support

This commit is contained in:
2025-07-21 16:53:40 -04:00
parent 41d539a607
commit 31fc6dca16
6 changed files with 75 additions and 9 deletions

View File

@ -1,3 +1,7 @@
// Package config provides types and methods for managing
// app config. A go-app configuration can be extended by any type
// that embeds AppConfig, and has helpers to generate json
// schema merged with the custom type's fields
package config
import (

View File

@ -13,6 +13,7 @@ type GRPCConfig struct {
Enabled bool `yaml:"enabled" env:"APP_GRPC_ENABLED" json:"enabled,omitempty"`
Listen string `yaml:"listen" env:"APP_GRPC_LISTEN" json:"listen,omitempty"`
LogRequests bool `yaml:"logRequests" env:"APP_GRPC_LOG_REQUESTS" json:"logRequests,omitempty"`
EnableProtovalidate bool `yaml:"enableProtovalidate" env:"APP_GRPC_ENABLE_PROTOVALIDATE" json:"enableProtovalidate,omitempty" default:"false" description:"Add a chain unary and streaming interceptor for buf.build/go/protovalidate"`
EnableReflection bool `yaml:"enableReflection" env:"APP_GRPC_ENABLE_REFLECTION" json:"enableReflection,omitempty"`
EnableInstrumentation bool `yaml:"enableInstrumentation" env:"APP_GRPC_ENABLE_INSTRUMENTATION" json:"enableInstrumentation,omitempty"` // requires OTEL
EnableGRPCGateway bool `yaml:"enableGRPCGateway" json:"enableGRPCGateway,omitempty" env:"APP_GRPC_ENABLE_GATEWAY" default:"true"`