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

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