Documentation ¶
Overview ¶
GoSpider is a simple go crawler framework. User only need to care about the rules of page, provides web page to manage task. Base on colly.
Example ¶
quitstart
package main import ( "github.com/nange/gospider" log "github.com/sirupsen/logrus" ) func main() { // if gospider.New() has no argments, will use env parameters // gs := gospider.New() gs := gospider.New( gospider.BackendMySQL(), gospider.MySQLHost("127.0.0.1"), gospider.MySQLPort(3306), gospider.MySQLDBName("test"), gospider.MySQLUser("root"), gospider.MySQLPassword(""), gospider.WebPort(8080), ) log.Fatal(gs.Run()) }
Output:
Index ¶
- Constants
- func BackendMySQL() func(*GoSpider)
- func BackendSQLite() func(*GoSpider)
- func MySQLDBName(dbname string) func(*GoSpider)
- func MySQLHost(host string) func(*GoSpider)
- func MySQLPassword(password string) func(*GoSpider)
- func MySQLPort(port int) func(*GoSpider)
- func MySQLUser(user string) func(*GoSpider)
- func WebIP(ip string) func(*GoSpider)
- func WebPort(port int) func(*GoSpider)
- type GoSpider
Examples ¶
Constants ¶
View Source
const ( // Name is the name of gospider Name = "gospider" // Version is the version of gospider Version = "1.0.0" )
Variables ¶
This section is empty.
Functions ¶
func BackendMySQL ¶
func BackendMySQL() func(*GoSpider)
BackendMySQL sets the gospider backend with mysql
func BackendSQLite ¶
func BackendSQLite() func(*GoSpider)
BackendSQLite sets the gospider backend with sqllite
func MySQLDBName ¶
MySQLDBName sets the mysql dbname
func MySQLPassword ¶
MySQLPassword sets the mysql password
Types ¶
Click to show internal directories.
Click to hide internal directories.