starttls-backend
starttls-backend copied to clipboard
Move store interfaces to models
We store a database interface on the API, which includes all the methods of the SQL database. That interface is only ever satisfied in our code the the SQL database in db/sqldb.go
- We could mock small pieces of the database in the model layer by passing the DB to model functions as a param and casting it to a smaller interface (eg
ScanStore). - We don't necessarily need to represent the DB as an interface on the API, since we write end-to-end tests that access the actual SQL implementation.