storage

package
v0.0.0-...-585e8d0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreNewEntriesAvailable

func AreNewEntriesAvailable(c appengine.Context, subscriptions []Subscription) (bool, error)

func DeleteArticlesWithinScope

func DeleteArticlesWithinScope(c appengine.Context, scope ArticleScope) error

func DeleteFolder

func DeleteFolder(c appengine.Context, ref FolderRef) error

func DeleteTag

func DeleteTag(c appengine.Context, userID UserID, tagID string) error

func FolderExists

func FolderExists(c appengine.Context, ref FolderRef) (bool, error)

func IsFeedAvailable

func IsFeedAvailable(c appengine.Context, url string) (bool, error)

func IsFieldMismatch

func IsFieldMismatch(err error) bool

func IsFolderDuplicate

func IsFolderDuplicate(c appengine.Context, userID UserID, title string) (bool, error)

func IsSubscriptionDuplicate

func IsSubscriptionDuplicate(c appengine.Context, userID UserID, subscriptionURL string) (bool, error)

func MarkAllAsRead

func MarkAllAsRead(c appengine.Context, scope ArticleScope) (int, error)

func MoveArticles

func MoveArticles(c appengine.Context, subRef SubscriptionRef, destRef FolderRef) error

func MoveSubscription

func MoveSubscription(c appengine.Context, subRef SubscriptionRef, destRef FolderRef) error

func RemoveTag

func RemoveTag(c appengine.Context, userID UserID, tag string) error

func RenameFolder

func RenameFolder(c appengine.Context, ref FolderRef, title string) error

func RenameSubscription

func RenameSubscription(c appengine.Context, ref SubscriptionRef, title string) error

func SetProperty

func SetProperty(c appengine.Context, ref ArticleRef, propertyName string, propertyValue bool) ([]string, error)

func SetTags

func SetTags(c appengine.Context, ref ArticleRef, tags []string) ([]string, error)

func SubscriptionExists

func SubscriptionExists(c appengine.Context, ref SubscriptionRef) (bool, error)

func SubscriptionsAsOPML

func SubscriptionsAsOPML(c appengine.Context, userID UserID) (*rss.OPML, error)

func TagExists

func TagExists(c appengine.Context, userID UserID, tagID string) (bool, error)

func Unsubscribe

func Unsubscribe(c appengine.Context, ref SubscriptionRef) error

func UpdateAllSubscriptions

func UpdateAllSubscriptions(c appengine.Context, userID UserID) error

func UpdateFeed

func UpdateFeed(c appengine.Context, parsedFeed *rss.Feed, favIconURL string, fetched time.Time) error

func UpdateMedia

func UpdateMedia(c appengine.Context, entryKey *datastore.Key, entry *rss.Entry) error

func UpdateSubscription

func UpdateSubscription(c appengine.Context, url string, ref SubscriptionRef) (int, error)

func UpdateUnreadCounts

func UpdateUnreadCounts(c appengine.Context, ch chan<- Subscription, subscriptionKey *datastore.Key, subscription Subscription)

func WebToFeedURL

func WebToFeedURL(c appengine.Context, url string, title *string) (string, error)

Types

type Article

type Article struct {
	ID     string `datastore:"-" json:"id"`
	Source string `datastore:"-" json:"source"`

	Details *Entry        `datastore:"-" json:"details"`
	Media   []*EntryMedia `datastore:"-" json:"media,omitempty"`

	UpdateIndex int64          `json:"-"`
	Fetched     time.Time      `json:"time"`
	Published   time.Time      `json:"published"`
	Entry       *datastore.Key `json:"-"`

	Properties []string `json:"properties"`
	Tags       []string `json:"tags"`
}

func (Article) HasProperty

func (article Article) HasProperty(propName string) bool

func (Article) IsLiked

func (article Article) IsLiked() bool

func (Article) IsUnread

func (article Article) IsUnread() bool

func (Article) LikeCount

func (article Article) LikeCount(c appengine.Context) (int, error)

func (*Article) SetProperty

func (article *Article) SetProperty(propName string, set bool)

func (*Article) SetTag

func (article *Article) SetTag(tagName string, set bool)

func (*Article) ToggleProperty

func (article *Article) ToggleProperty(propName string)

type ArticleExtras

type ArticleExtras struct {
	LikeCount int `json:"likeCount"`
}

func LoadArticleExtras

func LoadArticleExtras(c appengine.Context, ref ArticleRef) (ArticleExtras, error)

type ArticleFilter

type ArticleFilter struct {
	ArticleScope
	Property string `json:"p,omitempty"`
	Tag      string `json:"t,omitempty"`
}

func ArticleFilterFromJSON

func ArticleFilterFromJSON(userID UserID, filterAsJSON string) (ArticleFilter, error)

type ArticlePage

type ArticlePage struct {
	Articles []Article `json:"articles"`
	Continue string    `json:"continue,omitempty"`
}

func NewArticlePage

func NewArticlePage(c appengine.Context, filter ArticleFilter, start string) (*ArticlePage, error)

type ArticleRef

type ArticleRef struct {
	SubscriptionRef
	ArticleID string
}

type ArticleScope

type ArticleScope SubscriptionRef

func ArticleScopeFromJSON

func ArticleScopeFromJSON(userID UserID, scopeAsJSON string) (ArticleScope, error)

type BatchOp

type BatchOp int
const (
	BatchPut BatchOp = iota
	BatchDelete
)

type BatchWriter

type BatchWriter struct {
	// contains filtered or unexported fields
}

func NewBatchWriter

func NewBatchWriter(c appengine.Context, op BatchOp) *BatchWriter

func NewBatchWriterWithSize

func NewBatchWriterWithSize(c appengine.Context, op BatchOp, size int) *BatchWriter

func (*BatchWriter) Close

func (writer *BatchWriter) Close() error

func (*BatchWriter) Enqueue

func (writer *BatchWriter) Enqueue(key *datastore.Key, object interface{}) error

func (*BatchWriter) EnqueueKey

func (writer *BatchWriter) EnqueueKey(key *datastore.Key) error

func (*BatchWriter) Flush

func (writer *BatchWriter) Flush() error

func (BatchWriter) Written

func (writer BatchWriter) Written() int

type Entry

type Entry struct {
	Author   string    `json:"author"`
	Title    string    `json:"title"`
	Link     string    `json:"link"`
	HasMedia bool      `json:"-"`
	Updated  time.Time `json:"-"`

	Content string `json:"content" datastore:",noindex"`
	Summary string `json:"summary" datastore:",noindex"`
}

type EntryMedia

type EntryMedia struct {
	URL   string         `json:"url"`
	Type  string         `json:"type"`
	Title string         `json:"-"`
	Entry *datastore.Key `json:"-"`
}

func MediaForEntry

func MediaForEntry(c appengine.Context, entryKey *datastore.Key) ([]*EntryMedia, error)

type EntryMeta

type EntryMeta struct {
	Fetched     time.Time
	Published   time.Time
	InfoDigest  []byte
	UpdateIndex int64
	Entry       *datastore.Key
}

type Feed

type Feed struct {
	URL         string
	Title       string
	Description string `datastore:",noindex"`
	Link        string
	Format      string `datastore:",noindex"`
	Topic       string
	HubURL      string
	FavIconURL  string `datastore:",noindex"`
	Updated     time.Time
}

func FeedByURL

func FeedByURL(c appengine.Context, url string) (*Feed, error)

type FeedMeta

type FeedMeta struct {
	Feed                  *datastore.Key
	InfoDigest            []byte
	Fetched               time.Time
	NextFetch             time.Time
	UpdateCounter         int64
	HourlyUpdateFrequency float32
}

type FeedSubscriber

type FeedSubscriber struct {
	Feed  *datastore.Key
	Count int
}

type FeedUsage

type FeedUsage struct {
	UpdateCount            int64
	LastSubscriptionUpdate time.Time
	Feed                   *datastore.Key
}

type Folder

type Folder struct {
	ID    string `json:"id" datastore:"-"`
	Title string `json:"title"`
}

type FolderRef

type FolderRef struct {
	UserID   UserID `json:",omitempty"`
	FolderID string `json:"f,omitempty"`
}

func CreateFolder

func CreateFolder(c appengine.Context, userID UserID, title string) (FolderRef, error)

func FolderByTitle

func FolderByTitle(c appengine.Context, userID UserID, title string) (FolderRef, error)

func (FolderRef) IsZero

func (ref FolderRef) IsZero() bool

type StorageInfo

type StorageInfo struct {
	Version int
}

type Subscription

type Subscription struct {
	ID         string `datastore:"-" json:"id"`
	Link       string `datastore:"-" json:"link"`
	FavIconURL string `datastore:"-" json:"favIconUrl"`
	Parent     string `datastore:"-" json:"parent,omitempty"`

	Updated        time.Time      `json:"-"`
	Subscribed     time.Time      `json:"-"`
	Feed           *datastore.Key `json:"-"`
	MaxUpdateIndex int64          `json:"-"`

	Title       string `json:"title"`
	UnreadCount int    `json:"unread"`
}

type SubscriptionRef

type SubscriptionRef struct {
	FolderRef
	SubscriptionID string `json:"s,omitempty"`
}

func Subscribe

func Subscribe(c appengine.Context, ref FolderRef, url string, title string) (SubscriptionRef, error)

func SubscriptionRefFromJSON

func SubscriptionRefFromJSON(userID UserID, refAsJSON string) (SubscriptionRef, error)

func (SubscriptionRef) IsSubscriptionExplicit

func (ref SubscriptionRef) IsSubscriptionExplicit() bool

type Tag

type Tag struct {
	Title   string    `json:"title"`
	Created time.Time `json:"-"`
}

type User

type User struct {
	ID                     string
	EmailAddress           string
	LastSubscriptionUpdate time.Time
}

func UserByID

func UserByID(c appengine.Context, userID UserID) (*User, error)

func (User) Save

func (user User) Save(c appengine.Context) error

type UserID

type UserID string

type UserSubscriptions

type UserSubscriptions struct {
	Subscriptions []Subscription `json:"subscriptions"`
	Folders       []Folder       `json:"folders"`
	Tags          []Tag          `json:"tags"`
}

func NewUserSubscriptions

func NewUserSubscriptions(c appengine.Context, userID UserID) (*UserSubscriptions, error)

Jump to

Keyboard shortcuts

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