comm

package
v0.0.0-...-e5063d6 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IMG_DIR 默认路径
	IMG_DIR string = "./data/files"
)

Variables

This section is empty.

Functions

func GetCurTime

func GetCurTime() string

GetCurTime 得到当前日期,映射到存储路径

func GetRet4Ckeditor

func GetRet4Ckeditor(data *RetData) []byte

GetRet4Ckeditor Ckeditor将结果转化为[]byte放回

func GetRet4Editormd

func GetRet4Editormd(data *RetData) []byte

GetRet4Editormd Editormd将json字符串转为[]byte

Types

type FileContent

type FileContent struct {
	Content []byte
	Size    int64
	Ext     string
}

FileContent 存储文件信息

type ImageHandle

type ImageHandle struct {
	MaxSize int64
	// contains filtered or unexported fields
}

func (*ImageHandle) GetImgDir

func (h *ImageHandle) GetImgDir() string

GetImgDir 文件存储基本目录

func (*ImageHandle) ImageUpload

func (h *ImageHandle) ImageUpload(rw http.ResponseWriter, req *http.Request)

ImageUpload 处理图片上传

func (*ImageHandle) ImageView

func (h *ImageHandle) ImageView(w http.ResponseWriter, r *http.Request)

ImageView 查看图片

func (*ImageHandle) ServeHTTP

func (h *ImageHandle) ServeHTTP(rw http.ResponseWriter, req *http.Request)

type ImageHandleInfo

type ImageHandleInfo struct {
	Flag     string
	Fromname string
	ToData   func(data *RetData) []byte
}

ImageHandleInfo 文本上传类型定义

type RetData

type RetData struct {
	Code     int64
	Msg      string
	Url      string
	FileName string
	Err      error
	Req      *http.Request
}

RetData 定义vo 运行结果存储该对象,在转换[]byte

Jump to

Keyboard shortcuts

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