types

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package types 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 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 to stop working. Consider using RegisterServiceHandlerFromEndpoint instead.

func RegisterServiceServer

func RegisterServiceServer(s grpc1.Server, srv ServiceServer)

Types

type GetTxDistributionRequest

type GetTxDistributionRequest struct {
}

GetTxDistributionRequest is the request type for the Service.GetTxDistribution RPC method.

func (*GetTxDistributionRequest) Descriptor

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

func (*GetTxDistributionRequest) Marshal

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

func (*GetTxDistributionRequest) MarshalTo

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

func (*GetTxDistributionRequest) MarshalToSizedBuffer

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

func (*GetTxDistributionRequest) ProtoMessage

func (*GetTxDistributionRequest) ProtoMessage()

func (*GetTxDistributionRequest) Reset

func (m *GetTxDistributionRequest) Reset()

func (*GetTxDistributionRequest) Size

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

func (*GetTxDistributionRequest) String

func (m *GetTxDistributionRequest) String() string

func (*GetTxDistributionRequest) Unmarshal

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

func (*GetTxDistributionRequest) XXX_DiscardUnknown

func (m *GetTxDistributionRequest) XXX_DiscardUnknown()

func (*GetTxDistributionRequest) XXX_Marshal

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

func (*GetTxDistributionRequest) XXX_Merge

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

func (*GetTxDistributionRequest) XXX_Size

func (m *GetTxDistributionRequest) XXX_Size() int

func (*GetTxDistributionRequest) XXX_Unmarshal

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

type GetTxDistributionResponse

type GetTxDistributionResponse struct {
	// Distribution is a map of lane to the number of transactions in the mempool for that lane.
	Distribution map[string]uint64 `` /* 166-byte string literal not displayed */
}

GetTxDistributionResponse is the response type for the Service.GetTxDistribution RPC method.

func (*GetTxDistributionResponse) Descriptor

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

func (*GetTxDistributionResponse) GetDistribution

func (m *GetTxDistributionResponse) GetDistribution() map[string]uint64

func (*GetTxDistributionResponse) Marshal

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

func (*GetTxDistributionResponse) MarshalTo

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

func (*GetTxDistributionResponse) MarshalToSizedBuffer

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

func (*GetTxDistributionResponse) ProtoMessage

func (*GetTxDistributionResponse) ProtoMessage()

func (*GetTxDistributionResponse) Reset

func (m *GetTxDistributionResponse) Reset()

func (*GetTxDistributionResponse) Size

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

func (*GetTxDistributionResponse) String

func (m *GetTxDistributionResponse) String() string

func (*GetTxDistributionResponse) Unmarshal

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

func (*GetTxDistributionResponse) XXX_DiscardUnknown

func (m *GetTxDistributionResponse) XXX_DiscardUnknown()

func (*GetTxDistributionResponse) XXX_Marshal

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

func (*GetTxDistributionResponse) XXX_Merge

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

func (*GetTxDistributionResponse) XXX_Size

func (m *GetTxDistributionResponse) XXX_Size() int

func (*GetTxDistributionResponse) XXX_Unmarshal

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

type ServiceClient

type ServiceClient interface {
	// GetTxDistribution returns the distribution of transactions in the mempool.
	GetTxDistribution(ctx context.Context, in *GetTxDistributionRequest, opts ...grpc.CallOption) (*GetTxDistributionResponse, 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 {
	// GetTxDistribution returns the distribution of transactions in the mempool.
	GetTxDistribution(context.Context, *GetTxDistributionRequest) (*GetTxDistributionResponse, error)
}

ServiceServer is the server API for Service service.

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) GetTxDistribution

Jump to

Keyboard shortcuts

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