s3server

package
v0.0.0-...-6391c25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKey

func AddKey(username, pubKey string) (uint32, error)

func DownBlock

func DownBlock(userName, bucketName, fileName string, blockNum int) ([]byte, error)

func ReadToBoundary

func ReadToBoundary(boundary []byte, stream io.ReadCloser, target io.WriteCloser) ([]byte, bool, error)

/ 从流中一直读到文件的末位 / @return []byte 没有写到文件且又属于下一个文件的数据 / @return bool 是否已经读到流的末位了 / @return error 是否发生错误

Types

type FileHeader

type FileHeader struct {
	ContentDisposition string
	Name               string
	FileName           string ///< 文件名
	ContentType        string
	ContentLength      int64
}

/ 解析多个文件上传中,每个具体的文件的信息

func ParseFileHeader

func ParseFileHeader(h []byte) (FileHeader, bool)

/ 解析描述文件信息的头部 / @return FileHeader 文件名等信息的结构体 / @return bool 解析成功还是失败

func ParseFromHead

func ParseFromHead(read_data []byte, read_total int, boundary []byte, stream io.ReadCloser) (FileHeader, []byte, error)

/ 解析表单的头部 / @param read_data 已经从流中读到的数据 / @param read_total 已经从流中读到的数据长度 / @param boundary 表单的分割字符串 / @param stream 输入流 / @return FileHeader 文件名等信息头 / []byte 已经从流中读到的部分 / error 是否发生错误

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL