Documentation ¶
Index ¶
- Constants
- Variables
- type Builder
- type CopyContext
- func (e *CopyContext) Builder() Builder
- func (e *CopyContext) Copy(id db.BucketID, key []byte) error
- func (e *CopyContext) Run() error
- func (e *CopyContext) Set(id db.BucketID, key, value []byte) error
- func (e *CopyContext) SetHeight(height int64)
- func (e *CopyContext) SetProgressCallback(cb module.ProgressCallback)
- func (e *CopyContext) SourceDB() db.Database
- func (e *CopyContext) TargetDB() db.Database
- type DataRequester
- type RequestIterator
Constants ¶
View Source
const (
DBFlagCopyContext = "copyContext"
)
View Source
const (
MaxNumberOfItemsToCopyInRow = 50
)
Variables ¶
View Source
var ( // ErrNoHasher will be returned if supplied BucketID doesn't have valid // hash function for verifying the received data. ErrNoHasher = errors.New("NoHasher") // ErrNoRequester will be returned if there is nobody who want the data. ErrNoRequester = errors.New("NoRequester") )
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder interface { OnData(bid db.BucketID, value []byte) error UnresolvedCount() int ResolvedCount() int Requests() RequestIterator RequestData(id db.BucketID, key []byte, requester DataRequester) Database() db.Database Flush(write bool) error }
func NewBuilder ¶
type CopyContext ¶
type CopyContext struct {
// contains filtered or unexported fields
}
func NewCopyContext ¶
func NewCopyContext(src db.Database, dst db.Database) *CopyContext
func PrepareCopyContext ¶ added in v1.3.2
func PrepareCopyContext(src db.Database, dst db.Database) *CopyContext
PrepareCopyContext prepares CopyContext for copying src to dst. If dst comes from another CopyContext, then it returns the original one for tracking progress properly.
func (*CopyContext) Builder ¶
func (e *CopyContext) Builder() Builder
func (*CopyContext) Run ¶
func (e *CopyContext) Run() error
func (*CopyContext) SetHeight ¶ added in v1.3.2
func (e *CopyContext) SetHeight(height int64)
func (*CopyContext) SetProgressCallback ¶ added in v1.3.2
func (e *CopyContext) SetProgressCallback(cb module.ProgressCallback)
func (*CopyContext) SourceDB ¶
func (e *CopyContext) SourceDB() db.Database
func (*CopyContext) TargetDB ¶
func (e *CopyContext) TargetDB() db.Database
type DataRequester ¶
Click to show internal directories.
Click to hide internal directories.