data

package
v0.0.0-...-3323a25 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2015 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteAllItems

func DeleteAllItems(c interface{}) error

DeleteAllItems deletes all items from datastore

func NamespaceIsEmpty

func NamespaceIsEmpty(c interface{}, namespace string) (bool, error)

NamespaceIsEmpty checks if there is already an item in a namespace

func StoreItem

func StoreItem(c interface{}, i Item) error

StoreItem stores an item in the datastore

Types

type Item

type Item struct {
	Caption     string    `json:"caption" datastore:"Caption,noindex"`
	URL         string    `json:"url" datastore:"URL,index"`
	Via         string    `json:"via" datastore:"Via,noindex"`
	ImageURL    string    `json:"imageURL" datastore:"ImageURL,noindex"`
	Description string    `json:"description" datastore:"Description,noindex"`
	CreatedAt   time.Time `json:"createdat" datastore:"CreatedAt,index"`
	Namespace   string    `json:"-" datastore:"Namespace,index"`
}

An Item is all the data we store from a website

func GetNewestItems

func GetNewestItems(c interface{}, namespace string, limit int, cursor string) ([]Item, string, error)

GetNewestItems returns the latest number elements for a specific namespace

Jump to

Keyboard shortcuts

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