Documentation
¶
Overview ¶
Package merkle is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer)
- type GetEmptyLeafProofRequest
- func (*GetEmptyLeafProofRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetEmptyLeafProofRequest) GetRegistry() string
- func (*GetEmptyLeafProofRequest) ProtoMessage()
- func (x *GetEmptyLeafProofRequest) ProtoReflect() protoreflect.Message
- func (x *GetEmptyLeafProofRequest) Reset()
- func (x *GetEmptyLeafProofRequest) String() string
- type GetEmptyLeafProofResponse
- func (*GetEmptyLeafProofResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetEmptyLeafProofResponse) GetProof() *Proof
- func (*GetEmptyLeafProofResponse) ProtoMessage()
- func (x *GetEmptyLeafProofResponse) ProtoReflect() protoreflect.Message
- func (x *GetEmptyLeafProofResponse) Reset()
- func (x *GetEmptyLeafProofResponse) String() string
- type Proof
- func (*Proof) Descriptor() ([]byte, []int)deprecated
- func (x *Proof) GetIndex() uint32
- func (x *Proof) GetLeaf() string
- func (x *Proof) GetPath() []string
- func (x *Proof) GetRoot() string
- func (*Proof) ProtoMessage()
- func (x *Proof) ProtoReflect() protoreflect.Message
- func (x *Proof) Reset()
- func (x *Proof) String() string
- type QueryClient
- type QueryProofRequest
- func (*QueryProofRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryProofRequest) GetLeaf() string
- func (x *QueryProofRequest) GetRegistry() string
- func (*QueryProofRequest) ProtoMessage()
- func (x *QueryProofRequest) ProtoReflect() protoreflect.Message
- func (x *QueryProofRequest) Reset()
- func (x *QueryProofRequest) String() string
- type QueryProofResponse
- func (*QueryProofResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryProofResponse) GetProof() *Proof
- func (*QueryProofResponse) ProtoMessage()
- func (x *QueryProofResponse) ProtoReflect() protoreflect.Message
- func (x *QueryProofResponse) Reset()
- func (x *QueryProofResponse) String() string
- type QueryServer
- type UnimplementedQueryServer
- type UnsafeQueryServer
Constants ¶
const ( Query_Proof_FullMethodName = "/galactica.merkle.Query/Proof" Query_GetEmptyLeafProof_FullMethodName = "/galactica.merkle.Query/GetEmptyLeafProof" )
Variables ¶
var File_galactica_merkle_query_proto protoreflect.FileDescriptor
var Query_ServiceDesc = grpc.ServiceDesc{ ServiceName: "galactica.merkle.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Proof", Handler: _Query_Proof_Handler, }, { MethodName: "GetEmptyLeafProof", Handler: _Query_GetEmptyLeafProof_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "galactica/merkle/query.proto", }
Query_ServiceDesc is the grpc.ServiceDesc for Query service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterQueryHandler ¶
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 grpc.ServiceRegistrar, srv QueryServer)
Types ¶
type GetEmptyLeafProofRequest ¶ added in v0.2.0
type GetEmptyLeafProofRequest struct { // registry is the ZkCertificateRegistry hex address, which starts with 0x. Registry string `protobuf:"bytes,1,opt,name=registry,proto3" json:"registry,omitempty"` // contains filtered or unexported fields }
GetEmptyLeafProofRequest is the request type for the Query.GetEmptyLeafProof method.
func (*GetEmptyLeafProofRequest) Descriptor
deprecated
added in
v0.2.0
func (*GetEmptyLeafProofRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetEmptyLeafProofRequest.ProtoReflect.Descriptor instead.
func (*GetEmptyLeafProofRequest) GetRegistry ¶ added in v0.2.0
func (x *GetEmptyLeafProofRequest) GetRegistry() string
func (*GetEmptyLeafProofRequest) ProtoMessage ¶ added in v0.2.0
func (*GetEmptyLeafProofRequest) ProtoMessage()
func (*GetEmptyLeafProofRequest) ProtoReflect ¶ added in v0.2.0
func (x *GetEmptyLeafProofRequest) ProtoReflect() protoreflect.Message
func (*GetEmptyLeafProofRequest) Reset ¶ added in v0.2.0
func (x *GetEmptyLeafProofRequest) Reset()
func (*GetEmptyLeafProofRequest) String ¶ added in v0.2.0
func (x *GetEmptyLeafProofRequest) String() string
type GetEmptyLeafProofResponse ¶ added in v0.2.0
type GetEmptyLeafProofResponse struct { // proof is the merkle proof of the empty leaf. Proof *Proof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` // contains filtered or unexported fields }
GetEmptyIndexResponse is the response type for the Query.GetEmptyLeafProof method.
func (*GetEmptyLeafProofResponse) Descriptor
deprecated
added in
v0.2.0
func (*GetEmptyLeafProofResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetEmptyLeafProofResponse.ProtoReflect.Descriptor instead.
func (*GetEmptyLeafProofResponse) GetProof ¶ added in v0.2.0
func (x *GetEmptyLeafProofResponse) GetProof() *Proof
func (*GetEmptyLeafProofResponse) ProtoMessage ¶ added in v0.2.0
func (*GetEmptyLeafProofResponse) ProtoMessage()
func (*GetEmptyLeafProofResponse) ProtoReflect ¶ added in v0.2.0
func (x *GetEmptyLeafProofResponse) ProtoReflect() protoreflect.Message
func (*GetEmptyLeafProofResponse) Reset ¶ added in v0.2.0
func (x *GetEmptyLeafProofResponse) Reset()
func (*GetEmptyLeafProofResponse) String ¶ added in v0.2.0
func (x *GetEmptyLeafProofResponse) String() string
type Proof ¶
type Proof struct { // leaf is the leaf value encoded as a string containing the uint256 value. Leaf string `protobuf:"bytes,1,opt,name=leaf,proto3" json:"leaf,omitempty"` // path is the merkle proof path, encoded as a string containing the uint256 values. Path []string `protobuf:"bytes,2,rep,name=path,proto3" json:"path,omitempty"` // index is the leaf index. Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` // root is the merkle root, value encoded as a string containing the uint256 value. Root string `protobuf:"bytes,4,opt,name=root,proto3" json:"root,omitempty"` // contains filtered or unexported fields }
Proof is the merkle proof.
func (*Proof) Descriptor
deprecated
func (*Proof) ProtoMessage ¶
func (*Proof) ProtoMessage()
func (*Proof) ProtoReflect ¶
func (x *Proof) ProtoReflect() protoreflect.Message
type QueryClient ¶
type QueryClient interface { // Proof queries the proof of a leaf in the merkle tree. Proof(ctx context.Context, in *QueryProofRequest, opts ...grpc.CallOption) (*QueryProofResponse, error) // GetEmptyLeafProof queries the proof of the any empty leaf in the merkle tree. GetEmptyLeafProof(ctx context.Context, in *GetEmptyLeafProofRequest, opts ...grpc.CallOption) (*GetEmptyLeafProofResponse, error) }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient
type QueryProofRequest ¶
type QueryProofRequest struct { // registry is the ZkCertificateRegistry hex address, which starts with 0x. Registry string `protobuf:"bytes,1,opt,name=registry,proto3" json:"registry,omitempty"` // leaf is the leaf uint256 value. Leaf string `protobuf:"bytes,2,opt,name=leaf,proto3" json:"leaf,omitempty"` // contains filtered or unexported fields }
QueryProofRequest is the request type for the Query.Proof method.
func (*QueryProofRequest) Descriptor
deprecated
func (*QueryProofRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryProofRequest.ProtoReflect.Descriptor instead.
func (*QueryProofRequest) GetLeaf ¶
func (x *QueryProofRequest) GetLeaf() string
func (*QueryProofRequest) GetRegistry ¶
func (x *QueryProofRequest) GetRegistry() string
func (*QueryProofRequest) ProtoMessage ¶
func (*QueryProofRequest) ProtoMessage()
func (*QueryProofRequest) ProtoReflect ¶
func (x *QueryProofRequest) ProtoReflect() protoreflect.Message
func (*QueryProofRequest) Reset ¶
func (x *QueryProofRequest) Reset()
func (*QueryProofRequest) String ¶
func (x *QueryProofRequest) String() string
type QueryProofResponse ¶
type QueryProofResponse struct { // proof is the merkle proof. Proof *Proof `protobuf:"bytes,1,opt,name=proof,proto3" json:"proof,omitempty"` // contains filtered or unexported fields }
QueryProofResponse is the response type for the Query.Proof method.
func (*QueryProofResponse) Descriptor
deprecated
func (*QueryProofResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryProofResponse.ProtoReflect.Descriptor instead.
func (*QueryProofResponse) GetProof ¶
func (x *QueryProofResponse) GetProof() *Proof
func (*QueryProofResponse) ProtoMessage ¶
func (*QueryProofResponse) ProtoMessage()
func (*QueryProofResponse) ProtoReflect ¶
func (x *QueryProofResponse) ProtoReflect() protoreflect.Message
func (*QueryProofResponse) Reset ¶
func (x *QueryProofResponse) Reset()
func (*QueryProofResponse) String ¶
func (x *QueryProofResponse) String() string
type QueryServer ¶
type QueryServer interface { // Proof queries the proof of a leaf in the merkle tree. Proof(context.Context, *QueryProofRequest) (*QueryProofResponse, error) // GetEmptyLeafProof queries the proof of the any empty leaf in the merkle tree. GetEmptyLeafProof(context.Context, *GetEmptyLeafProofRequest) (*GetEmptyLeafProofResponse, error) // contains filtered or unexported methods }
QueryServer is the server API for Query service. All implementations must embed UnimplementedQueryServer for forward compatibility
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer must be embedded to have forward compatible implementations.
func (UnimplementedQueryServer) GetEmptyLeafProof ¶ added in v0.2.0
func (UnimplementedQueryServer) GetEmptyLeafProof(context.Context, *GetEmptyLeafProofRequest) (*GetEmptyLeafProofResponse, error)
func (UnimplementedQueryServer) Proof ¶
func (UnimplementedQueryServer) Proof(context.Context, *QueryProofRequest) (*QueryProofResponse, error)
type UnsafeQueryServer ¶
type UnsafeQueryServer interface {
// contains filtered or unexported methods
}
UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to QueryServer will result in compilation errors.