cmd

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: Apache-2.0 Imports: 61 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagListenAddr         = "laddr"
	FlagMaxOpenConnections = "max-open"
	FlagRPCReadTimeout     = "read-timeout"
	FlagRPCWriteTimeout    = "write-timeout"
	FlagWebsocket          = "wsport"
	GenesisFile            = "genesis.json"
	PrivValidatorKey       = "priv_validator_key.json"
)
View Source
const CorePrefix = "/core"

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 Execute

func Execute()

func ExportConfigHandler

func ExportConfigHandler(ctx context.Context) http.HandlerFunc

func ExportEnv

func ExportEnv(ctx context.Context) http.HandlerFunc

func ExportLogHandler

func ExportLogHandler(ctx context.Context) http.HandlerFunc

func Handle404

func Handle404() http.Handler

func HealthCheckHandler

func HealthCheckHandler(ctx context.Context) http.HandlerFunc

func SetupRegisterCenter

func SetupRegisterCenter(f func(err error, lg log.Logger))

Types

type ConfigFiles

type ConfigFiles struct {
	GenesisFile []byte `json:"genesis_file"`
	NodeID      string `json:"node_id"`
}

type HeightParams

type HeightParams struct {
	Height string `json:"height"`
}

type QueryParams

type QueryParams struct {
	Data HeightParams `json:"data"`
}

type Res

type Res struct {
	Ret     uint32             `json:"ret"`
	Data    ctypes.ResultBlock `json:"data"`
	Message string             `json:"message"`
}

type ResBlock

type ResBlock ctypes.ResultBlock

type Response

type Response struct {
	Ret     uint32      `json:"ret"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

type RestServer

type RestServer struct {
	Mux               *mux.Router
	GRPCGatewayRouter *runtime.ServeMux
	CliCtx            context.Context
	// contains filtered or unexported fields
}

RestServer represents the Light Client Rest server

func NewRestServer

func NewRestServer() *RestServer

func (*RestServer) Start

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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