model

package
v0.0.0-...-8375e82 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSG_SUCCESS        = "1000" //正常消息
	MSG_ERROR          = "1001" //异常消息
	MSG_IMG_SAVE_ERROR = "1002" //保存失败
	MSG_IMG_READ_ERROR = "1003" //读取失败
	MSG_IMG_LESS_THAN  = "1004" //超过限制大小,默认小于80M
	MSG_IMG_ISNUDE     = "1005" //图片涉黄
	MSG_NOT_SUPPORT    = "1006" //不支持文件
)

*

  • 消息常量

Variables

This section is empty.

Functions

This section is empty.

Types

type Blacklist

type Blacklist struct {
	Fid        string    //唯一ID
	Md5        string    //md5值
	Size       int       //大小
	VerifyDate time.Time //认证时间
}

*

  • 文件黑名单

func (*Blacklist) GetFid

func (this *Blacklist) GetFid() string

func (*Blacklist) GetMd5

func (this *Blacklist) GetMd5() string

func (*Blacklist) GetSize

func (this *Blacklist) GetSize() int

func (*Blacklist) GetVerifyDate

func (this *Blacklist) GetVerifyDate() time.Time

func (*Blacklist) SetFid

func (this *Blacklist) SetFid(fileId string)

fid

func (*Blacklist) SetMd5

func (this *Blacklist) SetMd5(md5 string)

md5

func (*Blacklist) SetSize

func (this *Blacklist) SetSize(size int)

size

func (*Blacklist) SetVerifyDate

func (this *Blacklist) SetVerifyDate(verifyDate time.Time)

verifyDate

type ImgMeta

type ImgMeta struct {
	Width  int //宽
	Height int //高
}

*

  • 图片文件元信息

func (*ImgMeta) GetHeight

func (this *ImgMeta) GetHeight() int

func (*ImgMeta) GetWidth

func (this *ImgMeta) GetWidth() int

func (*ImgMeta) SetHeight

func (this *ImgMeta) SetHeight(height int)

height

func (*ImgMeta) SetWidth

func (this *ImgMeta) SetWidth(width int)

width

type Info

type Info struct {
	Id          bson.ObjectId `bson:"_id"`
	Fid         string        //唯一ID
	Rdm         string        //随机数
	Nude        bool          //是否涉黄
	Online      bool          //是否上线 true 永久存储 false 定期清理
	FileType    int           //类型 0、图片文件 1、二进制文件
	FileSuffix  string        //上传文件的后缀
	ContentType string        //MIME
	UploadDate  time.Time     //上传时间
}

*

  • 文件信息

func NewInfo

func NewInfo() *Info

func NewInfoByRes

func NewInfoByRes(res *Res) *Info

func (*Info) GetContentType

func (this *Info) GetContentType() string

func (*Info) GetFid

func (this *Info) GetFid() string

func (*Info) GetFileSuffix

func (this *Info) GetFileSuffix() string

func (*Info) GetFileType

func (this *Info) GetFileType() int

func (*Info) GetId

func (this *Info) GetId() bson.ObjectId

func (*Info) GetIdToString

func (this *Info) GetIdToString() string

func (*Info) GetNude

func (this *Info) GetNude() bool

func (*Info) GetOnline

func (this *Info) GetOnline() bool

func (*Info) GetRdm

func (this *Info) GetRdm() string

func (*Info) GetUploadDate

func (this *Info) GetUploadDate() time.Time

func (*Info) SetContentType

func (this *Info) SetContentType(contentType string)

contentType

func (*Info) SetFid

func (this *Info) SetFid(fid string)

fid

func (*Info) SetFileSuffix

func (this *Info) SetFileSuffix(fileSuffix string)

fileSuffix

func (*Info) SetFileType

func (this *Info) SetFileType(fileType int)

fileType

func (*Info) SetId

func (this *Info) SetId(id bson.ObjectId)

id

func (*Info) SetNude

func (this *Info) SetNude(nude bool)

nude

func (*Info) SetOnline

func (this *Info) SetOnline(online bool)

online

func (*Info) SetRdm

func (this *Info) SetRdm(rdm string)

rdm

func (*Info) SetUploadDate

func (this *Info) SetUploadDate(uploadDate time.Time)

uploadDate

type Res

type Res struct {
	Id          bson.ObjectId `bson:"_id"`
	Fid         string        //唯一ID
	Md5         string        //md5值
	Size        int           //大小
	Refnum      int           //上传次数
	Nude        bool          //是否涉黄
	Online      bool          //是否上线 true 永久存储 false 定期清理
	FileType    int           //类型 0、图片文件 1、二进制文件
	FileSuffix  string        //上传文件的后缀
	ContentType string        //MIME
	UploadDate  time.Time     //上传时间
}

*

  • 文件资源

func NewRes

func NewRes(data []byte) *Res

func (*Res) GetContentType

func (this *Res) GetContentType() string

func (*Res) GetFid

func (this *Res) GetFid() string

func (*Res) GetFileSuffix

func (this *Res) GetFileSuffix() string

func (*Res) GetFileType

func (this *Res) GetFileType() int

func (*Res) GetId

func (this *Res) GetId() bson.ObjectId

func (*Res) GetIdToString

func (this *Res) GetIdToString() string

func (*Res) GetMd5

func (this *Res) GetMd5() string

func (*Res) GetNude

func (this *Res) GetNude() bool

func (*Res) GetOnline

func (this *Res) GetOnline() bool

func (*Res) GetRefnum

func (this *Res) GetRefnum() int

refnum

func (*Res) GetSize

func (this *Res) GetSize() int

func (*Res) GetUploadDate

func (this *Res) GetUploadDate() time.Time

func (*Res) SetContentType

func (this *Res) SetContentType(contentType string)

contentType

func (*Res) SetFid

func (this *Res) SetFid(fid string)

fid

func (*Res) SetFileSuffix

func (this *Res) SetFileSuffix(fileSuffix string)

fileSuffix

func (*Res) SetFileType

func (this *Res) SetFileType(fileType int)

fileType

func (*Res) SetId

func (this *Res) SetId(id string)

id

func (*Res) SetMd5

func (this *Res) SetMd5(md5 string)

md5

func (*Res) SetNude

func (this *Res) SetNude(nude bool)

nude

func (*Res) SetOnline

func (this *Res) SetOnline(online bool)

online

func (*Res) SetSize

func (this *Res) SetSize(size int)

size

func (*Res) SetUploadDate

func (this *Res) SetUploadDate(uploadDate time.Time)

uploadDate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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