Skip to content

Commit f49eb6c

Browse files
committed
move SourceRepositoryStore around & log
1 parent ea7b196 commit f49eb6c

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

go/internal/database/datastore/internal/validate/validate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,6 @@ def main() -> int:
158158

159159
if __name__ == '__main__':
160160
with osv.tests.datastore_emulator(), ndb.Client().context():
161+
print('Datastore emulator running')
161162
ret = main()
162163
sys.exit(ret)

go/internal/models/source_repository.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ import (
77
"time"
88
)
99

10+
type SourceRepositoryStore interface {
11+
// Get retrieves a source repository by its name.
12+
// Returns ErrNotFound if the repository does not exist.
13+
Get(ctx context.Context, name string) (*SourceRepository, error)
14+
15+
// Update creates or updates a source repository.
16+
// The name argument must match repo.Name.
17+
Update(ctx context.Context, name string, repo *SourceRepository) error
18+
19+
// All returns an iterator over all source repositories.
20+
All(ctx context.Context) iter.Seq2[*SourceRepository, error]
21+
}
22+
1023
type SourceRepositoryType int
1124

1225
const (
@@ -91,16 +104,3 @@ type SourceRepoREST struct {
91104
// Ignore deletion threshold.
92105
IgnoreDeletionThreshold bool
93106
}
94-
95-
type SourceRepositoryStore interface {
96-
// Get retrieves a source repository by its name.
97-
// Returns ErrNotFound if the repository does not exist.
98-
Get(ctx context.Context, name string) (*SourceRepository, error)
99-
100-
// Update creates or updates a source repository.
101-
// The name argument must match repo.Name.
102-
Update(ctx context.Context, name string, repo *SourceRepository) error
103-
104-
// All returns an iterator over all source repositories.
105-
All(ctx context.Context) iter.Seq2[*SourceRepository, error]
106-
}

0 commit comments

Comments
 (0)