mirror of
https://bitbucket.org/skobkin/point-tools-go.git
synced 2024-11-22 04:46:03 +00:00
SendPage() renamed to SendAllPage().
This commit is contained in:
parent
b8fea1a30f
commit
9ba6534965
|
@ -5,10 +5,10 @@ import (
|
||||||
"bitbucket.org/skobkin/dumb-http-go"
|
"bitbucket.org/skobkin/dumb-http-go"
|
||||||
"bitbucket.org/skobkin/point-api-go"
|
"bitbucket.org/skobkin/point-api-go"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"errors"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Package errors
|
// Package errors
|
||||||
|
@ -43,9 +43,9 @@ func GetPageJSON(page point.Page) (string, error) {
|
||||||
return string(b[:]), nil
|
return string(b[:]), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendPage sends page to Point Tools crawler API gate for processing
|
// SendAllPage sends /all page to Point Tools crawler API gate for processing
|
||||||
func (c *PointToolsClient) SendPage(page point.Page) (ReceiveAllPageResponse, error) {
|
func (c *PointToolsClient) SendAllPage(page point.Page) (SendAllPageResponse, error) {
|
||||||
var response ReceiveAllPageResponse
|
var response SendAllPageResponse
|
||||||
|
|
||||||
jsonStr, err := GetPageJSON(page)
|
jsonStr, err := GetPageJSON(page)
|
||||||
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
package point_tools
|
|
||||||
|
|
||||||
const (
|
|
||||||
STATUS_SUCCESS string = "success"
|
|
||||||
STATUS_FAILURE string = "fail"
|
|
||||||
)
|
|
||||||
|
|
||||||
type ReceiveAllPageResponse struct {
|
|
||||||
Status string `json:"status"`
|
|
||||||
Data ReceiveAllPageData `json:"data"`
|
|
||||||
Error ApiError `json:"error"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type ReceiveAllPageData struct {
|
|
||||||
Continue bool `json:"continue"`
|
|
||||||
}
|
|
16
send_all_page_response.go
Normal file
16
send_all_page_response.go
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package point_tools
|
||||||
|
|
||||||
|
const (
|
||||||
|
STATUS_SUCCESS string = "success"
|
||||||
|
STATUS_FAILURE string = "fail"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SendAllPageResponse struct {
|
||||||
|
Status string `json:"status"`
|
||||||
|
Data SendAllPageResponseData `json:"data"`
|
||||||
|
Error ApiError `json:"error"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type SendAllPageResponseData struct {
|
||||||
|
Continue bool `json:"continue"`
|
||||||
|
}
|
Loading…
Reference in a new issue