jx/internal/data/converter.go
Matthew Rich 06f3247b08
Some checks failed
Lint / golangci-lint (push) Has been cancelled
Declarative Tests / test (push) Has been cancelled
Declarative Tests / build-fedora (push) Has been cancelled
Declarative Tests / build-ubuntu-focal (push) Has been cancelled
add interfaces
2024-08-15 08:12:42 -07:00

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)
}