Documentation ¶
Index ¶
- Variables
- func CopyFile(fr FileReader, dstName string) error
- func ExtractGZipInnerFile(gzFile string, innerFile string, dst *os.File) error
- func ExtractTarInnerFile(tarFile string, innerFile string, dst *os.File) error
- func ExtractZipInnerFile(zipFile string, innerFile string, dst *os.File) error
- func GetFileNameUtf8(file *zip.File) string
- func GetHost(ctx *context.Context) string
- func GetInnerFilePath(pageFile string, innerFile string) (string, string)
- func If(condition bool, trueVal, falseVal interface{}) interface{}
- func IsGZ(name string) bool
- func RequestFile(self *PageController, pageFile string, info DocInfo)
- type AttachmentController
- type AuthorController
- type BaseController
- type CollectionController
- type ComFileReader
- type Compressor
- func (c *Compressor) CopyGZ(fr *gzip.Reader) error
- func (c *Compressor) ExtractFile(fr FileReader, name string) error
- func (c *Compressor) ExtractInnerFile(absPath string, innerFile string, dst *os.File) error
- func (c *Compressor) GetFileList(extract bool) (FileList, error)
- func (c *Compressor) GetGZipFileList(gzFile string, extract bool) (FileList, error)
- func (c *Compressor) GetName(pageFile string, ext string, filename string) string
- func (c *Compressor) GetTarFileList(tarFile string, extract bool) (FileList, error)
- func (c *Compressor) GetZipFileList(zipFile string, extract bool) (FileList, error)
- func (c *Compressor) InitCompress(spaceId string, extract bool) error
- type DataController
- type DocInfo
- type DocumentController
- func (this *DocumentController) Add()
- func (this *DocumentController) Delete()
- func (this *DocumentController) History()
- func (this *DocumentController) Index()
- func (this *DocumentController) Move()
- func (this *DocumentController) Save()
- func (this *DocumentController) UpdateFile()
- func (this *DocumentController) Upload()
- type FileList
- type FileReader
- type FollowController
- type GzFileReader
- type ImageController
- type JsonResponse
- type MainController
- type PageController
- type SpaceController
- func (this *SpaceController) AddMember()
- func (this *SpaceController) Collection()
- func (this *SpaceController) Document()
- func (this *SpaceController) Index()
- func (this *SpaceController) List()
- func (this *SpaceController) Member()
- func (this *SpaceController) ModifyMember()
- func (this *SpaceController) RemoveMember()
- func (this *SpaceController) Search()
- type TemplateController
- func (this *TemplateController) DebugLog(message string)
- func (this *TemplateController) ErrorLog(message string)
- func (this *TemplateController) GetClientIp() string
- func (this *TemplateController) GetDocumentPrivilege(space map[string]string) (isVisit, isEditor, isManager bool)
- func (this *TemplateController) GetLogInfoByCtx() map[string]interface{}
- func (this *TemplateController) GetRangeInt(key string, def int, min int, max int) (n int, err error)
- func (this *TemplateController) InfoLog(message string)
- func (this *TemplateController) IsGet() bool
- func (this *TemplateController) IsPost() bool
- func (this *TemplateController) IsRoot() bool
- func (this *TemplateController) JsonError(message interface{}, data ...interface{})
- func (this *TemplateController) JsonSuccess(message interface{}, data ...interface{})
- func (this *TemplateController) Prepare()
- func (this *TemplateController) RecordLog(message string, level int)
- func (this *TemplateController) SetPaginator(per int, nums int64) *utils.Paginator
- func (this *TemplateController) ViewError(content string, redirect ...string)
- func (this *TemplateController) ViewLayout(viewName, layout string)
- func (this *TemplateController) WarningLog(message string)
- type UploadJsonResponse
- type UploadResponse
- type UserController
Constants ¶
This section is empty.
Variables ¶
var FILETYPES = utils.FILETYPES
Functions ¶
func CopyFile ¶
func CopyFile(fr FileReader, dstName string) error
func ExtractGZipInnerFile ¶
GZIP解压单个文件
func ExtractTarInnerFile ¶
TAR解压单个文件
func ExtractZipInnerFile ¶
ZIP解压单个文件
func GetFileNameUtf8 ¶
=========================================华丽丽分界线====================================================== 解决文件名乱码问题,如果标示位是0,则是默认的本地编码,默认为gbk
func GetInnerFilePath ¶
================================================单文件提取=============================================== tar.gz格式内部有些文件夹可能带有./前缀
Types ¶
type AttachmentController ¶
type AttachmentController struct {
BaseController
}
func (*AttachmentController) Delete ¶
func (this *AttachmentController) Delete()
func (*AttachmentController) Download ¶
func (this *AttachmentController) Download()
func (*AttachmentController) Image ¶
func (this *AttachmentController) Image()
func (*AttachmentController) Page ¶
func (this *AttachmentController) Page()
func (*AttachmentController) Upload ¶
func (this *AttachmentController) Upload()
type AuthorController ¶
type AuthorController struct {
BaseController
}
type BaseController ¶
type BaseController struct {
TemplateController
}
type CollectionController ¶
type CollectionController struct {
BaseController
}
func (*CollectionController) Add ¶
func (this *CollectionController) Add()
func (*CollectionController) Cancel ¶
func (this *CollectionController) Cancel()
type ComFileReader ¶
type ComFileReader struct {
// contains filtered or unexported fields
}
func (*ComFileReader) IsDir ¶
func (c *ComFileReader) IsDir() bool
func (*ComFileReader) Reader ¶
func (c *ComFileReader) Reader() *tar.Reader
type Compressor ¶
type Compressor struct {
// contains filtered or unexported fields
}
func ComCompress ¶
func ComCompress(self beego.Controller, extract bool) (*Compressor, error)
DataController PageController 的共同祖先类 beego.Controller
func CreateCompressor ¶
func CreateCompressor(pageFile string) *Compressor
func (*Compressor) ExtractFile ¶
func (c *Compressor) ExtractFile(fr FileReader, name string) error
func (*Compressor) ExtractInnerFile ¶
func (*Compressor) GetFileList ¶
func (c *Compressor) GetFileList(extract bool) (FileList, error)
==========================================解压相关=========================================================
func (*Compressor) GetGZipFileList ¶
func (c *Compressor) GetGZipFileList(gzFile string, extract bool) (FileList, error)
tar.gz,仅获取文件列表
func (*Compressor) GetName ¶
func (c *Compressor) GetName(pageFile string, ext string, filename string) string
func (*Compressor) GetTarFileList ¶
func (c *Compressor) GetTarFileList(tarFile string, extract bool) (FileList, error)
tar,仅获取文件列表
func (*Compressor) GetZipFileList ¶
func (c *Compressor) GetZipFileList(zipFile string, extract bool) (FileList, error)
zip文件,仅获取文件列表
func (*Compressor) InitCompress ¶
func (c *Compressor) InitCompress(spaceId string, extract bool) error
用于线上解压
type DataController ¶
type DataController struct {
beego.Controller
}
func (*DataController) GetServeUrl ¶
func (this *DataController) GetServeUrl()
为解决文本复制问题,在请求压缩包时提前请求一次服务地址,以pre区分 获取在线解压后的服务地址
func (*DataController) ViewPkg ¶
func (this *DataController) ViewPkg()
提供压缩包文件预览功能 DataController PageController
func (*DataController) ViewPkgFile ¶
func (this *DataController) ViewPkgFile()
提供压缩包内部文件内容预览功能 默认解压到同目录下_temp文件夹下,若该压缩包已被解压,则请求解压后的文件
type DocInfo ¶
type DocInfo struct {
// contains filtered or unexported fields
}
func GetDirInfo ¶
func GetDirInfo(this *BaseController) (DocInfo, error)
type DocumentController ¶
type DocumentController struct {
BaseController
}
func (*DocumentController) UpdateFile ¶
func (this *DocumentController) UpdateFile()
func (*DocumentController) Upload ¶
func (this *DocumentController) Upload()
================================================================================= 注·九成以上代码来自于Save()方法 upload file
type FileList ¶
func GetLocalFileList ¶
type FileReader ¶
实现多态
type FollowController ¶
type FollowController struct {
BaseController
}
func (*FollowController) Add ¶
func (this *FollowController) Add()
func (*FollowController) Cancel ¶
func (this *FollowController) Cancel()
type GzFileReader ¶
type GzFileReader struct {
// contains filtered or unexported fields
}
func (*GzFileReader) IsDir ¶
func (g *GzFileReader) IsDir() bool
func (*GzFileReader) Reader ¶
func (g *GzFileReader) Reader() *tar.Reader
type ImageController ¶
type ImageController struct {
BaseController
}
func (*ImageController) Upload ¶
func (this *ImageController) Upload()
type JsonResponse ¶
type MainController ¶
type MainController struct {
BaseController
}
func (*MainController) About ¶
func (this *MainController) About()
func (*MainController) Default ¶
func (this *MainController) Default()
func (*MainController) Index ¶
func (this *MainController) Index()
type PageController ¶
type PageController struct {
BaseController
}
func (*PageController) View ¶
func (this *PageController) View()
==================================================== 业务代码开始 =================================================== document page view
func (*PageController) ViewCom ¶
func (this *PageController) ViewCom()
=====================================================通用View============================================================= document page view common, 因去掉了繁琐的验证,可能被用于非法访问
type SpaceController ¶
type SpaceController struct {
BaseController
}
func (*SpaceController) AddMember ¶
func (this *SpaceController) AddMember()
func (*SpaceController) Collection ¶
func (this *SpaceController) Collection()
func (*SpaceController) Document ¶
func (this *SpaceController) Document()
func (*SpaceController) Index ¶
func (this *SpaceController) Index()
func (*SpaceController) List ¶
func (this *SpaceController) List()
func (*SpaceController) Member ¶
func (this *SpaceController) Member()
func (*SpaceController) ModifyMember ¶
func (this *SpaceController) ModifyMember()
func (*SpaceController) RemoveMember ¶
func (this *SpaceController) RemoveMember()
func (*SpaceController) Search ¶
func (this *SpaceController) Search()
type TemplateController ¶
type TemplateController struct { beego.Controller UserId string User map[string]string // contains filtered or unexported fields }
func (*TemplateController) DebugLog ¶
func (this *TemplateController) DebugLog(message string)
func (*TemplateController) ErrorLog ¶
func (this *TemplateController) ErrorLog(message string)
func (*TemplateController) GetClientIp ¶
func (this *TemplateController) GetClientIp() string
get client ip
func (*TemplateController) GetDocumentPrivilege ¶
func (this *TemplateController) GetDocumentPrivilege(space map[string]string) (isVisit, isEditor, isManager bool)
func (*TemplateController) GetLogInfoByCtx ¶
func (this *TemplateController) GetLogInfoByCtx() map[string]interface{}
func (*TemplateController) GetRangeInt ¶
func (*TemplateController) InfoLog ¶
func (this *TemplateController) InfoLog(message string)
func (*TemplateController) JsonError ¶
func (this *TemplateController) JsonError(message interface{}, data ...interface{})
return json error
func (*TemplateController) JsonSuccess ¶
func (this *TemplateController) JsonSuccess(message interface{}, data ...interface{})
return json success
func (*TemplateController) RecordLog ¶
func (this *TemplateController) RecordLog(message string, level int)
insert action log
func (*TemplateController) SetPaginator ¶
func (this *TemplateController) SetPaginator(per int, nums int64) *utils.Paginator
paginator
func (*TemplateController) ViewError ¶
func (this *TemplateController) ViewError(content string, redirect ...string)
view layout
func (*TemplateController) ViewLayout ¶
func (this *TemplateController) ViewLayout(viewName, layout string)
view layout
func (*TemplateController) WarningLog ¶
func (this *TemplateController) WarningLog(message string)
type UploadJsonResponse ¶
type UploadResponse ¶
type UserController ¶
type UserController struct {
BaseController
}
func (*UserController) Follow ¶
func (this *UserController) Follow()
func (*UserController) FollowPage ¶
func (this *UserController) FollowPage()
func (*UserController) FollowUser ¶
func (this *UserController) FollowUser()
func (*UserController) Index ¶
func (this *UserController) Index()
func (*UserController) Info ¶
func (this *UserController) Info()
func (*UserController) List ¶
func (this *UserController) List()