remote

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient represents an HTTP client.

type Provider

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

Provider is a remote JSON-LD context provider.

func NewProvider

func NewProvider(endpoint string, opts ...ProviderOpt) *Provider

NewProvider returns a new instance of the remote provider.

func (*Provider) Contexts

func (p *Provider) Contexts() ([]ldcontext.Document, error)

Contexts returns JSON-LD contexts from the remote source.

func (*Provider) Endpoint

func (p *Provider) Endpoint() string

Endpoint returns endpoint of the remote JSON-LD context source.

type ProviderOpt

type ProviderOpt func(*Provider)

ProviderOpt configures the remote context provider.

func WithHTTPClient

func WithHTTPClient(client HTTPClient) ProviderOpt

WithHTTPClient configures an HTTP client.

type Response

type Response struct {
	Documents []ldcontext.Document `json:"documents"`
}

Response represents a response from the remote source with JSON-LD context documents.

Jump to

Keyboard shortcuts

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