Documentation ¶
Index ¶
- Constants
- type AddContextsRequest
- type AddRemoteProviderRequest
- type Command
- func (c *Command) AddContexts(w io.Writer, r io.Reader) command.Error
- func (c *Command) AddRemoteProvider(w io.Writer, r io.Reader) command.Error
- func (c *Command) DeleteRemoteProvider(w io.Writer, r io.Reader) command.Error
- func (c *Command) GetAllRemoteProviders(w io.Writer, _ io.Reader) command.Error
- func (c *Command) GetHandlers() []command.Handler
- func (c *Command) RefreshAllRemoteProviders(w io.Writer, _ io.Reader) command.Error
- func (c *Command) RefreshRemoteProvider(w io.Writer, r io.Reader) command.Error
- type GetAllRemoteProvidersResponse
- type HTTPClient
- type Option
- type ProviderID
Constants ¶
const ( // InvalidRequestErrorCode is an error code for invalid requests. InvalidRequestErrorCode = command.Code(iota + command.LD) // AddContextsErrorCode is an error code for AddContexts command. AddContextsErrorCode // AddRemoteProviderErrorCode is an error code for AddRemoteProvider command. AddRemoteProviderErrorCode // RefreshRemoteProviderErrorCode is an error code for RefreshRemoteProvider command. RefreshRemoteProviderErrorCode // DeleteRemoteProviderErrorCode is an error code for DeleteRemoteProvider command. DeleteRemoteProviderErrorCode // GetAllRemoteProvidersErrorCode is an error code for GetAllRemoteProviders command. GetAllRemoteProvidersErrorCode // RefreshAllRemoteProvidersErrorCode is an error code for RefreshAllRemoteProviders command. RefreshAllRemoteProvidersErrorCode )
const ( // CommandName is a base command name for JSON-LD operations. CommandName = "ld" // AddContextsCommandMethod is a command method for adding contexts. AddContextsCommandMethod = "AddContexts" // AddRemoteProviderCommandMethod is a command method for adding new remote provider. AddRemoteProviderCommandMethod = "AddRemoteProvider" // RefreshRemoteProviderCommandMethod is a command method for refreshing contexts from the remote provider. RefreshRemoteProviderCommandMethod = "RefreshRemoteProvider" // DeleteRemoteProviderCommandMethod is a command method for deleting provider and contexts from that provider. DeleteRemoteProviderCommandMethod = "DeleteRemoteProvider" // GetAllRemoteProvidersCommandMethod is a command method for getting list of all remote providers. GetAllRemoteProvidersCommandMethod = "GetAllRemoteProviders" // RefreshAllRemoteProvidersCommandMethod is a command method for refreshing contexts from all remote providers. RefreshAllRemoteProvidersCommandMethod = "RefreshAllRemoteProviders" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddContextsRequest ¶
AddContextsRequest is a request model for adding JSON-LD contexts.
type AddRemoteProviderRequest ¶
type AddRemoteProviderRequest struct {
Endpoint string `json:"endpoint"`
}
AddRemoteProviderRequest is a request model for adding a new remote context provider.
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
Command contains command operations.
func (*Command) AddContexts ¶
AddContexts command adds JSON-LD contexts to the underlying storage.
func (*Command) AddRemoteProvider ¶
AddRemoteProvider command adds remote provider and JSON-LD contexts from that provider.
func (*Command) DeleteRemoteProvider ¶
DeleteRemoteProvider command deletes remote provider and contexts from that provider.
func (*Command) GetAllRemoteProviders ¶
GetAllRemoteProviders command gets all remote providers.
func (*Command) GetHandlers ¶
GetHandlers returns list of all commands supported by this controller command.
func (*Command) RefreshAllRemoteProviders ¶
RefreshAllRemoteProviders command updates contexts from all remote providers.
type GetAllRemoteProvidersResponse ¶
type GetAllRemoteProvidersResponse struct {
Providers []ld.RemoteProviderRecord `json:"providers"`
}
GetAllRemoteProvidersResponse is a response model for listing all remote providers.
type HTTPClient ¶
HTTPClient represents an HTTP client.
type Option ¶
type Option func(cmd *Command)
Option configures the JSON-LD command.
func WithHTTPClient ¶
func WithHTTPClient(client HTTPClient) Option
WithHTTPClient sets the custom HTTP client.
type ProviderID ¶
type ProviderID struct {
ID string `json:"id"`
}
ProviderID is a request/response model for operations that involve remote provider ID.