ld

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDocumentLoader

func NewDocumentLoader(p provider, opts ...lddocloader.Opts) (jsonld.DocumentLoader, error)

NewDocumentLoader returns a JSON-LD document loader with preloaded contexts.

Types

type Cache

type Cache interface {
	Get(key interface{}) (interface{}, bool)
	Set(key, value interface{}, cost int64) bool
	Del(key interface{})
}

Cache represents caching functionality. Concrete implementation is expected to be thread-safe.

type CachedContextStore

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

CachedContextStore is a cached store for JSON-LD contexts.

func NewCachedContextStore

func NewCachedContextStore(cacheImpl Cache, contextStore ContextStore) *CachedContextStore

func (*CachedContextStore) Delete

func (s *CachedContextStore) Delete(documents []ldcontext.Document) error

func (*CachedContextStore) Get

func (*CachedContextStore) Import

func (s *CachedContextStore) Import(documents []ldcontext.Document) error

func (*CachedContextStore) Put

type ContextStore

type ContextStore = ldstore.ContextStore

type StoreProvider

type StoreProvider struct {
	ContextStore        ldstoreapi.ContextStore
	RemoteProviderStore ldstoreapi.RemoteProviderStore
	CacheImpl           Cache
}

StoreProvider provides stores for JSON-LD contexts and remote providers.

func NewStoreProvider

func NewStoreProvider(mongoClient *mongodb.Client, cacheImpl Cache) (*StoreProvider, error)

NewStoreProvider returns a new instance of StoreProvider.

func (*StoreProvider) JSONLDContextStore

func (p *StoreProvider) JSONLDContextStore() ldstoreapi.ContextStore

JSONLDContextStore returns JSON-LD context store.

func (*StoreProvider) JSONLDRemoteProviderStore

func (p *StoreProvider) JSONLDRemoteProviderStore() ldstoreapi.RemoteProviderStore

JSONLDRemoteProviderStore returns JSON-LD remote provider store.

Jump to

Keyboard shortcuts

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