github.com/authzed/spicedb@v1.32.1-0.20240520085336-ebda56537386/internal/testserver/datastore/memory.go (about)

     1  //go:build docker
     2  // +build docker
     3  
     4  package datastore
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/authzed/spicedb/pkg/datastore"
    10  )
    11  
    12  type memoryTest struct{}
    13  
    14  // RunMemoryForTesting returns a RunningEngineForTest for the in-memory driver.
    15  func RunMemoryForTesting(_ testing.TB) RunningEngineForTest {
    16  	return &memoryTest{}
    17  }
    18  
    19  func (b *memoryTest) NewDatabase(_ testing.TB) string {
    20  	// Does nothing.
    21  	return ""
    22  }
    23  
    24  func (b *memoryTest) NewDatastore(_ testing.TB, initFunc InitFunc) datastore.Datastore {
    25  	return initFunc("memory", "")
    26  }