Skip to content

Commit d89260b

Browse files
committed
revert function removal
1 parent 4b5cdd4 commit d89260b

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

options.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,3 +478,30 @@ func WithMaxFileSize(i int64) Option {
478478
return nil
479479
})
480480
}
481+
482+
// WithValidationFunc allows you to set a function that can be used to perform validations
483+
func WithValidationFunc(validationFunc ValidationFunc) Option {
484+
return OptionFunc(func(r *Requester) error {
485+
r.validationFunc = validationFunc
486+
487+
return nil
488+
})
489+
}
490+
491+
// WithNameFuncGenerator allows you configure how you'd like to rename your uploaded files
492+
func WithNameFuncGenerator(nameFunc NameGeneratorFunc) Option {
493+
return OptionFunc(func(r *Requester) error {
494+
r.fileNameFuncGenerator = nameFunc
495+
496+
return nil
497+
})
498+
}
499+
500+
// WithFileErrorResponseHandler allows you to configure how you'd like to handle errors when a file upload fails either to your own server or the destination server or both
501+
func WithFileErrorResponseHandler(errHandler ErrResponseHandler) Option {
502+
return OptionFunc(func(r *Requester) error {
503+
r.fileUploaderrorResponseHandler = errHandler
504+
505+
return nil
506+
})
507+
}

0 commit comments

Comments
 (0)