Documentation
¶
Index ¶
- func NewContext(ctx context.Context) *protoV1.Context
- type ExecOptions
- type Plugin
- func (p *Plugin) Apply(ctx context.Context) error
- func (p *Plugin) Do(ctx context.Context) (bool, error)
- func (p *Plugin) ExecuteActions(req *protoV1.ExecuteActionsRequest) (*protoV1.ExecuteActionsResponse, error)
- func (p *Plugin) ExecuteFilters(req *protoV1.ExecuteFiltersRequest) (*protoV1.ExecuteFiltersResponse, error)
- func (p *Plugin) OnPrClosed(req *protoV1.OnPrClosedRequest) (*protoV1.OnPrClosedResponse, error)
- func (p *Plugin) OnPrCreated(req *protoV1.OnPrCreatedRequest) (*protoV1.OnPrCreatedResponse, error)
- func (p *Plugin) OnPrMerged(req *protoV1.OnPrMergedRequest) (*protoV1.OnPrMergedResponse, error)
- func (p *Plugin) Shutdown(req *protoV1.ShutdownRequest) (*protoV1.ShutdownResponse, error)
- func (p *Plugin) Start(opts StartOptions) error
- func (p *Plugin) Stop()
- func (p *Plugin) String() string
- type StartOptions
- type StdioHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExecOptions ¶
ExecOptions define how to start the plugin in a sub-process. Args contains all arguments to pass to the command. Executable is the executable to execute.
func GetPluginExec ¶
func GetPluginExec(path, javaExec, pythonExec string) ExecOptions
type Plugin ¶
type Plugin struct {
Name string
Provider plugin.Provider
// contains filtered or unexported fields
}
func (*Plugin) ExecuteActions ¶
func (p *Plugin) ExecuteActions(req *protoV1.ExecuteActionsRequest) (*protoV1.ExecuteActionsResponse, error)
func (*Plugin) ExecuteFilters ¶
func (p *Plugin) ExecuteFilters(req *protoV1.ExecuteFiltersRequest) (*protoV1.ExecuteFiltersResponse, error)
func (*Plugin) OnPrClosed ¶
func (p *Plugin) OnPrClosed(req *protoV1.OnPrClosedRequest) (*protoV1.OnPrClosedResponse, error)
func (*Plugin) OnPrCreated ¶
func (p *Plugin) OnPrCreated(req *protoV1.OnPrCreatedRequest) (*protoV1.OnPrCreatedResponse, error)
func (*Plugin) OnPrMerged ¶
func (p *Plugin) OnPrMerged(req *protoV1.OnPrMergedRequest) (*protoV1.OnPrMergedResponse, error)
func (*Plugin) Shutdown ¶ added in v0.29.0
func (p *Plugin) Shutdown(req *protoV1.ShutdownRequest) (*protoV1.ShutdownResponse, error)
Shutdown lets a plugin know that its process is about to be stopped. A plugin can clean up any resources before it is stopped.
func (*Plugin) Start ¶
func (p *Plugin) Start(opts StartOptions) error
type StartOptions ¶
type StartOptions struct {
Address string
Config map[string]string
Exec ExecOptions
OnDataStderr StdioHandler
OnDataStdout StdioHandler
}
StartOptions define options to connect to a plugin. Config contains configuration sent to the plugin right after the connection is established. If Address is empty, then Exec is used to start the plugin before connecting to it. If Address is not empty, then the code connects to that address directly. OnDataStderr and OnDataStdout capture the stderr and stdout streams of the plugin. Writes the output of the streams to the log if unset.
type StdioHandler ¶
StdioHandler describes a function that receives data sent by a plugin to stdout/stderr.
func NewStderrHandler ¶
func NewStderrHandler(level zapcore.Level, logger *zap.SugaredLogger) StdioHandler
NewStderrHandler returns an StdioHandler for the stream "stderr".
func NewStdioHandler ¶
func NewStdioHandler(defaultLevel zapcore.Level, logger *zap.SugaredLogger, stream string) StdioHandler
NewStdioHandler returns a StdioHandler that adds a message to the log when it receives data. `defaultLevel` denotes the level to log messages if a log message does not set its own level. `stream` is the identifier of the stream from which the data was read.
func NewStdoutHandler ¶
func NewStdoutHandler(level zapcore.Level, logger *zap.SugaredLogger) StdioHandler
NewStdoutHandler returns an StdioHandler for the stream "stdout".