datastore.go 782 B

12345678910111213141516171819
  1. package repository
  2. import (
  3. "context"
  4. "github.com/porter-dev/porter/internal/models"
  5. )
  6. // DatastoreRepository represents the set of queries on the Datastore model
  7. type DatastoreRepository interface {
  8. // GetByProjectIDAndName retrieves a datastore by project id and name
  9. GetByProjectIDAndName(ctx context.Context, projectID uint, name string) (*models.Datastore, error)
  10. // Insert inserts a datastore into the database
  11. Insert(ctx context.Context, datastore *models.Datastore) (*models.Datastore, error)
  12. // ListByProjectID retrieves a list of datastores by project id
  13. ListByProjectID(ctx context.Context, projectID uint) ([]*models.Datastore, error)
  14. // Delete deletes a datastore by id
  15. Delete(ctx context.Context, datastore *models.Datastore) (*models.Datastore, error)
  16. }