Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrContextNotFound = documentloader.ErrContextNotFound
ErrContextNotFound is returned when JSON-LD context document is not found in the underlying storage.
Functions ¶
This section is empty.
Types ¶
type DocumentLoader ¶
type DocumentLoader = documentloader.DocumentLoader
DocumentLoader is an implementation of ld.DocumentLoader backed by storage.
func NewDocumentLoader ¶
func NewDocumentLoader(ctx provider, opts ...DocumentLoaderOpts) (*DocumentLoader, error)
NewDocumentLoader returns a new DocumentLoader instance.
Embedded contexts (`ldcontext/embed/third_party`) are preloaded into the underlying storage. Additional contexts can be set using WithExtraContexts() option or provided by one or more remote providers. Use multiple WithRemoteProvider() options for setting up more than one remote JSON-LD context provider.
By default, missing contexts are not fetched from the remote URL. Use WithRemoteDocumentLoader() option to specify a custom loader that can resolve context documents from the network.
type DocumentLoaderOpts ¶
type DocumentLoaderOpts = documentloader.Opts
DocumentLoaderOpts configures DocumentLoader during creation.
func WithExtraContexts ¶
func WithExtraContexts(contexts ...ldcontext.Document) DocumentLoaderOpts
WithExtraContexts sets the extra contexts (in addition to embedded) for preloading into the underlying storage.
func WithRemoteDocumentLoader ¶
func WithRemoteDocumentLoader(loader jsonld.DocumentLoader) DocumentLoaderOpts
WithRemoteDocumentLoader specifies loader for fetching JSON-LD context documents from remote URLs. Documents are fetched with this loader only if they are not found in the underlying storage.
func WithRemoteProvider ¶
func WithRemoteProvider(provider RemoteProvider) DocumentLoaderOpts
WithRemoteProvider adds a remote JSON-LD context provider to the list of providers.
type RemoteProvider ¶
type RemoteProvider = documentloader.RemoteProvider
RemoteProvider defines a remote JSON-LD context provider.