2022-06-15 10:06:42 +00:00
|
|
|
package model
|
2022-06-06 13:48:53 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"net/http"
|
2022-06-13 07:39:47 +00:00
|
|
|
"time"
|
2022-06-06 13:48:53 +00:00
|
|
|
)
|
|
|
|
|
2022-08-11 12:32:17 +00:00
|
|
|
type ListArgs struct {
|
2023-01-16 12:02:30 +00:00
|
|
|
ReqPath string
|
2022-08-11 12:32:17 +00:00
|
|
|
}
|
|
|
|
|
2022-06-06 13:48:53 +00:00
|
|
|
type LinkArgs struct {
|
|
|
|
IP string
|
|
|
|
Header http.Header
|
2022-08-11 12:32:17 +00:00
|
|
|
Type string
|
2022-06-06 13:48:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Link struct {
|
2023-04-17 07:31:39 +00:00
|
|
|
URL string `json:"url"`
|
|
|
|
Header http.Header `json:"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
|
2023-04-27 07:39:32 +00:00
|
|
|
Handle func(w http.ResponseWriter, r *http.Request) error `json:"-"` // custom handler
|
2022-06-06 13:48:53 +00:00
|
|
|
}
|
2022-08-03 06:14:37 +00:00
|
|
|
|
|
|
|
type OtherArgs struct {
|
|
|
|
Obj Obj
|
|
|
|
Method string
|
|
|
|
Data interface{}
|
|
|
|
}
|
|
|
|
|
|
|
|
type FsOtherArgs struct {
|
|
|
|
Path string `json:"path" form:"path"`
|
|
|
|
Method string `json:"method" form:"method"`
|
|
|
|
Data interface{} `json:"data" form:"data"`
|
|
|
|
}
|