lcd

package
v0.0.0-...-f498596 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 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

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

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

func NewJSONMarshalAdapter

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

func (*JSONMarshalAdapter) ContentType

func (m *JSONMarshalAdapter) ContentType() string

func (*JSONMarshalAdapter) Marshal

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

func (*JSONMarshalAdapter) NewDecoder

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

func (*JSONMarshalAdapter) NewEncoder

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

func (*JSONMarshalAdapter) Unmarshal

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