Documentation ¶
Index ¶
- type ContextStore
- type RemoteProviderStore
- func (s *RemoteProviderStore) Delete(id string) error
- func (s *RemoteProviderStore) Get(id string) (*store.RemoteProviderRecord, error)
- func (s *RemoteProviderStore) GetAll() ([]store.RemoteProviderRecord, error)
- func (s *RemoteProviderStore) Save(endpoint string) (*store.RemoteProviderRecord, error)
- type Service
- func (s *Service) AddContexts(documents []context.Document) error
- func (s *Service) AddRemoteProvider(providerEndpoint string, opts ...remote.ProviderOpt) (string, error)
- func (s *Service) DeleteRemoteProvider(providerID string, opts ...remote.ProviderOpt) error
- func (s *Service) GetAllRemoteProviders() ([]store.RemoteProviderRecord, error)
- func (s *Service) RefreshAllRemoteProviders(opts ...remote.ProviderOpt) error
- func (s *Service) RefreshRemoteProvider(providerID string, opts ...remote.ProviderOpt) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextStore ¶
type ContextStore struct { Store *mockstorage.MockStore ErrGet error ErrPut error ErrImport error ErrDelete error }
ContextStore is a mock JSON-LD context store.
func NewMockContextStore ¶
func NewMockContextStore() *ContextStore
NewMockContextStore returns a new instance of ContextStore.
func (*ContextStore) Delete ¶
func (s *ContextStore) Delete(documents []context.Document) error
Delete deletes context documents in the underlying storage.
func (*ContextStore) Get ¶
func (s *ContextStore) Get(u string) (*jsonld.RemoteDocument, error)
Get returns JSON-LD remote document from the underlying storage by context url.
func (*ContextStore) Import ¶
func (s *ContextStore) Import(documents []context.Document) error
Import imports contexts into the underlying storage.
func (*ContextStore) Put ¶
func (s *ContextStore) Put(u string, rd *jsonld.RemoteDocument) error
Put saves JSON-LD remote document into the underlying storage under key u (context url).
type RemoteProviderStore ¶
type RemoteProviderStore struct { Store *mockstorage.MockStore ErrGet error ErrGetAll error ErrSave error ErrDelete error }
RemoteProviderStore is a mock remote JSON-LD context provider store.
func NewMockRemoteProviderStore ¶
func NewMockRemoteProviderStore() *RemoteProviderStore
NewMockRemoteProviderStore returns a new instance of RemoteProviderStore.
func (*RemoteProviderStore) Delete ¶
func (s *RemoteProviderStore) Delete(id string) error
Delete deletes a remote provider record in the underlying storage.
func (*RemoteProviderStore) Get ¶
func (s *RemoteProviderStore) Get(id string) (*store.RemoteProviderRecord, error)
Get returns a remote provider record from the underlying storage.
func (*RemoteProviderStore) GetAll ¶
func (s *RemoteProviderStore) GetAll() ([]store.RemoteProviderRecord, error)
GetAll returns all remote provider records from the underlying storage.
func (*RemoteProviderStore) Save ¶
func (s *RemoteProviderStore) Save(endpoint string) (*store.RemoteProviderRecord, error)
Save creates a new remote provider record and saves it to the underlying storage. If the record with specified endpoint already exists it is returned to the caller.
type Service ¶
type Service struct { ProviderID string RemoteProviderRecords []store.RemoteProviderRecord ErrAddContexts error ErrAddRemoteProvider error ErrRefreshRemoteProvider error ErrDeleteRemoteProvider error ErrGetAllRemoteProviders error ErrRefreshAllRemoteProviders error }
Service is a mock JSON-LD service.
func (*Service) AddContexts ¶
AddContexts adds JSON-LD contexts to the underlying storage.
func (*Service) AddRemoteProvider ¶
func (s *Service) AddRemoteProvider(providerEndpoint string, opts ...remote.ProviderOpt) (string, error)
AddRemoteProvider adds remote provider and JSON-LD contexts from that provider.
func (*Service) DeleteRemoteProvider ¶
func (s *Service) DeleteRemoteProvider(providerID string, opts ...remote.ProviderOpt) error
DeleteRemoteProvider deletes remote provider and contexts from that provider.
func (*Service) GetAllRemoteProviders ¶
func (s *Service) GetAllRemoteProviders() ([]store.RemoteProviderRecord, error)
GetAllRemoteProviders gets all remote providers.
func (*Service) RefreshAllRemoteProviders ¶
func (s *Service) RefreshAllRemoteProviders(opts ...remote.ProviderOpt) error
RefreshAllRemoteProviders updates contexts from all remote providers.
func (*Service) RefreshRemoteProvider ¶
func (s *Service) RefreshRemoteProvider(providerID string, opts ...remote.ProviderOpt) error
RefreshRemoteProvider updates contexts from the remote provider.