ld

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 14

Documentation

Index

Constants

View Source
const (
	OperationID                   = "/ld"
	AddContextsPath               = OperationID + "/context"
	AddRemoteProviderPath         = OperationID + "/remote-provider"
	RefreshRemoteProviderPath     = OperationID + "/remote-provider/{id}/refresh"
	DeleteRemoteProviderPath      = OperationID + "/remote-provider/{id}"
	GetAllRemoteProvidersPath     = OperationID + "/remote-providers"
	RefreshAllRemoteProvidersPath = OperationID + "/remote-providers/refresh"
)

constants for the JSON-LD operations.

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 Operation

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

Operation contains REST operations provided by JSON-LD API.

func New

func New(svc ld.Service, opts ...Option) *Operation

New returns a new instance of JSON-LD REST controller.

func (*Operation) AddContexts

func (o *Operation) AddContexts(rw http.ResponseWriter, req *http.Request)

AddContexts swagger:route POST /ld/context ld addContextsReq

Adds JSON-LD contexts to the underlying storage.

Responses:

default: genericError

func (*Operation) AddRemoteProvider

func (o *Operation) AddRemoteProvider(rw http.ResponseWriter, req *http.Request)

AddRemoteProvider swagger:route POST /ld/remote-provider ld addRemoteProviderReq

Adds remote provider and JSON-LD contexts from that provider to the underlying storage.

Responses:

default: genericError

func (*Operation) DeleteRemoteProvider

func (o *Operation) DeleteRemoteProvider(rw http.ResponseWriter, req *http.Request)

DeleteRemoteProvider swagger:route DELETE /ld/remote-provider/{id} ld deleteRemoteProviderReq

Deletes remote provider and JSON-LD contexts from that provider from the underlying storage.

Responses:

default: genericError

func (*Operation) GetAllRemoteProviders

func (o *Operation) GetAllRemoteProviders(rw http.ResponseWriter, req *http.Request)

GetAllRemoteProviders swagger:route GET /ld/remote-providers ld getAllRemoteProvidersReq

Gets all remote providers from the underlying storage.

Responses:

default: genericError
200: getAllRemoteProvidersResp

func (*Operation) GetRESTHandlers

func (o *Operation) GetRESTHandlers() []rest.Handler

GetRESTHandlers gets all controller API handlers available for this service.

func (*Operation) RefreshAllRemoteProviders

func (o *Operation) RefreshAllRemoteProviders(rw http.ResponseWriter, req *http.Request)

RefreshAllRemoteProviders swagger:route POST /ld/remote-providers/refresh ld refreshAllRemoteProvidersReq

Updates contexts from all remote providers in the underlying storage.

Responses:

default: genericError

func (*Operation) RefreshRemoteProvider

func (o *Operation) RefreshRemoteProvider(rw http.ResponseWriter, req *http.Request)

RefreshRemoteProvider swagger:route POST /ld/remote-provider/{id}/refresh ld refreshRemoteProviderReq

Updates contexts from the remote provider.

Responses:

default: genericError

type Option

type Option func(opts *options)

Option configures the JSON-LD controller options.

func WithHTTPClient

func WithHTTPClient(client HTTPClient) Option

WithHTTPClient sets the custom HTTP client.

Jump to

Keyboard shortcuts

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