reader

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: LGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const MaxChannelSize = 512

Variables

This section is empty.

Functions

func NewClient

func NewClient(addr string) (pb.RemoteClient, error)

Types

type Reader

type Reader struct {
	sync.Mutex

	pb.UnimplementedRemoteServer
	// contains filtered or unexported fields
}

func NewReader

func NewReader(config *utils.Config, dbPool *db.DBPool) (reader *Reader, err error)

func (*Reader) Batch

func (r *Reader) Batch(ctx context.Context,
	req *pb.BatchRequest) (reply *pb.BatchReply, err error)

func (*Reader) Close

func (r *Reader) Close(ctx context.Context,
	req *pb.CloseRequest) (reply *pb.CloseReply, err error)

func (*Reader) Compact

func (r *Reader) Compact(ctx context.Context,
	req *pb.CompactRequest) (reply *pb.CompactReply, err error)

func (*Reader) Del

func (r *Reader) Del(ctx context.Context,
	req *pb.DelRequest) (reply *pb.DelReply, err error)

func (*Reader) Get

func (r *Reader) Get(ctx context.Context,
	req *pb.GetRequest) (reply *pb.GetReply, err error)

func (*Reader) Has

func (r *Reader) Has(ctx context.Context,
	req *pb.HasRequest) (reply *pb.HasReply, err error)

func (*Reader) Iter

func (r *Reader) Iter(req *pb.IterRequest, client pb.Remote_IterServer) (err error)

func (*Reader) Open

func (r *Reader) Open(ctx context.Context,
	req *pb.OpenRequest) (reply *pb.OpenReply, err error)

func (*Reader) Put

func (r *Reader) Put(ctx context.Context,
	req *pb.PutRequest) (reply *pb.PutReply, err error)

func (*Reader) Snapshot

func (r *Reader) Snapshot(client pb.Remote_SnapshotServer) error

func (*Reader) Start

func (r *Reader) Start() (err error)

func (*Reader) Stat

func (r *Reader) Stat(ctx context.Context,
	req *pb.StatRequest) (reply *pb.StatReply, err error)

func (*Reader) Stats

func (r *Reader) Stats(ctx context.Context,
	req *pb.StatsRequest) (reply *pb.StatsReply, err error)

func (*Reader) Stop

func (r *Reader) Stop()

func (*Reader) Sync

func (r *Reader) Sync(req *pb.SyncRequest, client pb.Remote_SyncServer) error

type Remote

type Remote struct {
	// contains filtered or unexported fields
}

func OpenRemoteDB

func OpenRemoteDB(addr string, dbType, path string, IsMetaDB bool) (db *Remote, err error)

func (*Remote) Close

func (r *Remote) Close() (err error)

func (*Remote) Compact

func (r *Remote) Compact(start, limit []byte) (err error)

func (*Remote) Delete

func (r *Remote) Delete(key []byte) (err error)

func (*Remote) Get

func (r *Remote) Get(key []byte) (val []byte, err error)

func (*Remote) Has

func (r *Remote) Has(key []byte) (bool, error)

func (*Remote) NewBatch

func (r *Remote) NewBatch() db.Batch

func (*Remote) NewBatchWithSize

func (r *Remote) NewBatchWithSize(size int) db.Batch

func (*Remote) NewIterator

func (r *Remote) NewIterator(prefix []byte, start []byte) (iter db.Iterator)

func (*Remote) NewIteratorWithRange

func (r *Remote) NewIteratorWithRange(start, limit []byte) (iter db.Iterator, err error)

func (*Remote) NewSnapshot

func (r *Remote) NewSnapshot() (snapshot db.Snapshot, err error)

func (*Remote) Put

func (r *Remote) Put(key []byte, value []byte) (err error)

func (*Remote) Stat

func (r *Remote) Stat(property string) (stat string, err error)

func (*Remote) Stats

func (r *Remote) Stats() (stats map[string]string, err error)

type RemoteBatch

type RemoteBatch struct {
	// contains filtered or unexported fields
}

func (*RemoteBatch) Delete

func (r *RemoteBatch) Delete(key []byte) error

func (*RemoteBatch) Dump

func (r *RemoteBatch) Dump() []byte

func (*RemoteBatch) Load

func (r *RemoteBatch) Load(data []byte) error

func (*RemoteBatch) Put

func (r *RemoteBatch) Put(key []byte, value []byte) error

func (*RemoteBatch) Replay

func (r *RemoteBatch) Replay(w db.KeyValueWriter) error

func (*RemoteBatch) Reset

func (r *RemoteBatch) Reset()

func (*RemoteBatch) ValueSize

func (r *RemoteBatch) ValueSize() int

func (*RemoteBatch) Write

func (r *RemoteBatch) Write() error

type RemoteIterator

type RemoteIterator struct {
	// contains filtered or unexported fields
}

func (*RemoteIterator) Error

func (r *RemoteIterator) Error() error

func (*RemoteIterator) Key

func (r *RemoteIterator) Key() []byte

func (*RemoteIterator) Next

func (r *RemoteIterator) Next() bool

func (*RemoteIterator) Release

func (r *RemoteIterator) Release()

func (*RemoteIterator) Value

func (r *RemoteIterator) Value() []byte

type RemoteSnapshot

type RemoteSnapshot struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*RemoteSnapshot) Get

func (r *RemoteSnapshot) Get(key []byte) (val []byte, err error)

func (*RemoteSnapshot) Has

func (r *RemoteSnapshot) Has(key []byte) (has bool, err error)

func (*RemoteSnapshot) Release

func (r *RemoteSnapshot) Release()

type SyncClient

type SyncClient struct {
	// contains filtered or unexported fields
}

func NewSyncClient

func NewSyncClient(client pb.RemoteClient) *SyncClient

func (*SyncClient) Cancel

func (r *SyncClient) Cancel()

func (*SyncClient) SyncInit

func (r *SyncClient) SyncInit() error

func (*SyncClient) SyncNext

func (r *SyncClient) SyncNext() (*pb.Block, error)

Jump to

Keyboard shortcuts

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