0
0
mirror of https://github.com/thegeeklab/wp-s3-action.git synced 2024-11-25 10:20:39 +00:00
wp-s3-action/plugin/plugin.go

59 lines
1.2 KiB
Go
Raw Normal View History

package plugin
import (
wp "github.com/thegeeklab/wp-plugin-go/plugin"
"github.com/thegeeklab/wp-plugin-go/types"
)
// Plugin implements provide the plugin implementation.
type Plugin struct {
*wp.Plugin
Settings *Settings
}
// Settings for the Plugin.
type Settings struct {
Endpoint string
AccessKey string
SecretKey string
Bucket string
Region string
Source string
Target string
Delete bool
ACL types.StringMapFlag
CacheControl types.StringMapFlag
ContentType types.StringMapFlag
ContentEncoding types.StringMapFlag
Metadata types.DeepStringMapFlag
Redirects types.StringMapFlag
CloudFrontDistribution string
DryRun bool
PathStyle bool
Client AWS
Jobs []Job
MaxConcurrency int
}
type Job struct {
local string
remote string
action string
}
type Result struct {
j Job
err error
}
func New(options wp.Options, settings *Settings) *Plugin {
p := &Plugin{}
options.Execute = p.run
p.Plugin = wp.New(options)
p.Settings = settings
return p
}