Skip to content
Snippets Groups Projects
Select Git revision
  • c974e931730dc5b0b6436edca1780c38271d291f
  • main default protected
2 results

draft_kidney.ipynb

Blame
  • objectstorage.go 654 B
    package branchmanager
    
    import (
    	"time"
    
    	"github.com/iotaledger/hive.go/objectstorage"
    )
    
    const (
    	// the following values are a list of prefixes defined as an enum
    	_ byte = iota
    
    	// prefixes used for the objectstorage
    	osBranch
    )
    
    var (
    	osLeakDetectionOption = objectstorage.LeakDetectionEnabled(false, objectstorage.LeakDetectionOptions{
    		MaxConsumersPerObject: 10,
    		MaxConsumerHoldTime:   10 * time.Second,
    	})
    
    	osBranchOptions = []objectstorage.Option{
    		objectstorage.CacheTime(60 * time.Second),
    		osLeakDetectionOption,
    	}
    )
    
    func osBranchFactory(key []byte) (objectstorage.StorableObject, int, error) {
    	return BranchFromStorageKey(key)
    }