diff --git a/builder/step_.go b/builder/step_.go index 58f0ca05..a04433f8 100644 --- a/builder/step_.go +++ b/builder/step_.go @@ -152,8 +152,8 @@ func ExecutableStep(stepInfo step.Step) Step { case step.UnPublish: return StepUnPublish(s) - case step.UploadAttachment: - return StepUploadAttachment(s) + case step.UploadAttachments: + return StepUploadAttachments(s) case step.ViewFeed: return StepViewFeed(s) diff --git a/builder/step_UploadAttachment.go b/builder/step_UploadAttachments.go similarity index 93% rename from builder/step_UploadAttachment.go rename to builder/step_UploadAttachments.go index 5f310398..c1b13f60 100644 --- a/builder/step_UploadAttachment.go +++ b/builder/step_UploadAttachments.go @@ -10,8 +10,8 @@ import ( "github.com/rs/zerolog/log" ) -// StepUploadAttachment represents an action that can upload attachments. It can only be used on a StreamBuilder -type StepUploadAttachment struct { +// StepUploadAttachments represents an action that can upload attachments. It can only be used on a StreamBuilder +type StepUploadAttachments struct { Action string // Action to perform when uploading the attachment ("append" or "replace") Fieldname string // Name of the form field that contains the file data (Default: "file") AttachmentPath string // Path name to store the AttachmentID @@ -23,13 +23,13 @@ type StepUploadAttachment struct { JSONResult bool // If TRUE, return a JSON structure with result data. This forces Maximum=1 } -func (step StepUploadAttachment) Get(builder Builder, _ io.Writer) PipelineBehavior { +func (step StepUploadAttachments) Get(builder Builder, _ io.Writer) PipelineBehavior { return nil } -func (step StepUploadAttachment) Post(builder Builder, buffer io.Writer) PipelineBehavior { +func (step StepUploadAttachments) Post(builder Builder, buffer io.Writer) PipelineBehavior { - const location = "handler.StepUploadAttachment.Post" + const location = "handler.StepUploadAttachments.Post" log.Debug().Msg(location) diff --git a/model/step/step.go b/model/step/step.go index 4c0746c2..3a94e994 100644 --- a/model/step/step.go +++ b/model/step/step.go @@ -156,7 +156,7 @@ func New(stepInfo mapof.Any) (Step, error) { return NewUnPublish(stepInfo) case "upload-attachments": - return NewUploadAttachment(stepInfo) + return NewUploadAttachments(stepInfo) case "view-feed": return NewViewFeed(stepInfo) diff --git a/model/step/uploadAttachment.go b/model/step/uploadAttachments.go similarity index 80% rename from model/step/uploadAttachment.go rename to model/step/uploadAttachments.go index 370c59a9..0924a9f3 100644 --- a/model/step/uploadAttachment.go +++ b/model/step/uploadAttachments.go @@ -4,8 +4,8 @@ import ( "github.com/benpate/rosetta/mapof" ) -// UploadAttachment represents an action that can upload attachments. It can only be used on a StreamBuilder -type UploadAttachment struct { +// UploadAttachments represents an action that can upload attachments. It can only be used on a StreamBuilder +type UploadAttachments struct { Action string // Action to perform when uploading the attachment ("append" or "replace") Fieldname string // Name of the form field that contains the file data (Default: "file") AttachmentPath string // Path name to store the AttachmentID @@ -17,8 +17,8 @@ type UploadAttachment struct { JSONResult bool // If TRUE, return a JSON structure with result data. This forces Maximum=1 } -// NewUploadAttachment returns a fully parsed UploadAttachment object -func NewUploadAttachment(stepInfo mapof.Any) (UploadAttachment, error) { +// NewUploadAttachments returns a fully parsed UploadAttachments object +func NewUploadAttachments(stepInfo mapof.Any) (UploadAttachments, error) { // Default behavior is "append". Only other option is "replace" action := stepInfo.GetString("action") @@ -27,7 +27,7 @@ func NewUploadAttachment(stepInfo mapof.Any) (UploadAttachment, error) { action = "append" } - return UploadAttachment{ + return UploadAttachments{ Action: action, Fieldname: first(stepInfo.GetString("fieldname"), "form"), AttachmentPath: stepInfo.GetString("attachment-path"), @@ -41,4 +41,4 @@ func NewUploadAttachment(stepInfo mapof.Any) (UploadAttachment, error) { } // AmStep is here only to verify that this struct is a build pipeline step -func (step UploadAttachment) AmStep() {} +func (step UploadAttachments) AmStep() {}