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 (s *CachedContextStore) Get(u string) (*jsonld.RemoteDocument, error)
func (*CachedContextStore) Import ¶
func (s *CachedContextStore) Import(documents []ldcontext.Document) error
func (*CachedContextStore) Put ¶
func (s *CachedContextStore) Put(u string, rd *jsonld.RemoteDocument) error
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.
Click to show internal directories.
Click to hide internal directories.