SendPage() renamed to SendAllPage().

This commit is contained in:
Alexey Skobkin 2016-03-30 05:04:04 +03:00
parent b8fea1a30f
commit 9ba6534965
3 changed files with 20 additions and 20 deletions

View File

@ -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)

View File

@ -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
View 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"`
}