source.go 425 B

12345678910111213141516
  1. package sources
  2. import (
  3. "context"
  4. )
  5. // FragmentsFunc is the type of function called by Fragments to yield the next
  6. // fragment
  7. type FragmentsFunc func(fragment Fragment, err error) error
  8. // Source is a thing that can yield fragments
  9. type Source interface {
  10. // Fragments provides a filepath.WalkDir like interface for scanning the
  11. // fragments in the source
  12. Fragments(ctx context.Context, yield FragmentsFunc) error
  13. }