jx/internal/data/identifier.go

33 lines
556 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 (
"errors"
"net/url"
2024-08-15 15:12:42 +00:00
)
var (
ErrInvalidURI error = errors.New("Invalid URI")
)
type Identifier interface {
URI() string
SetURI(string) error
SetParsedURI(*url.URL) error
}
type DocumentElement interface {
Identifier
2024-08-15 15:12:42 +00:00
}
type Selector[Item comparable] func(r Item) bool
type ResourceSelector Selector[Resource]
type DeclarationSelector Selector[Declaration]
type BlockSelector Selector[Block]
type ElementSelector Selector[DocumentElement]