27 lines
539 B
Go
27 lines
539 B
Go
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
|
|
|
package data
|
|
|
|
import (
|
|
)
|
|
|
|
// Convert a resource to a document and a document to a resource
|
|
|
|
type Emitter interface {
|
|
Emit(document Document, filter ResourceSelector) (Resource, error)
|
|
}
|
|
|
|
type Extracter interface {
|
|
Extract(resource Resource, filter ResourceSelector) (Document, error)
|
|
}
|
|
|
|
type Converter interface {
|
|
Typer
|
|
Emitter
|
|
Extracter
|
|
}
|
|
|
|
type ManyExtractor interface {
|
|
ExtractMany(resource Resource, filter ResourceSelector) ([]Document, error)
|
|
}
|