github.com/ethersphere/bee/v2@v2.2.0/pkg/storage/migration/export_test.go (about)

     1  // Copyright 2022 The Swarm Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package migration
     6  
     7  var (
     8  	ErrStorageVersionItemUnmarshalInvalidSize = errStorageVersionItemUnmarshalInvalidSize
     9  
    10  	SetVersion = setVersion
    11  )
    12  
    13  func DefaultOptions() *options {
    14  	return defaultOptions()
    15  }
    16  
    17  func (o *options) DeleteFn() ItemDeleteFn {
    18  	return o.deleteFn
    19  }
    20  
    21  func (o *options) UpdateFn() ItemUpdateFn {
    22  	return o.updateFn
    23  }
    24  
    25  func (o *options) OpPerBatch() int {
    26  	return o.opPerBatch
    27  }
    28  
    29  func (o *options) ApplyAll(opt ...option) {
    30  	o.applyAll(opt)
    31  }
    32  
    33  func WithOpPerBatch(count int) option {
    34  	return func(o *options) {
    35  		o.opPerBatch = count
    36  	}
    37  }