api

package
v0.46.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

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) 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