jsonldtype

package
v0.0.0-...-0a5fe96 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachingDocumentLoader

type CachingDocumentLoader struct {
	// contains filtered or unexported fields
}

func NewCachingDocumentLoader

func NewCachingDocumentLoader(upstream DocumentLoader) *CachingDocumentLoader

func (CachingDocumentLoader) LoadDocument

type DefaultDocumentLoader

type DefaultDocumentLoader struct {
	// contains filtered or unexported fields
}

func NewDefaultDocumentLoader

func NewDefaultDocumentLoader(client *http.Client) *DefaultDocumentLoader

func (*DefaultDocumentLoader) LoadDocument

type DocumentLoader

type DocumentLoader interface {
	LoadDocument(ctx context.Context, url string, opts DocumentLoaderOptions) (RemoteDocument, error)
}

type DocumentLoaderFunc

type DocumentLoaderFunc func(ctx context.Context, url string, opts DocumentLoaderOptions) (RemoteDocument, error)

func (DocumentLoaderFunc) LoadDocument

type DocumentLoaderOptions

type DocumentLoaderOptions struct {
	ExtractAllScripts bool
	Profile           *string
	RequestProfile    []string
}

type Error

type Error struct {
	Code ErrorCode
	Err  error
}

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

type ErrorCode

type ErrorCode string
const (
	CollidingKeywords           ErrorCode = "colliding keywords"
	ConflictingIndexes          ErrorCode = "conflicting indexes"
	ContextOverflow             ErrorCode = "context overflow"
	CyclicIRIMapping            ErrorCode = "cyclic IRI mapping"
	InvalidAtIDValue            ErrorCode = "invalid @id value"
	InvalidAtImportValue        ErrorCode = "invalid @import value"
	InvalidAtIncludedValue      ErrorCode = "invalid @included value"
	InvalidAtIndexValue         ErrorCode = "invalid @index value"
	InvalidAtNestValue          ErrorCode = "invalid @nest value"
	InvalidAtPrefixValue        ErrorCode = "invalid @prefix value"
	InvalidAtPropagateValue     ErrorCode = "invalid @propagate value"
	InvalidAtProtectedValue     ErrorCode = "invalid @protected value"
	InvalidAtReverseValue       ErrorCode = "invalid @reverse value"
	InvalidAtVersionValue       ErrorCode = "invalid @version value"
	InvalidBaseDirection        ErrorCode = "invalid base direction"
	InvalidBaseIRI              ErrorCode = "invalid base IRI"
	InvalidContainerMapping     ErrorCode = "invalid container mapping"
	InvalidContextEntry         ErrorCode = "invalid context entry"
	InvalidContextNullification ErrorCode = "invalid context nullification"
	InvalidDefaultLanguage      ErrorCode = "invalid default language"
	InvalidIRIMapping           ErrorCode = "invalid IRI mapping"
	InvalidJSONLiteral          ErrorCode = "invalid JSON literal"
	InvalidKeywordAlias         ErrorCode = "invalid keyword alias"
	InvalidLanguageMapValue     ErrorCode = "invalid language map value"
	InvalidLanguageMapping      ErrorCode = "invalid language mapping"
	InvalidLanguageTaggedString ErrorCode = "invalid language-tagged string"
	InvalidLanguageTaggedValue  ErrorCode = "invalid language-tagged value"
	InvalidLocalContext         ErrorCode = "invalid local context"
	InvalidRemoteContext        ErrorCode = "invalid remote context"
	InvalidReversePropertyMap   ErrorCode = "invalid reverse property map"
	InvalidReversePropertyValue ErrorCode = "invalid reverse property value"
	InvalidReverseProperty      ErrorCode = "invalid reverse property"
	InvalidScopedContext        ErrorCode = "invalid scoped context"
	InvalidScriptElement        ErrorCode = "invalid script element"
	InvalidSetOrListObject      ErrorCode = "invalid set or list object"
	InvalidTermDefinition       ErrorCode = "invalid term definition"
	InvalidTypeMapping          ErrorCode = "invalid type mapping"
	InvalidTypeValue            ErrorCode = "invalid type value"
	InvalidTypedValue           ErrorCode = "invalid typed value"
	InvalidValueObjectValue     ErrorCode = "invalid value object value"
	InvalidValueObject          ErrorCode = "invalid value object"
	InvalidVocabMapping         ErrorCode = "invalid vocab mapping"
	IRIConfusedWithPrefix       ErrorCode = "IRI confused with prefix"
	KeywordRedefinition         ErrorCode = "keyword redefinition"
	LoadingDocumentFailed       ErrorCode = "loading document failed"
	LoadingRemoteContextFailed  ErrorCode = "loading remote context failed"
	MultipleContextLinkHeaders  ErrorCode = "multiple context link headers"
	ProcessingModeConflict      ErrorCode = "processing mode conflict"
	ProtectedTermRedefinition   ErrorCode = "protected term redefinition"
)

type ProcessorOptions

type ProcessorOptions struct {
	ProcessingMode string
	BaseURL        string
	DocumentLoader DocumentLoader
	ExpandContext  inspectjson.Value
}

type RemoteDocument

type RemoteDocument struct {
	ContentType string
	ContextURL  *url.URL
	Document    inspectjson.Value
	DocumentURL *url.URL
	Profile     string
	Headers     http.Header
}

[spec // 9.4.3] The RemoteDocument type is used by a LoadDocumentCallback to return information about a remote document or context.

type UnknownKeywordError

type UnknownKeywordError struct {
	Keyword string
}

func (*UnknownKeywordError) Error

func (e *UnknownKeywordError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL