Documentation
¶
Index ¶
- type IAVLServer
- func (s *IAVLServer) DeleteVersion(_ context.Context, req *pb.DeleteVersionRequest) (*pb.DeleteVersionResponse, error)
- func (s *IAVLServer) Get(_ context.Context, req *pb.GetRequest) (*pb.GetResponse, error)
- func (s *IAVLServer) GetAvailableVersions(ctx context.Context, req *empty.Empty) (*pb.GetAvailableVersionsResponse, error)
- func (s *IAVLServer) GetByIndex(_ context.Context, req *pb.GetByIndexRequest) (*pb.GetByIndexResponse, error)
- func (s *IAVLServer) GetVersioned(_ context.Context, req *pb.GetVersionedRequest) (*pb.GetResponse, error)
- func (s *IAVLServer) GetVersionedWithProof(_ context.Context, req *pb.GetVersionedRequest) (*pb.GetWithProofResponse, error)
- func (s *IAVLServer) GetWithProof(ctx context.Context, req *pb.GetRequest) (*pb.GetWithProofResponse, error)
- func (s *IAVLServer) Has(_ context.Context, req *pb.HasRequest) (*pb.HasResponse, error)
- func (s *IAVLServer) HasVersioned(_ context.Context, req *pb.HasVersionedRequest) (*pb.HasResponse, error)
- func (s *IAVLServer) Hash(_ context.Context, _ *empty.Empty) (*pb.HashResponse, error)
- func (s *IAVLServer) List(req *pb.ListRequest, stream pb.IAVLService_ListServer) error
- func (s *IAVLServer) Load(ctx context.Context, req *empty.Empty) (*empty.Empty, error)
- func (s *IAVLServer) LoadVersion(ctx context.Context, req *pb.LoadVersionRequest) (*empty.Empty, error)
- func (s *IAVLServer) LoadVersionForOverwriting(ctx context.Context, req *pb.LoadVersionForOverwritingRequest) (*empty.Empty, error)
- func (s *IAVLServer) Remove(_ context.Context, req *pb.RemoveRequest) (*pb.RemoveResponse, error)
- func (s *IAVLServer) Rollback(ctx context.Context, req *empty.Empty) (*empty.Empty, error)
- func (s *IAVLServer) SaveVersion(_ context.Context, _ *empty.Empty) (*pb.SaveVersionResponse, error)
- func (s *IAVLServer) Set(_ context.Context, req *pb.SetRequest) (*pb.SetResponse, error)
- func (s *IAVLServer) Size(ctx context.Context, req *empty.Empty) (*pb.SizeResponse, error)
- func (*IAVLServer) Verify(ctx context.Context, req *pb.VerifyRequest) (*empty.Empty, error)
- func (*IAVLServer) VerifyAbsence(ctx context.Context, req *pb.VerifyAbsenceRequest) (*empty.Empty, error)
- func (*IAVLServer) VerifyItem(ctx context.Context, req *pb.VerifyItemRequest) (*empty.Empty, error)
- func (s *IAVLServer) Version(_ context.Context, _ *empty.Empty) (*pb.VersionResponse, error)
- func (s *IAVLServer) VersionExists(_ context.Context, req *pb.VersionExistsRequest) (*pb.VersionExistsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IAVLServer ¶
type IAVLServer struct {
// contains filtered or unexported fields
}
IAVLServer implements the gRPC IAVLServiceServer interface. It provides a gRPC API over an IAVL tree. rwLock is used to ensure: 1. No reading while writing, no writing while reading. 2. Unlimited concurrent reads. 3. Sequential writes.
func New ¶
func New(db dbm.DB, cacheSize, version int64) (*IAVLServer, error)
New creates an IAVLServer.
func (*IAVLServer) DeleteVersion ¶
func (s *IAVLServer) DeleteVersion(_ context.Context, req *pb.DeleteVersionRequest) (*pb.DeleteVersionResponse, error)
DeleteVersion deletes an IAVL tree version from the DB. The version can then no longer be accessed. It returns a result containing the version and root hash of the versioned tree that was deleted.
func (*IAVLServer) Get ¶
func (s *IAVLServer) Get(_ context.Context, req *pb.GetRequest) (*pb.GetResponse, error)
Get returns a result containing the index and value for a given key based on the current state (version) of the tree. If the key does not exist, Get returns the index of the next value.
func (*IAVLServer) GetAvailableVersions ¶
func (s *IAVLServer) GetAvailableVersions(ctx context.Context, req *empty.Empty) (*pb.GetAvailableVersionsResponse, error)
func (*IAVLServer) GetByIndex ¶
func (s *IAVLServer) GetByIndex(_ context.Context, req *pb.GetByIndexRequest) (*pb.GetByIndexResponse, error)
GetByIndex returns a result containing the key and value for a given index based on the current state (version) of the tree.
func (*IAVLServer) GetVersioned ¶
func (s *IAVLServer) GetVersioned(_ context.Context, req *pb.GetVersionedRequest) (*pb.GetResponse, error)
GetVersioned returns a result containing the IAVL tree version and value for a given key at a specific tree version.
func (*IAVLServer) GetVersionedWithProof ¶
func (s *IAVLServer) GetVersionedWithProof(_ context.Context, req *pb.GetVersionedRequest) (*pb.GetWithProofResponse, error)
GetVersionedWithProof returns a result containing the IAVL tree version and value for a given key at a specific tree version including a verifiable Merkle proof.
func (*IAVLServer) GetWithProof ¶
func (s *IAVLServer) GetWithProof(ctx context.Context, req *pb.GetRequest) (*pb.GetWithProofResponse, error)
GetWithProof returns a result containing the IAVL tree version and value for a given key based on the current state (version) of the tree including a verifiable Merkle proof.
func (*IAVLServer) Has ¶
func (s *IAVLServer) Has(_ context.Context, req *pb.HasRequest) (*pb.HasResponse, error)
Has returns a result containing a boolean on whether or not the IAVL tree has a given key in the current version
func (*IAVLServer) HasVersioned ¶
func (s *IAVLServer) HasVersioned(_ context.Context, req *pb.HasVersionedRequest) (*pb.HasResponse, error)
HasVersioned returns a result containing a boolean on whether or not the IAVL tree has a given key at a specific tree version.
func (*IAVLServer) Hash ¶
func (s *IAVLServer) Hash(_ context.Context, _ *empty.Empty) (*pb.HashResponse, error)
Hash returns the IAVL tree root hash based on the current state.
func (*IAVLServer) List ¶
func (s *IAVLServer) List(req *pb.ListRequest, stream pb.IAVLService_ListServer) error
func (*IAVLServer) LoadVersion ¶
func (s *IAVLServer) LoadVersion(ctx context.Context, req *pb.LoadVersionRequest) (*empty.Empty, error)
func (*IAVLServer) LoadVersionForOverwriting ¶
func (s *IAVLServer) LoadVersionForOverwriting(ctx context.Context, req *pb.LoadVersionForOverwritingRequest) (*empty.Empty, error)
func (*IAVLServer) Remove ¶
func (s *IAVLServer) Remove(_ context.Context, req *pb.RemoveRequest) (*pb.RemoveResponse, error)
Remove returns a result after removing a key/value pair from the IAVL tree based on the current state (version) of the tree.
func (*IAVLServer) Rollback ¶
Rollback resets the working tree to the latest saved version, discarding any unsaved modifications.
func (*IAVLServer) SaveVersion ¶
func (s *IAVLServer) SaveVersion(_ context.Context, _ *empty.Empty) (*pb.SaveVersionResponse, error)
SaveVersion saves a new IAVL tree version to the DB based on the current state (version) of the tree. It returns a result containing the hash and new version number.
func (*IAVLServer) Set ¶
func (s *IAVLServer) Set(_ context.Context, req *pb.SetRequest) (*pb.SetResponse, error)
Set returns a result after inserting a key/value pair into the IAVL tree based on the current state (version) of the tree.
func (*IAVLServer) Size ¶
func (s *IAVLServer) Size(ctx context.Context, req *empty.Empty) (*pb.SizeResponse, error)
func (*IAVLServer) Verify ¶
func (*IAVLServer) Verify(ctx context.Context, req *pb.VerifyRequest) (*empty.Empty, error)
Verify verifies an IAVL range proof returning an error if the proof is invalid.
func (*IAVLServer) VerifyAbsence ¶
func (*IAVLServer) VerifyAbsence(ctx context.Context, req *pb.VerifyAbsenceRequest) (*empty.Empty, error)
VerifyAbsence verifies the absence of a given key in an IAVL range proof returning an error if the proof or key is invalid.
func (*IAVLServer) VerifyItem ¶
func (*IAVLServer) VerifyItem(ctx context.Context, req *pb.VerifyItemRequest) (*empty.Empty, error)
VerifyItem verifies if a given key/value pair in an IAVL range proof returning an error if the proof or key is invalid.
func (*IAVLServer) Version ¶
func (s *IAVLServer) Version(_ context.Context, _ *empty.Empty) (*pb.VersionResponse, error)
Version returns the IAVL tree version based on the current state.
func (*IAVLServer) VersionExists ¶
func (s *IAVLServer) VersionExists(_ context.Context, req *pb.VersionExistsRequest) (*pb.VersionExistsResponse, error)
VersionExists returns a result containing a boolean on whether or not a given version exists in the IAVL tree.