Documentation
¶
Index ¶
- func CopyFile(src string, dest string) (bool, error)
- func CreateDir(src string) error
- func CutFile(src string, newSrc string) error
- func DeleteFile(src string) error
- func GetFileInfo(src string) (os.FileInfo, error)
- func GetFileList(src string, filter string, isSrc bool) ([]string, error)
- func GetFileListCount(src string) (int, error)
- func GetFileNames(src string) (map[string]string, error)
- func GetFileSha1(src string) (string, error)
- func GetFileSize(src string) int64
- func GetPathSep() string
- func GetTimeDirSrc(src string, appendFileType string) (string, error)
- func GetURLNameType(sendURL string) map[string]string
- func IPAddrsGetExternal() string
- func IPAddrsGetInternal() string
- func IsExist(src string) bool
- func IsFile(src string) bool
- func IsFolder(src string) bool
- func LoadConfigFile(configSrc string) (map[string]interface{}, error)
- func LoadFile(src string) ([]byte, error)
- func SaveConfigFile(configSrc string, configData interface{}) error
- func SessionGet(w http.ResponseWriter, r *http.Request, sessionMark string) (map[interface{}]interface{}, bool)
- func SessionSet(w http.ResponseWriter, r *http.Request, sessionMark string, ...) bool
- func SimpleHttpGet(sendURL string, params map[string][]string) ([]byte, error)
- func SimpleHttpPost(sendURL string, params map[string][]string) ([]byte, error)
- func WriteFile(src string, content []byte) error
- func WriteFileAppend(src string, content []byte, isForward bool) error
- type Coll
- func (this *Coll) AutoTask()
- func (this *Coll) ChangeStatus(name string, b bool) bool
- func (this *Coll) CheckCollExisit(name string) bool
- func (this *Coll) ClearColl(name string) bool
- func (this *Coll) ClearLog(name string) bool
- func (this *Coll) CollCloseDB(thisChildren *CollChildren, collOperate *CollOperate)
- func (this *Coll) CollConnectDB(thisChildren *CollChildren, collOperate *CollOperate) bool
- func (this *Coll) CollDebug()
- func (this *Coll) CollEnd(thisChildren *CollChildren, collOperate *CollOperate)
- func (this *Coll) CollFeig()
- func (this *Coll) CollJiandan()
- func (this *Coll) CollJiandanIndex()
- func (this *Coll) CollLocal()
- func (this *Coll) CollLocalAutoSave(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string, ...)
- func (this *Coll) CollLocalDownloadMovie(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string)
- func (this *Coll) CollLocalEnd(thisChildren *CollChildren, collOperate *CollOperate, name string, ...)
- func (this *Coll) CollLocalManhua(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string)
- func (this *Coll) CollLocalParentFiles(thisChildren *CollChildren, collOperate *CollOperate, localName string, ...) bool
- func (this *Coll) CollLocalSaveImgsHtml(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string)
- func (this *Coll) CollLocalStart(collOperate *CollOperate, collLocalDir string, name string, fileFilter string) (string, []string)
- func (this *Coll) CollLocalTxt(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string)
- func (this *Coll) CollMeizitu()
- func (this *Coll) CollStart(thisChildren *CollChildren, collOperate *CollOperate) bool
- func (this *Coll) CollXiuhaotu()
- func (this *Coll) CollXiuren()
- func (this *Coll) CreateCollListChildren(name string) CollChildren
- func (this *Coll) DebugErrorHTMLDoc(name string, doc *goquery.Document)
- func (this *Coll) DebugErrorHTMLNode(name string, html *goquery.Selection)
- func (this *Coll) DebugErrorHTMLStr(name string, html string)
- func (this *Coll) GetCollChildren(name string) *CollChildren
- func (this *Coll) GetStatus() (map[string]interface{}, bool)
- func (this *Coll) Run(name string)
- func (this *Coll) View(collName string, id int64) string
- func (this *Coll) ViewList(collName string, parent int64, star int, searchTitle string, page int, max int, ...) ([]map[string]string, bool)
- type CollChildren
- type CollFields
- type CollList
- type CollOperate
- func (this *CollOperate) AutoCollFile(url string, name string, parent string, parentID int64) int64
- func (this *CollOperate) AutoCollParent(parentTitle string, parentURL string) (int64, string)
- func (this *CollOperate) AutoCollParentFiles(parentTitle string, parentURL string, urls []string) int64
- func (this *CollOperate) CheckDataSha1(sha1 string) bool
- func (this *CollOperate) CheckDataURL(url string) bool
- func (this *CollOperate) ClearColl() bool
- func (this *CollOperate) ClearLog()
- func (this *CollOperate) CreateNewData(parent int64, sha1 string, src string, url string, name string, ...) int64
- func (this *CollOperate) DeleteData(id int64) bool
- func (this *CollOperate) DeleteFile(src string) bool
- func (this *CollOperate) GetCacheFIleInfo(url string) (map[string]string, bool)
- func (this *CollOperate) GetFileSha1(src string) string
- func (this *CollOperate) GetLog(name string) string
- func (this *CollOperate) GetNowTimeUnix() int64
- func (this *CollOperate) GetStrSha1(str string) string
- func (this *CollOperate) NewLog(msg string, err error)
- func (this *CollOperate) SaveCacheToFile(parentName string, cacheFileInfo map[string]string) string
- func (this *CollOperate) UpdateData(id int64, parent int64, star int, name string) bool
- func (this *CollOperate) ViewDataList(parent int64, star int, searchTitle string, page int, max int, sort int, ...) ([]map[string]string, bool)
- func (this *CollOperate) ViewDataSrc(id int64) string
- type Controller
- type Database
- func (this *Database) Close() error
- func (this *Database) Connect(dbType string, dbDNS string) error
- func (this *Database) Delete(table string, id int64) (int64, error)
- func (this *Database) GetField(table string, fields []string, field string, value string) (*sql.Row, error)
- func (this *Database) GetFieldsToStr(fields []string) string
- func (this *Database) GetID(table string, fields []string, id int) (*sql.Row, error)
- func (this *Database) GetList(table string, fields []string, page int, max int, sort int, desc bool) (map[int]map[string]interface{}, error)
- func (this *Database) GetPageSortStr(page int, max int, sort string, desc bool) string
- func (this *Database) GetResultToList(fields []string, result *sql.Rows) (map[int]map[string]interface{}, error)
- func (this *Database) Insert(table string, fields []string, values []string)
- func (this *Database) Update(table string, setField string, setValue string, id int) (int64, error)
- type Handle
- func (this *Handle) CheckLogin(w http.ResponseWriter, r *http.Request) bool
- func (this *Handle) CheckURLPost(r *http.Request) bool
- func (this *Handle) GetTempSrc(name string) string
- func (this *Handle) Init(db *Database)
- func (this *Handle) PostText(w http.ResponseWriter, r *http.Request, content string)
- func (this *Handle) ShowTemplate(w http.ResponseWriter, r *http.Request, templateFileName string, ...)
- func (this *Handle) ToURL(w http.ResponseWriter, r *http.Request, urlName string)
- func (this *Handle) UpdateLanguage()
- type Language
- type Log
- type MatchString
- func (this *MatchString) CheckEmail(str string) bool
- func (this *MatchString) CheckPassword(str string) bool
- func (this *MatchString) CheckUsername(str string) bool
- func (this *MatchString) GetRandStr(n int) string
- func (this *MatchString) GetSha1(content string) string
- func (this *MatchString) SubStr(str string, start int, length int) string
- type Router
- type User
- func (this *User) ChangeLoginSession(w http.ResponseWriter, r *http.Request, b bool) bool
- func (this *User) CheckLogin(w http.ResponseWriter, r *http.Request) bool
- func (this *User) CreateNewUser(username string, passwd string) int64
- func (this *User) DeleteUser(id int64) bool
- func (this *User) GetLoginSession(w http.ResponseWriter, r *http.Request) bool
- func (this *User) GetNowTimeUnix() int64
- func (this *User) GetPasswdSha1(passwd string) string
- func (this *User) GetUnixTime() int64
- func (this *User) Init(db *Database, timeout int64)
- func (this *User) LoginIn(w http.ResponseWriter, r *http.Request, username string, passwd string) bool
- func (this *User) Logout(w http.ResponseWriter, r *http.Request) bool
- func (this *User) SearchUsername(username string) int64
- func (this *User) UpdateIP()
- func (this *User) UpdateLoginInfo(id int64) bool
- func (this *User) UpdateUser(id int, username string, passwd string, isDisabled bool) bool
- func (this *User) ViewUser(id int) (UserFieldsStruct, bool)
- func (this *User) ViewUserList(searchUser string, page int, max int, sort int, desc bool) (map[int]map[string]interface{}, bool)
- type UserFieldsStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFileList ¶
Gets a list of files under the folder src string filter string eg : gif|jpg isSrc bool
func GetFileListCount ¶
Gets the number of files in the folder
func GetFileNames ¶
Gets the file name and type
func GetTimeDirSrc ¶
Gets the directory path for the time build eg : Return and create the path ,"[src]/201611/" eg : Return and create the path ,"[src]/201611/2016110102-03[appendFileType]"
func GetURLNameType ¶
Get the file name and type by URL
func LoadConfigFile ¶
Read the configuration file
func SaveConfigFile ¶
Write the configuration file
func SessionGet ¶
func SessionGet(w http.ResponseWriter, r *http.Request, sessionMark string) (map[interface{}]interface{}, bool)
Get the session data
func SessionSet ¶
func SessionSet(w http.ResponseWriter, r *http.Request, sessionMark string, data map[interface{}]interface{}) bool
Write session data
func SimpleHttpGet ¶
Gets the URL data get mode
func SimpleHttpPost ¶
Gets the URL data post mode
Types ¶
type Coll ¶
type Coll struct {
// contains filtered or unexported fields
}
coll struct
func (*Coll) ChangeStatus ¶
Change the collector operating status
func (*Coll) CheckCollExisit ¶
Check that the Collector is present
func (*Coll) CollCloseDB ¶
func (this *Coll) CollCloseDB(thisChildren *CollChildren, collOperate *CollOperate)
coll close database
func (*Coll) CollConnectDB ¶
func (this *Coll) CollConnectDB(thisChildren *CollChildren, collOperate *CollOperate) bool
coll connect db
func (*Coll) CollEnd ¶
func (this *Coll) CollEnd(thisChildren *CollChildren, collOperate *CollOperate)
coll end
func (*Coll) CollLocalAutoSave ¶
func (this *Coll) CollLocalAutoSave(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string, localName string, filter string, fileMinSize int64, parentFolderName string)
local保存网页数据采集器
func (*Coll) CollLocalDownloadMovie ¶
func (this *Coll) CollLocalDownloadMovie(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string)
local下载视频数据采集器
func (*Coll) CollLocalEnd ¶
func (this *Coll) CollLocalEnd(thisChildren *CollChildren, collOperate *CollOperate, name string, parentSrc string)
local专用通用清理模块 删除所有文件
func (*Coll) CollLocalManhua ¶
func (this *Coll) CollLocalManhua(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string)
local漫画数据采集器
func (*Coll) CollLocalParentFiles ¶
func (this *Coll) CollLocalParentFiles(thisChildren *CollChildren, collOperate *CollOperate, localName string, parentTitle string, parentSrc string, parentType string, fileSrcList []string) bool
local专用通用采集模块 thisChildren *CollChildren collOperate *CollOperate localName string 子采集器名称 parentTitle string 上级目录名称 parentSrc string 上级目录路径 parentType string 上级目录类型,区分用途 fileSrcList []string 子文件路径列表
func (*Coll) CollLocalSaveImgsHtml ¶
func (this *Coll) CollLocalSaveImgsHtml(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string)
local保存网页数据采集器
func (*Coll) CollLocalStart ¶
func (this *Coll) CollLocalStart(collOperate *CollOperate, collLocalDir string, name string, fileFilter string) (string, []string)
local专用通用启动模块 在内部采集启动前,务必运行该模块 collOperate *CollOperate collLocalDir string local总采集器路径 name string 子采集器名称 fileFilter string 可选,文件列表过滤文件,不支持二级子目录下文件过滤,但会返回相关目录名称,eg : jpg|gif|txt return string - 该采集项目存储目录路径 return []string - 该目录下文件列表
func (*Coll) CollLocalTxt ¶
func (this *Coll) CollLocalTxt(thisChildren *CollChildren, collOperate *CollOperate, collLocalDir string)
local文本数据采集器
func (*Coll) CollStart ¶
func (this *Coll) CollStart(thisChildren *CollChildren, collOperate *CollOperate) bool
coll start
func (*Coll) CreateCollListChildren ¶
func (this *Coll) CreateCollListChildren(name string) CollChildren
Create new CollListChildren
func (*Coll) DebugErrorHTMLDoc ¶
Sending an HTML to the error file was originally text for debugging.
func (*Coll) DebugErrorHTMLNode ¶
Sending an HTML to the error file was originally text for debugging.
func (*Coll) DebugErrorHTMLStr ¶
Sending an HTML to the error file was originally text for debugging.
func (*Coll) GetCollChildren ¶
func (this *Coll) GetCollChildren(name string) *CollChildren
Gets the CollListChildren handle
type CollChildren ¶
type CollChildren struct {
// contains filtered or unexported fields
}
Collector list children
type CollFields ¶
type CollFields struct {
// contains filtered or unexported fields
}
Collector Type
type CollOperate ¶
type CollOperate struct {
// contains filtered or unexported fields
}
func (*CollOperate) AutoCollFile ¶
Automatically builds new data return -1 - The data has been collected return 0 - Acquisition failed return >0 - Acquires the new ID of the data
func (*CollOperate) AutoCollParent ¶
func (this *CollOperate) AutoCollParent(parentTitle string, parentURL string) (int64, string)
Create an upper level ID
func (*CollOperate) AutoCollParentFiles ¶
func (this *CollOperate) AutoCollParentFiles(parentTitle string, parentURL string, urls []string) int64
Automatically collect collection
func (*CollOperate) CheckDataSha1 ¶
func (this *CollOperate) CheckDataSha1(sha1 string) bool
Check whether the file is duplicated
func (*CollOperate) CheckDataURL ¶
func (this *CollOperate) CheckDataURL(url string) bool
Check whether the file is duplicated
func (*CollOperate) CreateNewData ¶
func (this *CollOperate) CreateNewData(parent int64, sha1 string, src string, url string, name string, fileType string, size string) int64
Create a new data record
func (*CollOperate) DeleteData ¶
func (this *CollOperate) DeleteData(id int64) bool
Delete a collection of data
func (*CollOperate) GetCacheFIleInfo ¶
func (this *CollOperate) GetCacheFIleInfo(url string) (map[string]string, bool)
Gets the buffer file information
func (*CollOperate) GetFileSha1 ¶
func (this *CollOperate) GetFileSha1(src string) string
Gets the file SHA1 value
func (*CollOperate) GetLog ¶
func (this *CollOperate) GetLog(name string) string
Get the latest log content
func (*CollOperate) GetNowTimeUnix ¶
func (this *CollOperate) GetNowTimeUnix() int64
get now time unix
func (*CollOperate) GetStrSha1 ¶
func (this *CollOperate) GetStrSha1(str string) string
Gets the str SHA1 value
func (*CollOperate) NewLog ¶
func (this *CollOperate) NewLog(msg string, err error)
send log name string - Log name, corresponding to language configuration name append string - Additional content err error - error
func (*CollOperate) SaveCacheToFile ¶
func (this *CollOperate) SaveCacheToFile(parentName string, cacheFileInfo map[string]string) string
Save the buffer file to the file database parentName string - The name of the previous archive cacheFileInfo map[string]string - File information source string - data source
func (*CollOperate) UpdateData ¶
Update the data record information
func (*CollOperate) ViewDataList ¶
func (this *CollOperate) ViewDataList(parent int64, star int, searchTitle string, page int, max int, sort int, desc bool) ([]map[string]string, bool)
View the data list
func (*CollOperate) ViewDataSrc ¶
func (this *CollOperate) ViewDataSrc(id int64) string
View the data src
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
controller class
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database operation module
func (*Database) GetField ¶
func (this *Database) GetField(table string, fields []string, field string, value string) (*sql.Row, error)
Gets the specified field
func (*Database) GetFieldsToStr ¶
Obtains a field string based on the number of fields.
func (*Database) GetList ¶
func (this *Database) GetList(table string, fields []string, page int, max int, sort int, desc bool) (map[int]map[string]interface{}, error)
get the list
func (*Database) GetPageSortStr ¶
Get the sql pagination combo section.
func (*Database) GetResultToList ¶
func (this *Database) GetResultToList(fields []string, result *sql.Rows) (map[int]map[string]interface{}, error)
Obtain a list of data according to the field.
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
The page handle
func (*Handle) CheckLogin ¶
Check that you are logged in
func (*Handle) CheckURLPost ¶
Check the post data
func (*Handle) GetTempSrc ¶
Get the template file path
func (*Handle) ShowTemplate ¶
func (this *Handle) ShowTemplate(w http.ResponseWriter, r *http.Request, templateFileName string, data interface{})
Output template
type Language ¶
type Language struct {
// contains filtered or unexported fields
}
Language configuration processor
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
log struct You need to set the related configuration. IP address if the output is set, otherwise you can leave empty.
type MatchString ¶
type MatchString struct {
}
Authentication and query modules
func (*MatchString) CheckPassword ¶
func (this *MatchString) CheckPassword(str string) bool
Verify the 6-20 digit password
func (*MatchString) CheckUsername ¶
func (this *MatchString) CheckUsername(str string) bool
Verify the 4-16-digit user name
func (*MatchString) GetRandStr ¶
func (this *MatchString) GetRandStr(n int) string
Get a random number n - range
func (*MatchString) GetSha1 ¶
func (this *MatchString) GetSha1(content string) string
Gets the string sha1 value
type User ¶
type User struct {
// contains filtered or unexported fields
}
The user operates the module
func (*User) ChangeLoginSession ¶
Change the session state
func (*User) CheckLogin ¶
Check the login status
func (*User) CreateNewUser ¶
Create a new user
func (*User) GetLoginSession ¶
Gets the session state
func (*User) GetPasswdSha1 ¶
Gets the password SHA1 value
func (*User) LoginIn ¶
func (this *User) LoginIn(w http.ResponseWriter, r *http.Request, username string, passwd string) bool
log in
func (*User) SearchUsername ¶
Search for the user name get column
func (*User) UpdateLoginInfo ¶
Update table information
func (*User) UpdateUser ¶
Update user information
type UserFieldsStruct ¶
type UserFieldsStruct struct {
// contains filtered or unexported fields
}
Source Files
¶
- coll-children-feig.go
- coll-children-jiandan-index.go
- coll-children-jiandan.go
- coll-children-meizitu.go
- coll-children-xiuhaotu.go
- coll-children-xiuren.go
- coll-debug.go
- coll-local.go
- coll-operate.go
- coll-view.go
- coll.go
- config.go
- controller.go
- database.go
- file-operate.go
- handle.go
- headle-debug.go
- ip-addrs.go
- language.go
- log.go
- match-string.go
- router.go
- session.go
- simple-http.go
- tcp.go
- user.go