jx/internal/folio/resource.go
Matthew Rich 6e0049c4d2
Some checks are pending
Lint / golangci-lint (push) Waiting to run
Declarative Tests / test (push) Waiting to run
Declarative Tests / build-fedora (push) Waiting to run
Declarative Tests / build-ubuntu-focal (push) Waiting to run
add resource and document constraints
2024-09-19 07:57:26 +00:00

27 lines
560 B
Go

// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
package folio
import (
"net/url"
"decl/internal/data"
)
var (
)
/* Create a new resource using a parsed URI */
func NewResourceFromParsedURI(u *url.URL, document data.Document) (newResource data.Resource, err error) {
if document == nil {
declaration := NewDeclaration()
if err = declaration.NewResourceFromParsedURI(u); err == nil {
return declaration.Attributes, err
}
} else {
newResource, err = document.NewResourceFromParsedURI(u)
return
}
return
}