common.go 633 字节
Newer Older
H
HFO4 已提交
1 2
package response

3 4 5 6
import (
	"io"
	"time"
)
H
HFO4 已提交
7 8 9 10 11 12

// ContentResponse 获取文件内容类方法的通用返回值。
// 有些上传策略需要重定向,
// 有些直接写文件数据到浏览器
type ContentResponse struct {
	Redirect bool
13
	Content  RSCloser
H
HFO4 已提交
14
	URL      string
15
	MaxAge   int
H
HFO4 已提交
16
}
17

18
// RSCloser 存储策略适配器返回的文件流,有些策略需要带有Closer
19 20 21 22
type RSCloser interface {
	io.ReadSeeker
	io.Closer
}
23 24 25 26 27 28 29 30 31 32

// Object 列出文件、目录时返回的对象
type Object struct {
	Name         string
	RelativePath string
	Source       string
	Size         uint64
	IsDir        bool
	LastModify   time.Time
}