MCPcopy Create free account
hub / github.com/docker/docker-agent / NewDatabaseStore

Function NewDatabaseStore

pkg/modelsdev/store.go:143–145  ·  view source on GitHub ↗

NewDatabaseStore creates a Store pre-populated with the given database. The returned store serves data entirely from memory and never fetches from the network or touches the filesystem, making it suitable for tests and any scenario where the provider data is already known.

(db *Database)

Source from the content-addressed store, hash-verified

141// from the network or touches the filesystem, making it suitable for
142// tests and any scenario where the provider data is already known.
143func NewDatabaseStore(db *Database) *Store {
144 return &Store{db: db, fetch: fetchFromAPI}
145}
146
147// GetDatabase returns the models.dev database, fetching from cache or API as needed.
148func (s *Store) GetDatabase(ctx context.Context) (*Database, error) {

Calls

no outgoing calls