2022-06-15 18:06:42 +08:00
|
|
|
package model
|
2022-06-06 21:48:53 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"net/http"
|
2022-06-13 15:39:47 +08:00
|
|
|
"time"
|
2022-06-06 21:48:53 +08:00
|
|
|
)
|
|
|
|
|
2022-08-11 20:32:17 +08:00
|
|
|
type ListArgs struct {
|
2023-01-16 20:02:30 +08:00
|
|
|
ReqPath string
|
2022-08-11 20:32:17 +08:00
|
|
|
}
|
|
|
|
|
2022-06-06 21:48:53 +08:00
|
|
|
type LinkArgs struct {
|
2023-05-19 00:12:17 +08:00
|
|
|
IP string
|
|
|
|
Header http.Header
|
|
|
|
Type string
|
|
|
|
HttpReq *http.Request
|
2022-06-06 21:48:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type Link struct {
|
2023-04-17 15:31:39 +08: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 15:39:32 +08:00
|
|
|
Handle func(w http.ResponseWriter, r *http.Request) error `json:"-"` // custom handler
|
2022-06-06 21:48:53 +08:00
|
|
|
}
|
2022-08-03 14:14:37 +08: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"`
|
|
|
|
}
|