cloudant

package
v0.0.0-...-7c66d03 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 1, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERROR_404 = errors.New("Doc not found.")
View Source
var ErrorNoLatestVersion = errors.New("Not latest revision.")

Functions

func IsItParsed

func IsItParsed(target string) bool

IsItParsed checks if the given url is already parsed

func IsURLThere

func IsURLThere(target string) bool

IsURLThere checks if the given url is already stored in the database

Types

type CouchDoc

type CouchDoc struct {
	ID           string              `json:"_id"`
	Rev          string              `json:"_rev"`
	URL          string              `json:"url"`
	HTML         string              `json:"html"`
	Text         parse.PageStructure `json:"text"`
	Links        []string            `json:"links"`
	LinksToQueue []string            `json:"-"`
}

CouchDoc represents a response fron CouchDB

func GetURLData

func GetURLData(id string) (CouchDoc, error)

GetURLData gets the data stored in Couch, does a lookup by doc id

type CouchDocCreated

type CouchDocCreated struct {
	OK  bool   `json:"ok"`
	ID  string `json:"id"`
	Rev string `json:"rev"`
}

CouchDocCreated represents a full document

func AddURLData

func AddURLData(url string, data []byte) (CouchDocCreated, error)

AddURLData adds the url and data to the database. data is json encoded.

func SaveExtractedTextAndLinks(id string, data []byte) (CouchDocCreated, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL