Documentation ¶
Overview ¶
gmfs storage, use mongodb
Index ¶
- func ExistBlacklist(session *mgo.Session, fileMd5 string, fileSize int) (*model.Blacklist, error)
- func FindInfoById(session *mgo.Session, id string) (*model.Info, *mgo.GridFile, error)
- func ImageToPaletted(img image.Image) *image.Paletted
- func ProcessImage(img image.Image, width, hight uint) image.Image
- func ResizeGif(ctx *ink.Context, r io.Reader, rs bool, width, hight uint) *bytes.Buffer
- func ResizeImage(ctx *ink.Context, gf *mgo.GridFile, b bool, w, h uint) *bytes.Buffer
- func SaveFile(ctx *ink.Context, session *mgo.Session, data []byte, ...) (string, string, error)
- func SaveImage(ctx *ink.Context, session *mgo.Session, data []byte) (string, string, bool, error)
- func SearchExist(session *mgo.Session, fileMd5 string, fileSize int) (*model.Info, error)
- func UpdateInfoOnline(session *mgo.Session, id, rdm string) error
- type MgoStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveFile ¶
func SaveFile(ctx *ink.Context, session *mgo.Session, data []byte, fileSuffix, filetype string) (string, string, error)
*
- 保存文件
Types ¶
type MgoStorage ¶
type MgoStorage struct {
// mongo collection where the cache will be stored
Collection *mgo.Collection
}
MgoStorage objects store and retrieve data using Mongo.
func NewMgoStorage ¶
func NewMgoStorage(collection *mgo.Collection) *MgoStorage
New returns a new MgoStorage
func (*MgoStorage) Delete ¶
func (self *MgoStorage) Delete(key string)
func (*MgoStorage) Indexes ¶
func (self *MgoStorage) Indexes()
func (*MgoStorage) Set ¶
func (self *MgoStorage) Set(key string, content []byte)
Click to show internal directories.
Click to hide internal directories.