alist/internal/model/args.go

40 lines
1.0 KiB
Go
Raw Normal View History

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 {
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 {
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
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"`
}