package resource

import (
	"context"
	"errors"

	"source.toby3d.me/toby3d/home/internal/domain"
)

type Repository interface {
	// Get returns Resource on path if exists.
	Get(ctx context.Context, path string) (*domain.Resource, error)

	// Fetch returns all resources from dir recursevly.
	Fetch(ctx context.Context, pattern string) (domain.Resources, int, error)
}

var ErrIsDir error = errors.New("resource is a directory")
