ld

package
v0.0.0-...-57c6170 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultService

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

DefaultService is a default implementation of Service.

func New

func New(ctx provider) *DefaultService

New returns a new default JSON-LD service instance.

func (*DefaultService) AddContexts

func (s *DefaultService) AddContexts(documents []ldcontext.Document) error

AddContexts adds JSON-LD contexts to the underlying storage.

func (*DefaultService) AddRemoteProvider

func (s *DefaultService) AddRemoteProvider(providerEndpoint string, opts ...remote.ProviderOpt) (string, error)

AddRemoteProvider adds remote provider and JSON-LD contexts from that provider.

func (*DefaultService) DeleteRemoteProvider

func (s *DefaultService) DeleteRemoteProvider(providerID string, opts ...remote.ProviderOpt) error

DeleteRemoteProvider deletes remote provider and contexts from that provider.

func (*DefaultService) GetAllRemoteProviders

func (s *DefaultService) GetAllRemoteProviders() ([]ld.RemoteProviderRecord, error)

GetAllRemoteProviders gets all remote providers.

func (*DefaultService) RefreshAllRemoteProviders

func (s *DefaultService) RefreshAllRemoteProviders(opts ...remote.ProviderOpt) error

RefreshAllRemoteProviders updates contexts from all remote providers.

func (*DefaultService) RefreshRemoteProvider

func (s *DefaultService) RefreshRemoteProvider(providerID string, opts ...remote.ProviderOpt) error

RefreshRemoteProvider updates contexts from the remote provider.

type Service

type Service interface {
	AddContexts(documents []ldcontext.Document) error
	AddRemoteProvider(providerEndpoint string, opts ...remote.ProviderOpt) (string, error)
	RefreshRemoteProvider(providerID string, opts ...remote.ProviderOpt) error
	DeleteRemoteProvider(providerID string, opts ...remote.ProviderOpt) error
	GetAllRemoteProviders() ([]ld.RemoteProviderRecord, error)
	RefreshAllRemoteProviders(opts ...remote.ProviderOpt) error
}

Service is a service that supports JSON-LD operations.

Jump to

Keyboard shortcuts

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