datastore.go 955 B

123456789101112131415161718192021
  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. // UpdateStatus updates the status of a datastore
  17. UpdateStatus(ctx context.Context, datastore *models.Datastore, status models.DatastoreStatus) (*models.Datastore, error)
  18. }