0
0
mirror of https://github.com/thegeeklab/wp-gitea-release.git synced 2024-11-28 08:20:34 +00:00
wp-gitea-release/plugin/plugin.go

42 lines
646 B
Go

package plugin
import (
"net/url"
wp "github.com/thegeeklab/wp-plugin-go/plugin"
"github.com/urfave/cli/v2"
)
// Plugin implements provide the plugin.
type Plugin struct {
*wp.Plugin
Settings *Settings
}
// Settings for the Plugin.
type Settings struct {
APIKey string
FileExists string
Checksum cli.StringSlice
Draft bool
PreRelease bool
Title string
Note string
CommitRef string
Event string
baseURL *url.URL
files []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
}