Documentation ¶
Index ¶
- func ChunkUpload(prefer, dfsID, bucketType, filePath, fileName string) (bn, endpoint string, err error)
- func ChunkUploadGetStream(userID, prefer, cloud string, chunk utils.ChunksObj) (utils.ChunksObj, int, string, error)
- func ChunkUploadGetStreamCS(userID, prefer, cloud string, chunk utils.ChunksObj) (utils.ChunksObj, int, string, error)
- func ChunkUploadGetStreamCSByDfsID(userID, dfsID, prefer, cloud string, chunk utils.ChunksObj) (utils.ChunksObj, int, string, error)
- func ChunkUploadPostStream(userID, prefer, cloud string, chunk utils.ChunksObj, ...) (utils.ChunksObj, int, string, error)
- func ChunkUploadPostStreamCS(userID, prefer, cloud string, chunk utils.ChunksObj, ...) (utils.ChunksObj, int, string, error)
- func ChunkUploadPostStreamCSByDfsID(userID, dfsID, prefer, cloud string, chunk utils.ChunksObj, ...) (utils.ChunksObj, int, string, error)
- func GetFile(bucketName, dfsID string) ([]byte, string, string, int64, error)
- func GetTempDownURLFileName(bucketName, dfsID string, expires int64) (map[string]string, error)
- func PutByteFile(prefer, dfsID, bucketType string, chunk utils.ChunksObj, o map[string]string, ...) (utils.ChunksObj, error)
- func PutFile(prefer, dfsID, bucketType string, chunk utils.ChunksObj, ...) (utils.ChunksObj, error)
- type BucketInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunkUpload ¶
func ChunkUpload(prefer, dfsID, bucketType, filePath, fileName string) (bn, endpoint string, err error)
ChunkUpload 文件分块上传 need config: 需要config: "oss": { "chunkSize":5120000,
"cloud": "aliyun", "xxx": { "endpoint": "xxx", "accessKey": "xxx", "accessSecret": "xxx", "bucket": { "data": "xxx", "pub": "xxx" } }, "xxx": { "endpoint": "xxx", "accessKey": "xxx", "accessSecret": "xxx", "bucket": { "data": "xxx", "pub": "xxx" } } },
prefer 如果为空,则取Default dfsID 调用SetMultiPartDfsID或是SetDfsID方法生成 bucketType 如果不传,则表示是data
func ChunkUploadGetStream ¶
func ChunkUploadGetStream(userID, prefer, cloud string, chunk utils.ChunksObj) (utils.ChunksObj, int, string, error)
ChunkUploadGetStream chunk upload for get 400 NotExist client should call post to upload this part 200 OK client need to ignore this part 300 dfsID caller should do other thing, then client can get success upload infor 500 client need to upload whole file again
func ChunkUploadGetStreamCS ¶ added in v1.0.6
func ChunkUploadGetStreamCSByDfsID ¶ added in v1.0.7
func ChunkUploadPostStream ¶
func ChunkUploadPostStream(userID, prefer, cloud string, chunk utils.ChunksObj, fileChunk *multipart.FileHeader) (utils.ChunksObj, int, string, error)
ChunkUploadPostStream chunk upload for post 400 NotExist client should call post to upload this part 200 OK client need to ignore this part 300 dfsID caller should do other thing, then client can get success upload infor 500 client need to upload whole file again
func ChunkUploadPostStreamCS ¶ added in v1.0.6
func ChunkUploadPostStreamCSByDfsID ¶ added in v1.0.7
func GetTempDownURLFileName ¶
GetTempDownURLFileName get temp download url from aws s3
func PutByteFile ¶
func PutByteFile(prefer, dfsID, bucketType string, chunk utils.ChunksObj, o map[string]string, c []byte) (utils.ChunksObj, error)
PutByteFile need config: 需要config:
"oss": { "cloud": "aws", "default": { "endpoint": "xxx", "accessKey": "xxx", "accessSecret": "xxx", "bucket": { "data": "xxx", "pub": "xxx" } }, "xxx": { "endpoint": "xxx", "accessKey": "xxx", "accessSecret": "xxx", "bucket": { "data": "xxx", "pub": "xxx" } } },
func PutFile ¶
func PutFile(prefer, dfsID, bucketType string, chunk utils.ChunksObj, c *multipart.FileHeader) (utils.ChunksObj, error)
PutFile need config: 需要config:
"oss": { "cloud": "aws", "xxx": { "endpoint": "xxx", "accessKey": "xxx", "accessSecret": "xxx", "bucket": { "data": "xxx", "pub": "xxx" } }, "xxx": { "endpoint": "xxx", "accessKey": "xxx", "accessSecret": "xxx", "bucket": { "data": "xxx", "pub": "xxx" } } },