Documentation ¶
Index ¶
- type ContextStore
- type RemoteProviderStore
- func (s *RemoteProviderStore) Delete(id string) error
- func (s *RemoteProviderStore) Get(id string) (*ldstore.RemoteProviderRecord, error)
- func (s *RemoteProviderStore) GetAll() ([]ldstore.RemoteProviderRecord, error)
- func (s *RemoteProviderStore) Save(endpoint string) (*ldstore.RemoteProviderRecord, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextStore ¶
type ContextStore struct {
// contains filtered or unexported fields
}
ContextStore is mongodb implementation of JSON-LD context repository.
func NewContextStore ¶
func NewContextStore(mongoClient *mongodb.Client) (*ContextStore, error)
NewContextStore returns a new instance of ContextStore.
func (*ContextStore) Delete ¶
func (s *ContextStore) Delete(documents []ldcontext.Document) error
Delete deletes matched context documents in the underlying storage. Documents are matched by context URL and ld.RemoteDocument content hash.
func (*ContextStore) Get ¶
func (s *ContextStore) Get(u string) (*jsonld.RemoteDocument, error)
Get returns JSON-LD remote document from DB by context URL.
func (*ContextStore) Import ¶
func (s *ContextStore) Import(documents []ldcontext.Document) error
Import imports JSON-LD contexts into DB.
func (*ContextStore) Put ¶
func (s *ContextStore) Put(u string, rd *jsonld.RemoteDocument) error
Put saves JSON-LD remote document into DB.
type RemoteProviderStore ¶
type RemoteProviderStore struct {
// contains filtered or unexported fields
}
RemoteProviderStore is mongodb implementation of remote provider repository.
func NewRemoteProviderStore ¶
func NewRemoteProviderStore(mongoClient *mongodb.Client) (*RemoteProviderStore, error)
NewRemoteProviderStore returns a new instance of RemoteProviderStoreImpl.
func (*RemoteProviderStore) Delete ¶
func (s *RemoteProviderStore) Delete(id string) error
Delete deletes a remote provider record in DB.
func (*RemoteProviderStore) Get ¶
func (s *RemoteProviderStore) Get(id string) (*ldstore.RemoteProviderRecord, error)
Get returns a remote provider record from DB.
func (*RemoteProviderStore) GetAll ¶
func (s *RemoteProviderStore) GetAll() ([]ldstore.RemoteProviderRecord, error)
GetAll returns all remote provider records from DB.
func (*RemoteProviderStore) Save ¶
func (s *RemoteProviderStore) Save(endpoint string) (*ldstore.RemoteProviderRecord, error)
Save creates a new remote provider record and saves it into DB. If record with given endpoint already exists, it is returned to the caller.