mirror of
https://bitbucket.org/skobkin/point-tools-go.git
synced 2024-12-22 07:24:21 +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/point-api-go"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Package errors
|
||||
|
@ -43,9 +43,9 @@ func GetPageJSON(page point.Page) (string, error) {
|
|||
return string(b[:]), nil
|
||||
}
|
||||
|
||||
// SendPage sends page to Point Tools crawler API gate for processing
|
||||
func (c *PointToolsClient) SendPage(page point.Page) (ReceiveAllPageResponse, error) {
|
||||
var response ReceiveAllPageResponse
|
||||
// SendAllPage sends /all page to Point Tools crawler API gate for processing
|
||||
func (c *PointToolsClient) SendAllPage(page point.Page) (SendAllPageResponse, error) {
|
||||
var response SendAllPageResponse
|
||||
|
||||
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