files

package
v0.0.0-...-cc72008 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateFile

func CreateFile(filename string, data []byte, contentType string) map[string]string

CreateFile 创建文件,返回文件地址与文件名

func DeleteFile

func DeleteFile(filename string) error

DeleteFile 删除文件

func ExpandFilesInObject

func ExpandFilesInObject(object interface{})

ExpandFilesInObject 展开文件对象 展开之后的文件对象如下

{
	"__type": "File",
	"url": "http://example.com/pic.jpg",
	"name": "pic.jpg",
}

func GetAdapterName

func GetAdapterName() string

GetAdapterName ...

func GetFileData

func GetFileData(filename string) ([]byte, error)

GetFileData 获取文件数据

Types

type FileStream

type FileStream interface {
	Seek(offset int64, whence int) (ret int64, err error)
	Read(b []byte) (n int, err error)
	Size() (bytes int64)
	Close() (err error)
}

FileStream 规定了文件流需要实现的接口

func GetFileStream

func GetFileStream(filename string) (FileStream, error)

GetFileStream 获取文件流

Directories

Path Synopsis
Package sinastorage ...
Package sinastorage ...

Jump to

Keyboard shortcuts

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