queryproto

package
v20.2.2-retracted Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Overview

Package queryproto 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 RegisterQueryHandler

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

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

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

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

func RegisterQueryHandlerFromEndpoint

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

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

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer 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 RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type QueryClient

type QueryClient interface {
	// Returns the list of ValidatorPreferences for the user.
	UserValidatorPreferences(ctx context.Context, in *UserValidatorPreferencesRequest, opts ...grpc.CallOption) (*UserValidatorPreferencesResponse, error)
}

QueryClient is the client API for Query service.

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

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer

type QueryServer interface {
	// Returns the list of ValidatorPreferences for the user.
	UserValidatorPreferences(context.Context, *UserValidatorPreferencesRequest) (*UserValidatorPreferencesResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) UserValidatorPreferences

type UserValidatorPreferencesRequest

type UserValidatorPreferencesRequest struct {
	// user account address
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}

Request type for UserValidatorPreferences.

func (*UserValidatorPreferencesRequest) Descriptor

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

func (*UserValidatorPreferencesRequest) Marshal

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

func (*UserValidatorPreferencesRequest) MarshalTo

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

func (*UserValidatorPreferencesRequest) MarshalToSizedBuffer

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

func (*UserValidatorPreferencesRequest) ProtoMessage

func (*UserValidatorPreferencesRequest) ProtoMessage()

func (*UserValidatorPreferencesRequest) Reset

func (*UserValidatorPreferencesRequest) Size

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

func (*UserValidatorPreferencesRequest) String

func (*UserValidatorPreferencesRequest) Unmarshal

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

func (*UserValidatorPreferencesRequest) XXX_DiscardUnknown

func (m *UserValidatorPreferencesRequest) XXX_DiscardUnknown()

func (*UserValidatorPreferencesRequest) XXX_Marshal

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

func (*UserValidatorPreferencesRequest) XXX_Merge

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

func (*UserValidatorPreferencesRequest) XXX_Size

func (m *UserValidatorPreferencesRequest) XXX_Size() int

func (*UserValidatorPreferencesRequest) XXX_Unmarshal

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

type UserValidatorPreferencesResponse

type UserValidatorPreferencesResponse struct {
	Preferences []types.ValidatorPreference `protobuf:"bytes,1,rep,name=preferences,proto3" json:"preferences"`
}

Response type the QueryUserValidatorPreferences query request

func (*UserValidatorPreferencesResponse) Descriptor

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

func (*UserValidatorPreferencesResponse) Marshal

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

func (*UserValidatorPreferencesResponse) MarshalTo

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

func (*UserValidatorPreferencesResponse) MarshalToSizedBuffer

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

func (*UserValidatorPreferencesResponse) ProtoMessage

func (*UserValidatorPreferencesResponse) ProtoMessage()

func (*UserValidatorPreferencesResponse) Reset

func (*UserValidatorPreferencesResponse) Size

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

func (*UserValidatorPreferencesResponse) String

func (*UserValidatorPreferencesResponse) Unmarshal

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

func (*UserValidatorPreferencesResponse) XXX_DiscardUnknown

func (m *UserValidatorPreferencesResponse) XXX_DiscardUnknown()

func (*UserValidatorPreferencesResponse) XXX_Marshal

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

func (*UserValidatorPreferencesResponse) XXX_Merge

func (*UserValidatorPreferencesResponse) XXX_Size

func (m *UserValidatorPreferencesResponse) XXX_Size() int

func (*UserValidatorPreferencesResponse) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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