Documentation ¶
Index ¶
- func CustomGRPCHeaderMatcher(key string) (string, bool)
- func ServeCommand(cdc *codec.CodecProxy, interfaceReg jsonpb.AnyResolver, ...) *cobra.Command
- func StartRestServer(cdc *codec.CodecProxy, interfaceReg jsonpb.AnyResolver, ...) error
- type JSONMarshalAdapter
- func (m *JSONMarshalAdapter) ContentType() string
- func (m *JSONMarshalAdapter) Marshal(v interface{}) ([]byte, error)
- func (m *JSONMarshalAdapter) NewDecoder(r io.Reader) runtime.Decoder
- func (m *JSONMarshalAdapter) NewEncoder(w io.Writer) runtime.Encoder
- func (m *JSONMarshalAdapter) Unmarshal(data []byte, v interface{}) error
- type RestServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CustomGRPCHeaderMatcher ¶
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
Click to show internal directories.
Click to hide internal directories.