36 lines
637 B
Go
36 lines
637 B
Go
|
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
|
||
|
|
||
|
package target
|
||
|
|
||
|
import (
|
||
|
_ "context"
|
||
|
_ "encoding/json"
|
||
|
_ "fmt"
|
||
|
_ "gopkg.in/yaml.v3"
|
||
|
_ "net/url"
|
||
|
_ "regexp"
|
||
|
_ "strings"
|
||
|
_ "os"
|
||
|
_ "io"
|
||
|
"decl/internal/resource"
|
||
|
)
|
||
|
|
||
|
// convert a document into some other container type
|
||
|
|
||
|
// move selector to resource pkg
|
||
|
// type ResourceSelector func(r resource.Resource) bool
|
||
|
|
||
|
type DocTarget interface {
|
||
|
Type() string
|
||
|
|
||
|
EmitResources(documents []*resource.Document, filter resource.ResourceSelector) error
|
||
|
}
|
||
|
|
||
|
func NewDocTarget(uri string) DocTarget {
|
||
|
s, e := TargetTypes.New(uri)
|
||
|
if e == nil {
|
||
|
return s
|
||
|
}
|
||
|
return nil
|
||
|
}
|