30 lines
		
	
	
	
		
			512 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			30 lines
		
	
	
	
		
			512 B
		
	
	
	
		
			Go
		
	
	
	
	
	
|  | package sqlite | ||
|  | 
 | ||
|  | import ( | ||
|  | 	"codeberg.org/danjones000/lenore/config" | ||
|  | 	"codeberg.org/danjones000/lenore/store" | ||
|  | 	"github.com/go-ap/storage-sqlite" | ||
|  | ) | ||
|  | 
 | ||
|  | func init() { | ||
|  | 	store.AddFactory("sqlite", MakeStore) | ||
|  | } | ||
|  | 
 | ||
|  | func MakeStore(conf config.Config) (store.Store, error) { | ||
|  | 	sqlConf := sqlite.Config{Path: conf.Conn.DSN} | ||
|  | 	db, err := sqlite.New(sqlConf) | ||
|  | 	if err != nil { | ||
|  | 		return nil, err | ||
|  | 	} | ||
|  | 	return Repo{db}, nil | ||
|  | } | ||
|  | 
 | ||
|  | type Repo struct { | ||
|  | 	store.PartStore | ||
|  | } | ||
|  | 
 | ||
|  | func (r Repo) Bootstrap(config.Config) error { | ||
|  | 	// @todo | ||
|  | 	return nil | ||
|  | } |