feat: add expiration field for Link

This commit is contained in:
Noah Hsu
2022-06-13 15:39:47 +08:00
parent 3e8f36e9f3
commit e16ab876aa
4 changed files with 37 additions and 15 deletions

View File

@ -3,6 +3,7 @@ package driver
import (
"io"
"net/http"
"time"
)
type LinkArgs struct {
@ -11,9 +12,10 @@ type LinkArgs struct {
}
type Link struct {
URL string
Header http.Header
Data io.ReadCloser
Status int
FilePath string
URL string
Header http.Header // needed header
Data io.ReadCloser // return file reader directly
Status int // status maybe 200 or 206, etc
FilePath string // local file, return the filepath
Expiration *time.Duration // url expiration time
}