api

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const InfoName = "info"

InfoName constant should not be used directly when implementing plugins. It's the registration name for the info plugin, used by the CLI and the cli-plugin-base library (RegisterPlugins function) to register the plugins.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorCode added in v0.19.0

type ErrorCode int
const (
	NoError ErrorCode = iota
	UnknownError
	BadInputParameterError
	MissingInputParameterError
	SourceConnectionError
)

type ErrorResult added in v0.19.0

type ErrorResult struct {
	ErrorMessage string
	ErrorCode    ErrorCode
}

ErrorResult represents an error returned by an API call.

func CreateBadInputParameterError added in v0.20.0

func CreateBadInputParameterError(parameter, value, explanation string) *ErrorResult

CreateBadInputParameterError is a helper method to create a consistent error result across plugins when an input parameter has an unexpected format.

func CreateMissingInputParameterError added in v0.20.0

func CreateMissingInputParameterError(parameter string) *ErrorResult

CreateMissingInputParameterError is a helper method to create a consistent error result across plugins when a mandatory parameter is missing.

func CreateSourceConnectionError added in v0.20.0

func CreateSourceConnectionError(url, message string) *ErrorResult

CreateSourceConnectionError is a helper method to create a consistent error result across plugins when there is a connection problem to the data source or identity store.

func ToErrorResult added in v0.20.0

func ToErrorResult(err error) *ErrorResult

ToErrorResult is a helper method to to create an ErrorResult from an error. If the error already is of type ErrorResult, the original is returned.

func (ErrorResult) Error added in v0.20.0

func (e ErrorResult) Error() string

type Info added in v0.12.0

type Info interface {
	PluginInfo() PluginInfo
}

Info interface needs to be implemented by all plugins to provide basic plugin information.

type InfoPlugin added in v0.12.0

type InfoPlugin struct {
	Impl Info
}

InfoPlugin is used on the server (CLI) and client (plugin) side to integrate with the plugin system. A plugin should not be using this directly, but instead depend on the cli-plugin-base library to register the plugins.

func (InfoPlugin) Client added in v0.12.0

func (InfoPlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*InfoPlugin) Server added in v0.12.0

func (p *InfoPlugin) Server(*plugin.MuxBroker) (interface{}, error)

type ParameterInfo added in v0.12.0

type ParameterInfo struct {
	Name        string
	Description string
	Mandatory   bool
}

ParameterInfo contains the information about a parameter. This is used to inform the CLI user what command-line parameters are expected explicitly for this target (plugin).

func (ParameterInfo) String added in v0.12.0

func (i ParameterInfo) String() string

type PluginInfo added in v0.12.0

type PluginInfo struct {
	Name        string
	Description string
	Version     Version
	Parameters  []ParameterInfo
}

PluginInfo represents the information about a plugin.

func (PluginInfo) String added in v0.12.0

func (i PluginInfo) String() string

type Version added in v0.12.0

type Version struct {
	MajorVersion int
	MinorVersion int
	PatchVersion int
}

Version contains semantic versioning information of the plugin

func (Version) String added in v0.12.0

func (i Version) String() string

Directories

Path Synopsis
Package data_source contains the API for the data source syncer.
Package data_source contains the API for the data source syncer.

Jump to

Keyboard shortcuts

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