lcd

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0, Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomGRPCHeaderMatcher added in v1.3.0

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

func ServeCommand

func ServeCommand(cdc *codec.CodecProxy, interfaceReg jsonpb.AnyResolver, registerRoutesFn func(*RestServer)) *cobra.Command

ServeCommand will start the application REST service as a blocking process. It takes a codec to create a RestServer object and a function to register all necessary routes.

func StartRestServer

func StartRestServer(cdc *codec.CodecProxy, interfaceReg jsonpb.AnyResolver, registerRoutesFn func(*RestServer), tmNode *node.Node, addr string) error

Types

type JSONMarshalAdapter added in v1.3.0

type JSONMarshalAdapter struct {
	// contains filtered or unexported fields
}

func NewJSONMarshalAdapter added in v1.3.0

func NewJSONMarshalAdapter(jsonPb *gateway.JSONPb, codec *codec.CodecProxy) *JSONMarshalAdapter

func (*JSONMarshalAdapter) ContentType added in v1.3.0

func (m *JSONMarshalAdapter) ContentType() string

func (*JSONMarshalAdapter) Marshal added in v1.3.0

func (m *JSONMarshalAdapter) Marshal(v interface{}) ([]byte, error)

func (*JSONMarshalAdapter) NewDecoder added in v1.3.0

func (m *JSONMarshalAdapter) NewDecoder(r io.Reader) runtime.Decoder

func (*JSONMarshalAdapter) NewEncoder added in v1.3.0

func (m *JSONMarshalAdapter) NewEncoder(w io.Writer) runtime.Encoder

func (*JSONMarshalAdapter) Unmarshal added in v1.3.0

func (m *JSONMarshalAdapter) Unmarshal(data []byte, v interface{}) error

type RestServer

type RestServer struct {
	Mux     *mux.Router
	CliCtx  context.CLIContext
	KeyBase keybase.Keybase
	Cdc     *codec.CodecProxy

	GRPCGatewayRouter *runtime.ServeMux
	// contains filtered or unexported fields
}

RestServer represents the Light Client Rest server

func NewRestServer

func NewRestServer(cdc *codec.CodecProxy, interfaceReg jsonpb.AnyResolver, tmNode *node.Node) *RestServer

NewRestServer creates a new rest server instance

func (*RestServer) Logger

func (rs *RestServer) Logger() log.Logger

func (*RestServer) Start

func (rs *RestServer) Start(listenAddr string, maxOpen int, readTimeout, writeTimeout uint, maxBodyBytes int64, cors bool) (err error)

Start starts the rest server

Directories

Path Synopsis
Package statik contains static assets.
Package statik contains static assets.

Jump to

Keyboard shortcuts

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