2020-09-19 22:00:34 +00:00
|
|
|
package plugin
|
|
|
|
|
|
|
|
import (
|
2023-08-17 11:22:46 +00:00
|
|
|
"net/url"
|
|
|
|
|
|
|
|
wp "github.com/thegeeklab/wp-plugin-go/plugin"
|
2020-09-19 22:00:34 +00:00
|
|
|
)
|
|
|
|
|
2023-08-17 11:22:46 +00:00
|
|
|
// Plugin implements provide the plugin implementation.
|
2020-09-19 22:00:34 +00:00
|
|
|
type Plugin struct {
|
2023-08-17 11:22:46 +00:00
|
|
|
*wp.Plugin
|
|
|
|
Settings *Settings
|
|
|
|
}
|
|
|
|
|
|
|
|
// Settings for the Plugin.
|
|
|
|
type Settings struct {
|
|
|
|
BaseURL string
|
|
|
|
IssueNum int
|
|
|
|
Key string
|
|
|
|
Message string
|
|
|
|
Update bool
|
|
|
|
APIKey string
|
|
|
|
SkipMissing bool
|
|
|
|
IsFile bool
|
|
|
|
|
|
|
|
baseURL *url.URL
|
2020-09-19 22:00:34 +00:00
|
|
|
}
|
|
|
|
|
2023-08-17 11:22:46 +00:00
|
|
|
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-09-19 22:00:34 +00:00
|
|
|
}
|