Add content and snapshot store references
Update database object to hold reference to the data stores. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
@@ -25,10 +25,17 @@ type contentStore struct {
|
||||
// NewContentStore returns a namespaced content store using an existing
|
||||
// content store interface.
|
||||
func NewContentStore(db *DB, cs content.Store) content.Store {
|
||||
return &contentStore{
|
||||
Store: cs,
|
||||
db: db,
|
||||
db.storeL.Lock()
|
||||
defer db.storeL.Unlock()
|
||||
|
||||
if db.cs == nil {
|
||||
db.cs = &contentStore{
|
||||
Store: cs,
|
||||
db: db,
|
||||
}
|
||||
}
|
||||
return db.cs
|
||||
|
||||
}
|
||||
|
||||
func (cs *contentStore) Info(ctx context.Context, dgst digest.Digest) (content.Info, error) {
|
||||
|
||||
Reference in New Issue
Block a user