feat: fs other api

This commit is contained in:
Noah Hsu
2022-08-03 14:14:37 +08:00
parent 2a68c3cc7b
commit 721f18a7f4
8 changed files with 86 additions and 6 deletions

33
internal/model/args.go Normal file
View File

@ -0,0 +1,33 @@
package model
import (
"io"
"net/http"
"time"
)
type LinkArgs struct {
IP string
Header http.Header
}
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
}
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"`
}