2020-11-25 19:44:45 +00:00
|
|
|
// Copyright (c) 2020, the Drone Plugins project authors.
|
2021-09-13 21:00:00 +00:00
|
|
|
// Copyright (c) 2021, Robert Kaussow <mail@thegeeklab.de>
|
|
|
|
|
2020-11-25 19:44:45 +00:00
|
|
|
// Use of this source code is governed by an Apache 2.0 license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
package plugin
|
|
|
|
|
|
|
|
import (
|
2023-08-15 22:15:24 +00:00
|
|
|
wp "github.com/thegeeklab/wp-plugin-go/plugin"
|
2020-11-25 19:44:45 +00:00
|
|
|
)
|
|
|
|
|
2023-08-15 22:15:24 +00:00
|
|
|
// Plugin implements provide the plugin implementation.
|
2020-11-25 19:44:45 +00:00
|
|
|
type Plugin struct {
|
2023-08-15 22:15:24 +00:00
|
|
|
*wp.Plugin
|
|
|
|
Settings *Settings
|
2020-11-25 19:44:45 +00:00
|
|
|
}
|
|
|
|
|
2023-08-15 22:15:24 +00:00
|
|
|
// Settings for the plugin.
|
|
|
|
type Settings struct {
|
|
|
|
Username string
|
|
|
|
Password string
|
|
|
|
UserID string
|
|
|
|
AccessToken string
|
|
|
|
Homeserver string
|
|
|
|
RoomID string
|
|
|
|
Template string
|
|
|
|
}
|
|
|
|
|
|
|
|
func New(options wp.Options, settings *Settings) *Plugin {
|
|
|
|
p := &Plugin{}
|
|
|
|
|
|
|
|
options.Execute = p.run
|
|
|
|
|
|
|
|
p.Plugin = wp.New(options)
|
|
|
|
p.Settings = settings
|
|
|
|
|
|
|
|
return p
|
2020-11-25 19:44:45 +00:00
|
|
|
}
|