spec

package
v0.0.0-...-921d8b4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPServiceRoute

type HTTPServiceRoute struct {
	//The service endpoint
	Route string

	//The mothod of the service
	Method string

	//The label will be set into the plugin context to
	//let the plugin aware what kind of request is incoming for serving
	Label string
}

HTTPServiceRoute defines the http/rest service endpoint served by the plugin

type HTTPServices

type HTTPServices struct {
	//The http service provider
	//Support 'beego'
	Driver string

	//Routes should be enabled on the driver
	Routes []HTTPServiceRoute
}

HTTPServices defines the metadata of http service served by the plugin

type Plugin

type Plugin struct {
	//Name of the plugin, required
	Name string

	//SemVer 2 version, required
	Version string

	//A one line sentence about the function of the plugin, optional
	Description string

	//The source repository of the plugin code, optional
	Home string

	//The maintainer list with 'Maintainer <email>' format of the plugin
	Maintainers []string

	//The source for loading the plugin with specified mode
	Source *Source

	//The HTTP service should be served by the plugin
	HTTPServices *HTTPServices
}

Plugin is the corresponding structure of the 'plugin.json', which describe the basic metadata of the plugin

type PluginExecutor

type PluginExecutor func(ctx context.PluginContext) error

PluginExecutor is the executor of the plugin

type PluginItem

type PluginItem struct {
	//Plugin spec
	Spec *Plugin

	//Plugin executor
	Executor PluginExecutor
}

PluginItem is composite of plugin spec and executor

type Source

type Source struct {
	//The loading mode of the plugin
	//Support 'local_so', 'remote_git'
	Mode string

	//The path of the local so file or the URL of the remote git
	Path string
}

Source defines the loading mode of the plugin

Jump to

Keyboard shortcuts

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