atom/extensionElement.go

24 lines
429 B
Go
Raw Normal View History

2024-10-13 17:19:40 +02:00
package atomfeed
import (
"encoding/xml"
"errors"
)
type ExtensionElement struct {
Value any `xml:",innerxml"`
XMLName xml.Name
}
func NewExtensionElement(name string, value any) *ExtensionElement {
return &ExtensionElement{XMLName: xml.Name{Local: name}, Value: value}
}
2024-10-13 17:19:40 +02:00
func (e *ExtensionElement) Check() error {
if e.Value == nil {
return errors.New("value element of extension element empty")
}
return nil
}