Documentation ¶
Overview ¶
Package grpcgateway utilizes the global gogoproto registry to create dynamic query handlers on net/http's mux router.
Header `x-cosmos-block-height` allows you to specify a height for the query.
Requests that do not have a dynamic handler registered will be routed to the canonical gRPC-Gateway mux.
Index ¶
Constants ¶
const GRPCBlockHeightHeader = "x-cosmos-block-height"
GRPCBlockHeightHeader is the gRPC header for block height.
const MaxBodySize = 1 << 20 // 1 MB
const ServerName = "grpc-gateway"
Variables ¶
This section is empty.
Functions ¶
func CustomGRPCHeaderMatcher ¶
CustomGRPCHeaderMatcher for mapping request headers to GRPC metadata. HTTP headers that start with 'Grpc-Metadata-' are automatically mapped to gRPC metadata after removing prefix 'Grpc-Metadata-'. We can use this CustomGRPCHeaderMatcher if headers don't start with `Grpc-Metadata-`
Types ¶
type CfgOption ¶
type CfgOption func(*Config)
func OverwriteDefaultConfig ¶
OverwriteDefaultConfig overwrites the default config with the new config.
type Config ¶
type Config struct { // Enable defines if the gRPC-Gateway should be enabled. Enable bool `mapstructure:"enable" toml:"enable" comment:"Enable defines if the gRPC-Gateway should be enabled."` // Address defines the address the gRPC-Gateway server binds to. Address string `mapstructure:"address" toml:"address" comment:"Address defines the address the gRPC-Gateway server binds to."` }
func DefaultConfig ¶
func DefaultConfig() *Config
type Server ¶
type Server[T transaction.Tx] struct { GRPCGatewayRouter *runtime.ServeMux // contains filtered or unexported fields }
func New ¶
func New[T transaction.Tx]( logger log.Logger, config server.ConfigMap, ir jsonpb.AnyResolver, appManager appmanager.AppManager[T], cfgOptions ...CfgOption, ) (*Server[T], error)
New creates a new gRPC-Gateway server.
func NewWithConfigOptions ¶
func NewWithConfigOptions[T transaction.Tx](opts ...CfgOption) *Server[T]
NewWithConfigOptions creates a new gRPC-gateway server with the provided config options.