Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteFile(rail miso.Rail, fileId string) error
- func DownloadFile(rail miso.Rail, tmpToken string, writer io.Writer) error
- func DownloadFileDirect(rail miso.Rail, fileId string, writer io.Writer) error
- func GenTempFileKey(rail miso.Rail, fileId string, filename string) (string, error)
- func TriggerFileUnzip(rail miso.Rail, req UnzipFileReq) error
- func UploadFile(rail miso.Rail, filename string, dat io.Reader) (string, error)
- type DirectDownloadFileReq
- type FetchFileInfoReq
- type FstoreFile
- type UnzipFileReplyEvent
- type UnzipFileReq
- type ZipEntry
Constants ¶
View Source
const ( UnknownError = "UNKNOWN_ERROR" InvalidRequest = "INVALID_REQUEST" FileNotFound = "FILE_NOT_FOUND" FileDeleted = "FILE_DELETED" IllegalFormat = "ILLEGAL_FORMAT" InvalidAuthorization = "INVALID_AUTHORIZATION" )
Variables ¶
View Source
var ( ErrFileNotFound = errors.New("file not found") ErrFileDeleted = errors.New("file deleted") ErrIllegalFormat = errors.New("illegal format") ErrMapper = map[string]error{ FileNotFound: ErrFileNotFound, FileDeleted: ErrFileDeleted, IllegalFormat: ErrIllegalFormat, } )
Functions ¶
func DownloadFile ¶ added in v0.1.7
func DownloadFileDirect ¶ added in v0.1.11
func GenTempFileKey ¶ added in v0.1.7
func TriggerFileUnzip ¶ added in v0.1.7
func TriggerFileUnzip(rail miso.Rail, req UnzipFileReq) error
Types ¶
type DirectDownloadFileReq ¶ added in v0.1.11
type DirectDownloadFileReq struct {
FileId string
}
type FetchFileInfoReq ¶ added in v0.1.7
type FstoreFile ¶
type FstoreFile struct { FileId string `json:"fileId" desc:"file unique identifier"` Name string `json:"name" desc:"file name"` Status string `json:"status" desc:"status, 'NORMAL', 'LOG_DEL' (logically deleted), 'PHY_DEL' (physically deleted)"` Size int64 `json:"size" desc:"file size in bytes"` Md5 string `json:"md5" desc:"MD5 checksum"` UplTime miso.ETime `json:"uplTime" desc:"upload time"` LogDelTime *miso.ETime `json:"logDelTime" desc:"logically deleted at"` PhyDelTime *miso.ETime `json:"phyDelTime" desc:"physically deleted at"` }
func FetchFileInfo ¶ added in v0.1.7
func FetchFileInfo(rail miso.Rail, req FetchFileInfoReq) (FstoreFile, error)
type UnzipFileReplyEvent ¶ added in v0.1.7
type UnzipFileReq ¶ added in v0.1.7
type UnzipFileReq struct { // zip file's mini-fstore file_id. FileId string `valid:"notEmpty" desc:"file_id of zip file"` // rabbitmq exchange (both the exchange and queue must all use the same name, and are bound together using routing key '#'). ReplyToEventBus string `valid:"notEmpty" desc:"name of the rabbitmq exchange to reply to, routing_key is '#'"` // Extra information that will be passed back to the caller in reply event. Extra string `desc:"extra information that will be passed around for the caller"` }
Click to show internal directories.
Click to hide internal directories.