Humble doc comments.

This commit is contained in:
Alexey Skobkin 2016-03-29 10:41:00 +03:00
parent fac428f790
commit 6e682828ee
1 changed files with 4 additions and 1 deletions

View File

@ -1,8 +1,9 @@
// Package point_tools implements simple Point Tools API wrapper for sending some service requests.
package point_tools package point_tools
import ( import (
"bitbucket.org/skobkin/point-api-go"
"bitbucket.org/skobkin/dumb-http-go" "bitbucket.org/skobkin/dumb-http-go"
"bitbucket.org/skobkin/point-api-go"
"encoding/json" "encoding/json"
"log" "log"
"net/http" "net/http"
@ -15,6 +16,7 @@ type PointToolsClient struct {
token string token string
} }
// New creates new Point Tools API client instance and initialize it to use provided URL and token
func New(apiUrl, token string) PointToolsClient { func New(apiUrl, token string) PointToolsClient {
return PointToolsClient{ return PointToolsClient{
simple_http.Client{http.Client{}}, simple_http.Client{http.Client{}},
@ -34,6 +36,7 @@ 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
func (c *PointToolsClient) SendPage(page point.Page) (ReceiveAllPageResponse, error) { func (c *PointToolsClient) SendPage(page point.Page) (ReceiveAllPageResponse, error) {
var response ReceiveAllPageResponse var response ReceiveAllPageResponse