node

package
v0.48.0-ramus1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 19 Imported by: 5

Documentation

Overview

Package node is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterGRPCGatewayRoutes

func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux)

RegisterGRPCGatewayRoutes mounts the node gRPC service's GRPC-gateway routes on the given mux object.

func RegisterNodeService

func RegisterNodeService(clientCtx client.Context, server gogogrpc.Server)

RegisterNodeService registers the node gRPC service on the provided gRPC router.

func RegisterServiceHandler

func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterServiceHandler registers the http handlers for service Service to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterServiceHandlerClient

func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error

RegisterServiceHandlerClient registers the http handlers for service Service to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ServiceClient" to call the correct interceptors.

func RegisterServiceHandlerFromEndpoint

func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterServiceHandlerServer

func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error

RegisterServiceHandlerServer registers the http handlers for service Service to "mux". UnaryRPC :call ServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterServiceHandlerFromEndpoint instead.

func RegisterServiceServer

func RegisterServiceServer(s grpc1.Server, srv ServiceServer)

Types

type ConfigRequest

type ConfigRequest struct {
}

ConfigRequest defines the request structure for the Config gRPC query.

func (*ConfigRequest) Descriptor

func (*ConfigRequest) Descriptor() ([]byte, []int)

func (*ConfigRequest) Marshal

func (m *ConfigRequest) Marshal() (dAtA []byte, err error)

func (*ConfigRequest) MarshalTo

func (m *ConfigRequest) MarshalTo(dAtA []byte) (int, error)

func (*ConfigRequest) MarshalToSizedBuffer

func (m *ConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigRequest) ProtoMessage

func (*ConfigRequest) ProtoMessage()

func (*ConfigRequest) Reset

func (m *ConfigRequest) Reset()

func (*ConfigRequest) Size

func (m *ConfigRequest) Size() (n int)

func (*ConfigRequest) String

func (m *ConfigRequest) String() string

func (*ConfigRequest) Unmarshal

func (m *ConfigRequest) Unmarshal(dAtA []byte) error

func (*ConfigRequest) XXX_DiscardUnknown

func (m *ConfigRequest) XXX_DiscardUnknown()

func (*ConfigRequest) XXX_Marshal

func (m *ConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigRequest) XXX_Merge

func (m *ConfigRequest) XXX_Merge(src proto.Message)

func (*ConfigRequest) XXX_Size

func (m *ConfigRequest) XXX_Size() int

func (*ConfigRequest) XXX_Unmarshal

func (m *ConfigRequest) XXX_Unmarshal(b []byte) error

type ConfigResponse

type ConfigResponse struct {
	MinimumGasPrice string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"`
}

ConfigResponse defines the response structure for the Config gRPC query.

func (*ConfigResponse) Descriptor

func (*ConfigResponse) Descriptor() ([]byte, []int)

func (*ConfigResponse) GetMinimumGasPrice

func (m *ConfigResponse) GetMinimumGasPrice() string

func (*ConfigResponse) Marshal

func (m *ConfigResponse) Marshal() (dAtA []byte, err error)

func (*ConfigResponse) MarshalTo

func (m *ConfigResponse) MarshalTo(dAtA []byte) (int, error)

func (*ConfigResponse) MarshalToSizedBuffer

func (m *ConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigResponse) ProtoMessage

func (*ConfigResponse) ProtoMessage()

func (*ConfigResponse) Reset

func (m *ConfigResponse) Reset()

func (*ConfigResponse) Size

func (m *ConfigResponse) Size() (n int)

func (*ConfigResponse) String

func (m *ConfigResponse) String() string

func (*ConfigResponse) Unmarshal

func (m *ConfigResponse) Unmarshal(dAtA []byte) error

func (*ConfigResponse) XXX_DiscardUnknown

func (m *ConfigResponse) XXX_DiscardUnknown()

func (*ConfigResponse) XXX_Marshal

func (m *ConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigResponse) XXX_Merge

func (m *ConfigResponse) XXX_Merge(src proto.Message)

func (*ConfigResponse) XXX_Size

func (m *ConfigResponse) XXX_Size() int

func (*ConfigResponse) XXX_Unmarshal

func (m *ConfigResponse) XXX_Unmarshal(b []byte) error

type ServiceClient

type ServiceClient interface {
	// Config queries for the operator configuration.
	Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error)
}

ServiceClient is the client API for Service service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewServiceClient

func NewServiceClient(cc grpc1.ClientConn) ServiceClient

type ServiceServer

type ServiceServer interface {
	// Config queries for the operator configuration.
	Config(context.Context, *ConfigRequest) (*ConfigResponse, error)
}

ServiceServer is the server API for Service service.

func NewQueryServer

func NewQueryServer(clientCtx client.Context) ServiceServer

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) Config

Jump to

Keyboard shortcuts

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