api

package
v0.47.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 1,644

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomGRPCHeaderMatcher

func CustomGRPCHeaderMatcher(key string) (string, bool)

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 Server

type Server struct {
	Router            *mux.Router
	GRPCGatewayRouter *runtime.ServeMux
	ClientCtx         client.Context
	// contains filtered or unexported fields
}

Server defines the server's API interface.

func New

func New(clientCtx client.Context, logger log.Logger) *Server

func (*Server) Close

func (s *Server) Close() error

Close closes the API server.

func (*Server) SetTelemetry added in v0.46.0

func (s *Server) SetTelemetry(m *telemetry.Metrics)

func (*Server) Start

func (s *Server) Start(cfg config.Config) error

Start starts the API server. Internally, the API server leverages Tendermint's JSON RPC server. Configuration options are provided via config.APIConfig and are delegated to the Tendermint JSON RPC server. The process is non-blocking, so an external signal handler must be used.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL