jx/internal/data/converter.go

27 lines
539 B
Go
Raw Normal View History

2024-08-15 15:12:42 +00:00
// 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)
}