Browse Source

expand Asana attach method for aes256 decryption

master v0.1.6
frank 2 years ago
parent
commit
fea6efb20c
  1. 14
      module/attach/attachments.go

14
module/attach/attachments.go

@ -17,10 +17,6 @@ import (
"git.drinkme.beer/yinghe/asana/util"
)
const (
URI = "/api/1.0/tasks/%s/attachments"
)
type Request struct {
Body io.Reader
TaskID string
@ -48,8 +44,16 @@ func escapeQuotes(s string) string {
return quoteEscaper.Replace(s)
}
func (r Request) CreateInEncryption(download func(src, tmp string) error) (*Response, error) {
return r.create(download)
}
// Create - upload attachments
func (r Request) Create() (resp *Response, err error) {
return r.create(download)
}
func (r Request) create(f func(src, tmp string) error) (resp *Response, err error) {
var (
tempPath string
data struct {
@ -59,7 +63,7 @@ func (r Request) Create() (resp *Response, err error) {
tempPath = "./static/" + r.Name
// TODO
err = download(r.Path, tempPath)
err = f(r.Path, tempPath)
if nil != err {
return nil, err
}

Loading…
Cancel
Save