Versions in this module Expand all Collapse all v1 v1.0.1 Jun 30, 2026 v1.0.0 Jun 30, 2026 Changes in this version + var ErrEmptyData = errors.New("empty data provided") + var ErrInvalidLink = errors.New("invalid JLINK reference") + var ErrInvalidURI = errors.New("invalid URI in JLINK reference") + var ErrMetadataTooLarge = security.ErrMetadataTooLarge + var ErrNilData = errors.New("nil data provided") + var ErrNoLinksFound = errors.New("no JLINK references found") + var ErrReferenceLimitExceeded = security.ErrTooManyReferences + var ErrTruncatedData = errors.New("truncated JLINK data") + var ErrUnsafeURI = errors.New("potentially unsafe URI") + var ErrUnsupportedScheme = errors.New("unsupported URI scheme") + var JLINKBoxType = [4]byte + var JLINKUUID = [16]byte + func EncodeBinaryLinks(c *LinkCollection) ([]byte, error) + func ResolveRelativeURI(baseURL, relativeURI string) (string, error) + type ContentRetriever interface + Retrieve func(uri string) ([]byte, error) + type LinkCollection struct + FormatVersion uint8 + Links []*LinkReference + RawData []byte + Version string + func NewLinkCollection() *LinkCollection + func ParseBinaryLinks(data []byte) (*LinkCollection, error) + func (c *LinkCollection) AddLink(link *LinkReference) + func (c *LinkCollection) Count() int + func (c *LinkCollection) FindByType(refType ReferenceType) []*LinkReference + func (c *LinkCollection) FindHTTPLinks() []*LinkReference + func (c *LinkCollection) FindSafeLinks() []*LinkReference + type LinkReference struct + Description string + FileSize int64 + Height int + Index int + Label string + LinkType LinkType + MediaType *MediaType + ParsedURI *url.URL + ReferenceType ReferenceType + URI string + Width int + func (l *LinkReference) IsHTTP() bool + func (l *LinkReference) IsSafe() bool + func (l *LinkReference) IsValid() bool + type LinkType uint8 + const LinkTypeEmbedded + const LinkTypeExternal + const LinkTypeFragment + const LinkTypeRelative + const LinkTypeURN + const LinkTypeUnknown + func (t LinkType) IsValid() bool + func (t LinkType) String() string + type MediaType struct + Parameters map[string]string + Subtype string + Type string + func ParseMediaType(s string) *MediaType + func (m *MediaType) String() string + type NoOpRetriever struct + func (r *NoOpRetriever) Retrieve(uri string) ([]byte, error) + type ParseError struct + Cause error + LinkIndex int + Message string + Offset int64 + func NewParseError(offset int64, linkIndex int, message string, cause error) *ParseError + func (e *ParseError) Error() string + func (e *ParseError) Unwrap() error + type Parser struct + func NewParser() *Parser + func NewParserWithLimits(maxSize int64, maxRefs int) *Parser + func (p *Parser) Detect(data []byte) (bool, *LinkCollection, error) + func (p *Parser) ExtractURIs(data []byte) ([]string, error) + func (p *Parser) GetLinkCount(data []byte) (int, error) + func (p *Parser) Parse(data []byte) (*LinkCollection, error) + func (p *Parser) ParseFromJUMBF(payload []byte) (*LinkCollection, error) + type ReferenceType uint8 + const RefTypeAlternate + const RefTypeAudio + const RefTypeChild + const RefTypeHighRes + const RefTypeLowRes + const RefTypeMetadata + const RefTypeParent + const RefTypeRelated + const RefTypeSupplement + const RefTypeThumbnail + const RefTypeUnknown + const RefTypeVideo + func (r ReferenceType) IsValid() bool + func (r ReferenceType) String() string