func (s *Storage) SetCookies(u *url.URL, cookies string) {
	s.mu.Lock()
	defer s.mu.Unlock()
	statement, err := s.dbh.Prepare("INSERT INTO cookies (host, cookies) VALUES (?,?)")
	if err != nil {
		log.Printf("SetCookies() .Set error %s", err)
	}
	_, err = statement.Exec(u.Host, cookies)
	if err != nil {
		log.Printf("SetCookies() .Set error %s", err)
	}
}
SetCookies implements colly/storage..SetCookies()
package sqlite3
import (
	"fmt"
	"log"
	"database/sql"
	"net/url"
	"sync"
	_ "github.com/mattn/go-sqlite3"
	"strings"
)
type Storage struct {
	Filename string
	dbh *sql.DB
	mu  sync.RWMutex  
}
func (s *Storage) Init() error {
	if s.dbh == nil {
		db, err := sql.Open("sqlite3", s.Filename)
		if err != nil {
			return fmt.Errorf("unable to open db file: %s", err.Error())
		}
		err = db.Ping()
		if err != nil {
			return fmt.Errorf("db init failure: %s", err.Error())
		}
		s.dbh = db
	}
	statement, _ := s.dbh.Prepare("CREATE TABLE IF NOT EXISTS visited (id INTEGER PRIMARY KEY, requestID INTEGER, visited INT)")
	_, err := statement.Exec()
	if err != nil {
		return err
	}
	statement, _ = s.dbh.Prepare("CREATE INDEX IF NOT EXISTS idx_visited ON visited (requestID)")
	_, err = statement.Exec()
	if err != nil {
		return err
	}
	statement, _ = s.dbh.Prepare("CREATE TABLE IF NOT EXISTS cookies (id INTEGER PRIMARY KEY, host TEXT, cookies TEXT)")
	_, err = statement.Exec()
	if err != nil {
		return err
	}
	statement, err = s.dbh.Prepare("CREATE INDEX IF NOT EXISTS idx_cookies ON cookies (host)")
	_, err = statement.Exec()
	if err != nil {
		return err
	}
	statement, err = s.dbh.Prepare("CREATE TABLE IF NOT EXISTS queue (id INTEGER PRIMARY KEY, data BLOB)")
	_, err = statement.Exec()
	if err != nil {
		return err
	}
	return nil
}
func (s *Storage) Clear() error {
	s.mu.Lock()
	defer s.mu.Unlock()
	statement, err := s.dbh.Prepare("DROP TABLE visited")
	if err != nil {
		return err
	}
	_, err = statement.Exec()
	if err != nil {
		return err
	}
	statement, err = s.dbh.Prepare("DROP TABLE cookies")
	if err != nil {
		return err
	}
	_, err = statement.Exec()
	if err != nil {
		return err
	}
	statement, err = s.dbh.Prepare("DROP TABLE queue")
	if err != nil {
		return err
	}
	_, err = statement.Exec()
	if err != nil {
		return err
	}
	return nil
}
func (s *Storage) Close() error {
	err := s.dbh.Close()
	return err
}
func (s *Storage) Visited(requestID uint64) error {
	statement, err := s.dbh.Prepare("INSERT INTO visited (requestID, visited) VALUES (?, 1)")
	if err != nil {
		return err
	}
	_, err = statement.Exec(int64(requestID))
	if err != nil {
		return err
	}
	return nil
}
func (s *Storage) IsVisited(requestID uint64) (bool, error) {
	var count int
	statement, err := s.dbh.Prepare("SELECT COUNT(*) FROM visited where requestId = ?")
	if err != nil {
		return false, err
	}
	row := statement.QueryRow(int64(requestID))
	err = row.Scan(&count)
	if err != nil {
		return false, err
	}
	if count >= 1 {
		return true, nil
	}
	return false, nil
}