2021-01-11 20:54:49 +00:00
|
|
|
package plugin
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/drone-plugins/drone-plugin-lib/drone"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Plugin implements drone.Plugin to provide the plugin implementation.
|
|
|
|
type Plugin struct {
|
2022-10-11 09:38:36 +00:00
|
|
|
settings *Settings
|
2021-01-11 20:54:49 +00:00
|
|
|
pipeline drone.Pipeline
|
|
|
|
network drone.Network
|
|
|
|
}
|
|
|
|
|
|
|
|
// New initializes a plugin from the given Settings, Pipeline, and Network.
|
|
|
|
func New(settings Settings, pipeline drone.Pipeline, network drone.Network) drone.Plugin {
|
|
|
|
return &Plugin{
|
2022-10-11 09:38:36 +00:00
|
|
|
settings: &settings,
|
2021-01-11 20:54:49 +00:00
|
|
|
pipeline: pipeline,
|
|
|
|
network: network,
|
|
|
|
}
|
|
|
|
}
|
2022-10-11 09:38:36 +00:00
|
|
|
|
|
|
|
// newSettingsOnly initializes a plugin from the given Settings only.
|
|
|
|
func newSettingsOnly(settings *Settings) drone.Plugin {
|
|
|
|
return &Plugin{
|
|
|
|
settings: settings,
|
|
|
|
}
|
|
|
|
}
|