github.com/ndau/noms@v1.0.5/go/nbs/benchmarks/null_block_store.go (about)

     1  // Copyright 2016 Attic Labs, Inc. All rights reserved.
     2  // Licensed under the Apache License, version 2.0:
     3  // http://www.apache.org/licenses/LICENSE-2.0
     4  
     5  package main
     6  
     7  import (
     8  	"github.com/ndau/noms/go/chunks"
     9  	"github.com/ndau/noms/go/hash"
    10  )
    11  
    12  type nullBlockStore struct {
    13  	bogus int32
    14  }
    15  
    16  func newNullBlockStore() chunks.ChunkStore {
    17  	return nullBlockStore{}
    18  }
    19  
    20  func (nb nullBlockStore) Get(h hash.Hash) chunks.Chunk {
    21  	panic("not impl")
    22  }
    23  
    24  func (nb nullBlockStore) GetMany(hashes hash.HashSet, foundChunks chan *chunks.Chunk) {
    25  	panic("not impl")
    26  }
    27  
    28  func (nb nullBlockStore) Has(h hash.Hash) bool {
    29  	panic("not impl")
    30  }
    31  
    32  func (nb nullBlockStore) HasMany(hashes hash.HashSet) (present hash.HashSet) {
    33  	panic("not impl")
    34  }
    35  
    36  func (nb nullBlockStore) Put(c chunks.Chunk) {}
    37  
    38  func (nb nullBlockStore) Version() string {
    39  	panic("not impl")
    40  }
    41  
    42  func (nb nullBlockStore) Close() error {
    43  	return nil
    44  }
    45  
    46  func (nb nullBlockStore) Rebase() {}
    47  
    48  func (nb nullBlockStore) Stats() interface{} {
    49  	return nil
    50  }
    51  
    52  func (nb nullBlockStore) StatsSummary() string {
    53  	return "Unsupported"
    54  }
    55  
    56  func (nb nullBlockStore) Root() hash.Hash {
    57  	return hash.Hash{}
    58  }
    59  
    60  func (nb nullBlockStore) Commit(current, last hash.Hash) bool {
    61  	return true
    62  }