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-05-26 21:54:57 +08:00
|
|
|
URL string `json:"url"`
|
2023-05-27 19:36:14 +08:00
|
|
|
Header http.Header `json:"header"` // needed header (for url) or response header(for data or writer)
|
2023-05-26 21:54:57 +08:00
|
|
|
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
|
|
|
|
//Handle func(w http.ResponseWriter, r *http.Request) error `json:"-"` // custom handler
|
|
|
|
Writer WriterFunc `json:"-"` // custom writer
|
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"`
|
|
|
|
}
|
2023-05-26 21:54:57 +08:00
|
|
|
|
|
|
|
type WriterFunc func(w io.Writer) error
|