func NewSimpleDriver(driverOpts database.DriverOpts) *SQLite { manager := manager.New(manager.Opts{driverOpts}) return &SQLite{ DBManager: manager, directory: driverOpts.Directory, } }
func NewShardedDriver(driverOpts database.DriverOpts) (*Sharded, error) { manager := manager.New(manager.Opts{driverOpts}) cacheOpts := &diskache.Opts{ Directory: driverOpts.CacheDirectory, } cache, err := diskache.New(cacheOpts) if err != nil { return nil, err } driver := &Sharded{ DBManager: manager, directory: driverOpts.Directory, cache: cache, } return driver, nil }