pass context to image uploaders

This commit is contained in:
bergquist
2017-09-15 16:11:02 +02:00
parent d0ab028cfc
commit c7698a09ed
5 changed files with 13 additions and 10 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ package imguploader
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"net"
@@ -33,7 +34,7 @@ var netClient = &http.Client{
Transport: netTransport,
}
func (u *WebdavUploader) Upload(pa string) (string, error) {
func (u *WebdavUploader) Upload(ctx context.Context, pa string) (string, error) {
url, _ := url.Parse(u.url)
filename := util.GetRandomString(20) + ".png"
url.Path = path.Join(url.Path, filename)