Documentation
¶
Overview ¶
Package cosmos is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- 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 Node
- func (*Node) Descriptor() ([]byte, []int)deprecated
- func (x *Node) GetChildrenHash() string
- func (x *Node) GetHash() string
- func (x *Node) GetKey() string
- func (x *Node) GetLeft() string
- func (x *Node) GetPriority() uint64
- func (x *Node) GetRight() string
- func (*Node) ProtoMessage()
- func (x *Node) ProtoReflect() protoreflect.Message
- func (x *Node) Reset()
- func (x *Node) String() string
- type Params
- func (*Params) Descriptor() ([]byte, []int)deprecated
- func (x *Params) GetLcgA() uint64
- func (x *Params) GetLcgB() uint64
- func (x *Params) GetLcgMod() uint64
- func (x *Params) GetLcgValue() uint64
- func (x *Params) GetRootKey() string
- func (x *Params) GetRootUpdated() bool
- func (*Params) ProtoMessage()
- func (x *Params) ProtoReflect() protoreflect.Message
- func (x *Params) Reset()
- func (x *Params) String() string
- type QueryClient
- type QueryGetMerkleProofRequest
- func (*QueryGetMerkleProofRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryGetMerkleProofRequest) GetLeaf() string
- func (*QueryGetMerkleProofRequest) ProtoMessage()
- func (x *QueryGetMerkleProofRequest) ProtoReflect() protoreflect.Message
- func (x *QueryGetMerkleProofRequest) Reset()
- func (x *QueryGetMerkleProofRequest) String() string
- type QueryGetMerkleProofResponse
- func (*QueryGetMerkleProofResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryGetMerkleProofResponse) GetProof() []string
- func (*QueryGetMerkleProofResponse) ProtoMessage()
- func (x *QueryGetMerkleProofResponse) ProtoReflect() protoreflect.Message
- func (x *QueryGetMerkleProofResponse) Reset()
- func (x *QueryGetMerkleProofResponse) String() string
- type QueryParamsRequest
- type QueryParamsResponse
- func (*QueryParamsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryParamsResponse) GetParams() *Params
- func (*QueryParamsResponse) ProtoMessage()
- func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message
- func (x *QueryParamsResponse) Reset()
- func (x *QueryParamsResponse) String() string
- type QueryServer
- type QueryTreeRequest
- func (*QueryTreeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryTreeRequest) GetPagination() *query.PageRequest
- func (*QueryTreeRequest) ProtoMessage()
- func (x *QueryTreeRequest) ProtoReflect() protoreflect.Message
- func (x *QueryTreeRequest) Reset()
- func (x *QueryTreeRequest) String() string
- type QueryTreeResponse
- func (*QueryTreeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryTreeResponse) GetPagination() *query.PageResponse
- func (x *QueryTreeResponse) GetTree() []*Node
- func (*QueryTreeResponse) ProtoMessage()
- func (x *QueryTreeResponse) ProtoReflect() protoreflect.Message
- func (x *QueryTreeResponse) Reset()
- func (x *QueryTreeResponse) String() string
- type UnimplementedQueryServer
- func (UnimplementedQueryServer) MerkleProof(context.Context, *QueryGetMerkleProofRequest) (*QueryGetMerkleProofResponse, error)
- func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
- func (UnimplementedQueryServer) Tree(context.Context, *QueryTreeRequest) (*QueryTreeResponse, error)
- type UnsafeQueryServer
Constants ¶
This section is empty.
Variables ¶
var File_cscalist_proto protoreflect.FileDescriptor
var File_query_proto protoreflect.FileDescriptor
var Query_ServiceDesc = grpc.ServiceDesc{ ServiceName: "rarimo.rarimocore.cscalist.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Params", Handler: _Query_Params_Handler, }, { MethodName: "Tree", Handler: _Query_Tree_Handler, }, { MethodName: "MerkleProof", Handler: _Query_MerkleProof_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "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 Node ¶
type Node struct { // Node self key Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // Node priority (should be random) Priority uint64 `protobuf:"varint,2,opt,name=priority,proto3" json:"priority,omitempty"` // Node left son key Left string `protobuf:"bytes,4,opt,name=left,proto3" json:"left,omitempty"` // Node right son key Right string `protobuf:"bytes,5,opt,name=right,proto3" json:"right,omitempty"` // Merkle hash. H = Hash(Hash(left_key|right_key)|self_key) Hash string `protobuf:"bytes,6,opt,name=hash,proto3" json:"hash,omitempty"` // Hash(left_key|right_key) ChildrenHash string `protobuf:"bytes,7,opt,name=childrenHash,proto3" json:"childrenHash,omitempty"` // contains filtered or unexported fields }
func (*Node) Descriptor
deprecated
func (*Node) GetChildrenHash ¶
func (*Node) GetPriority ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
type Params ¶
type Params struct { // Linear congruential generator params // https://en.wikipedia.org/wiki/Linear_congruential_generator LcgA uint64 `protobuf:"varint,1,opt,name=lcgA,proto3" json:"lcgA,omitempty"` LcgB uint64 `protobuf:"varint,2,opt,name=lcgB,proto3" json:"lcgB,omitempty"` LcgMod uint64 `protobuf:"varint,3,opt,name=lcgMod,proto3" json:"lcgMod,omitempty"` LcgValue uint64 `protobuf:"varint,4,opt,name=lcgValue,proto3" json:"lcgValue,omitempty"` // RootKey is the key of the current root node RootKey string `protobuf:"bytes,5,opt,name=rootKey,proto3" json:"rootKey,omitempty"` // RootUpdated is true when the root node was updated in Rarimo, but not in Chain RootUpdated bool `protobuf:"varint,6,opt,name=rootUpdated,proto3" json:"rootUpdated,omitempty"` // contains filtered or unexported fields }
func (*Params) Descriptor
deprecated
func (*Params) GetLcgValue ¶
func (*Params) GetRootKey ¶
func (*Params) GetRootUpdated ¶
func (*Params) ProtoMessage ¶
func (*Params) ProtoMessage()
func (*Params) ProtoReflect ¶
func (x *Params) ProtoReflect() protoreflect.Message
type QueryClient ¶
type QueryClient interface { Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) Tree(ctx context.Context, in *QueryTreeRequest, opts ...grpc.CallOption) (*QueryTreeResponse, error) MerkleProof(ctx context.Context, in *QueryGetMerkleProofRequest, opts ...grpc.CallOption) (*QueryGetMerkleProofResponse, 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 QueryGetMerkleProofRequest ¶
type QueryGetMerkleProofRequest struct { // Leaf is a hash value of the leaf node in the tree Leaf string `protobuf:"bytes,1,opt,name=leaf,proto3" json:"leaf,omitempty"` // contains filtered or unexported fields }
func (*QueryGetMerkleProofRequest) Descriptor
deprecated
func (*QueryGetMerkleProofRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryGetMerkleProofRequest.ProtoReflect.Descriptor instead.
func (*QueryGetMerkleProofRequest) GetLeaf ¶
func (x *QueryGetMerkleProofRequest) GetLeaf() string
func (*QueryGetMerkleProofRequest) ProtoMessage ¶
func (*QueryGetMerkleProofRequest) ProtoMessage()
func (*QueryGetMerkleProofRequest) ProtoReflect ¶
func (x *QueryGetMerkleProofRequest) ProtoReflect() protoreflect.Message
func (*QueryGetMerkleProofRequest) Reset ¶
func (x *QueryGetMerkleProofRequest) Reset()
func (*QueryGetMerkleProofRequest) String ¶
func (x *QueryGetMerkleProofRequest) String() string
type QueryGetMerkleProofResponse ¶
type QueryGetMerkleProofResponse struct { Proof []string `protobuf:"bytes,1,rep,name=proof,proto3" json:"proof,omitempty"` // contains filtered or unexported fields }
func (*QueryGetMerkleProofResponse) Descriptor
deprecated
func (*QueryGetMerkleProofResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryGetMerkleProofResponse.ProtoReflect.Descriptor instead.
func (*QueryGetMerkleProofResponse) GetProof ¶
func (x *QueryGetMerkleProofResponse) GetProof() []string
func (*QueryGetMerkleProofResponse) ProtoMessage ¶
func (*QueryGetMerkleProofResponse) ProtoMessage()
func (*QueryGetMerkleProofResponse) ProtoReflect ¶
func (x *QueryGetMerkleProofResponse) ProtoReflect() protoreflect.Message
func (*QueryGetMerkleProofResponse) Reset ¶
func (x *QueryGetMerkleProofResponse) Reset()
func (*QueryGetMerkleProofResponse) String ¶
func (x *QueryGetMerkleProofResponse) String() string
type QueryParamsRequest ¶
type QueryParamsRequest struct {
// contains filtered or unexported fields
}
func (*QueryParamsRequest) Descriptor
deprecated
func (*QueryParamsRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryParamsRequest.ProtoReflect.Descriptor instead.
func (*QueryParamsRequest) ProtoMessage ¶
func (*QueryParamsRequest) ProtoMessage()
func (*QueryParamsRequest) ProtoReflect ¶
func (x *QueryParamsRequest) ProtoReflect() protoreflect.Message
func (*QueryParamsRequest) Reset ¶
func (x *QueryParamsRequest) Reset()
func (*QueryParamsRequest) String ¶
func (x *QueryParamsRequest) String() string
type QueryParamsResponse ¶
type QueryParamsResponse struct { Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` // contains filtered or unexported fields }
func (*QueryParamsResponse) Descriptor
deprecated
func (*QueryParamsResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryParamsResponse.ProtoReflect.Descriptor instead.
func (*QueryParamsResponse) GetParams ¶
func (x *QueryParamsResponse) GetParams() *Params
func (*QueryParamsResponse) ProtoMessage ¶
func (*QueryParamsResponse) ProtoMessage()
func (*QueryParamsResponse) ProtoReflect ¶
func (x *QueryParamsResponse) ProtoReflect() protoreflect.Message
func (*QueryParamsResponse) Reset ¶
func (x *QueryParamsResponse) Reset()
func (*QueryParamsResponse) String ¶
func (x *QueryParamsResponse) String() string
type QueryServer ¶
type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) Tree(context.Context, *QueryTreeRequest) (*QueryTreeResponse, error) MerkleProof(context.Context, *QueryGetMerkleProofRequest) (*QueryGetMerkleProofResponse, error) }
QueryServer is the server API for Query service. All implementations should embed UnimplementedQueryServer for forward compatibility
type QueryTreeRequest ¶
type QueryTreeRequest struct { Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` // contains filtered or unexported fields }
func (*QueryTreeRequest) Descriptor
deprecated
func (*QueryTreeRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryTreeRequest.ProtoReflect.Descriptor instead.
func (*QueryTreeRequest) GetPagination ¶
func (x *QueryTreeRequest) GetPagination() *query.PageRequest
func (*QueryTreeRequest) ProtoMessage ¶
func (*QueryTreeRequest) ProtoMessage()
func (*QueryTreeRequest) ProtoReflect ¶
func (x *QueryTreeRequest) ProtoReflect() protoreflect.Message
func (*QueryTreeRequest) Reset ¶
func (x *QueryTreeRequest) Reset()
func (*QueryTreeRequest) String ¶
func (x *QueryTreeRequest) String() string
type QueryTreeResponse ¶
type QueryTreeResponse struct { Tree []*Node `protobuf:"bytes,1,rep,name=tree,proto3" json:"tree,omitempty"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` // contains filtered or unexported fields }
func (*QueryTreeResponse) Descriptor
deprecated
func (*QueryTreeResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryTreeResponse.ProtoReflect.Descriptor instead.
func (*QueryTreeResponse) GetPagination ¶
func (x *QueryTreeResponse) GetPagination() *query.PageResponse
func (*QueryTreeResponse) GetTree ¶
func (x *QueryTreeResponse) GetTree() []*Node
func (*QueryTreeResponse) ProtoMessage ¶
func (*QueryTreeResponse) ProtoMessage()
func (*QueryTreeResponse) ProtoReflect ¶
func (x *QueryTreeResponse) ProtoReflect() protoreflect.Message
func (*QueryTreeResponse) Reset ¶
func (x *QueryTreeResponse) Reset()
func (*QueryTreeResponse) String ¶
func (x *QueryTreeResponse) String() string
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer should be embedded to have forward compatible implementations.
func (UnimplementedQueryServer) MerkleProof ¶
func (UnimplementedQueryServer) MerkleProof(context.Context, *QueryGetMerkleProofRequest) (*QueryGetMerkleProofResponse, error)
func (UnimplementedQueryServer) Params ¶
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
func (UnimplementedQueryServer) Tree ¶
func (UnimplementedQueryServer) Tree(context.Context, *QueryTreeRequest) (*QueryTreeResponse, 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.