cosmos

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package cosmos is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_cscalist_proto protoreflect.FileDescriptor
View Source
var File_query_proto protoreflect.FileDescriptor
View Source
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

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 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) Descriptor() ([]byte, []int)

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetChildrenHash

func (x *Node) GetChildrenHash() string

func (*Node) GetHash

func (x *Node) GetHash() string

func (*Node) GetKey

func (x *Node) GetKey() string

func (*Node) GetLeft

func (x *Node) GetLeft() string

func (*Node) GetPriority

func (x *Node) GetPriority() uint64

func (*Node) GetRight

func (x *Node) GetRight() string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

func (x *Node) ProtoReflect() protoreflect.Message

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Params.ProtoReflect.Descriptor instead.

func (*Params) GetLcgA

func (x *Params) GetLcgA() uint64

func (*Params) GetLcgB

func (x *Params) GetLcgB() uint64

func (*Params) GetLcgMod

func (x *Params) GetLcgMod() uint64

func (*Params) GetLcgValue

func (x *Params) GetLcgValue() uint64

func (*Params) GetRootKey

func (x *Params) GetRootKey() string

func (*Params) GetRootUpdated

func (x *Params) GetRootUpdated() bool

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) ProtoReflect

func (x *Params) ProtoReflect() protoreflect.Message

func (*Params) Reset

func (x *Params) Reset()

func (*Params) String

func (x *Params) String() string

type QueryClient

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 (*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 (*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

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) Params

func (UnimplementedQueryServer) Tree

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.

Jump to

Keyboard shortcuts

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