Documentation ¶
Index ¶
Constants ¶
View Source
const (
// HandShakePath is the path for handshaking.
HandShakePath = "/Plugin.Activate"
)
Variables ¶
View Source
var ErrNotFound = errors.New("plugin not found")
ErrNotFound represents that the plugin is not found.
View Source
var ErrNotImplemented = errors.New("plugin not implement")
ErrNotImplemented represents that the plugin not implement the given protocol.
Functions ¶
func SetPluginSockPaths ¶
func SetPluginSockPaths(paths []string)
SetPluginSockPaths sets the plugin sock paths.
func SetPluginSpecPaths ¶
func SetPluginSpecPaths(paths []string)
SetPluginSpecPaths sets the plugin spec paths.
Types ¶
type ErrPluginStatus ¶
ErrPluginStatus represents that the plugin status error.
func (*ErrPluginStatus) Error ¶
func (e *ErrPluginStatus) Error() string
Error returns the error message.
type HandShakeResp ¶
type HandShakeResp struct {
Implements []string `json:"Implements"`
}
HandShakeResp is a handshake response.
type Plugin ¶
type Plugin struct { sync.Mutex // Name is the plugin name. Name string `json:"Name"` // Addr is the plugin address. Addr string `json:"Addr"` // TLSConfig is the tls config. TLSConfig *TLSConfig `json:"TLSConfig"` // Implements is the plugin implement infos. Implements []string `json:"-"` // contains filtered or unexported fields }
Plugin includes the Name, Addr, TLSConfig.
type PluginClient ¶
type PluginClient struct {
// contains filtered or unexported fields
}
PluginClient is the plugin client.
func NewPluginClient ¶
func NewPluginClient(addr string, tlsconfig *TLSConfig) (*PluginClient, error)
NewPluginClient creates a PluginClient from the address and tls config.
func (*PluginClient) CallService ¶
func (cli *PluginClient) CallService(service string, in, out interface{}, retry bool) error
CallService calls the service provided by plugin server.
Click to show internal directories.
Click to hide internal directories.