app_instance.go 675 B

123456789101112131415161718192021222324
  1. package test
  2. import (
  3. "context"
  4. "errors"
  5. "github.com/porter-dev/porter/internal/models"
  6. "github.com/porter-dev/porter/internal/repository"
  7. )
  8. // AppInstanceRepository is a test repository that implements repository.AppInstanceRepository
  9. type AppInstanceRepository struct {
  10. canQuery bool
  11. }
  12. // NewAppInstanceRepository returns the test AppInstanceRepository
  13. func NewAppInstanceRepository() repository.AppInstanceRepository {
  14. return &AppInstanceRepository{canQuery: false}
  15. }
  16. // Get returns an app instance by its id
  17. func (repo *AppInstanceRepository) Get(ctx context.Context, id string) (*models.AppInstance, error) {
  18. return nil, errors.New("cannot read database")
  19. }