mgostasher

package
v0.0.0-...-4a2b322 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBlogPageCollection    = "blog_page"
	DefaultBlogPostCollection    = "blog_post"
	DefaultBlogCollection        = "blog"
	DefaultTweetCollection       = "tweet"
	DefaultTwitterUserCollection = "twitterer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Blog

type Blog struct {
	Id              *bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"`
	Blog            *blogger.Blog  `bson:"blog,omitempty" json:"blog"`
	Updated         *time.Time     `bson:"updated,omitempty" json:"updated"`
	PostListEtag    *string        `bson:"postListEtag,omitempty"`
	PostListUpdated *time.Time     `bson:"postListUpdated,omitempty"`
	PageListEtag    *string        `bson:"pageListEtag,omitempty"`
	PageListUpdated *time.Time     `bson:"pageListUpdated,omitempty"`
}

type BlogPage

type BlogPage struct {
	Id       *bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"`
	BlogPage *blogger.Page  `bson:"blogPage" json:"blogPage"`
	Updated  *time.Time     `bson:"updated" json:"updated"`
}

func WrapBlogPage

func WrapBlogPage(page *blogger.Page) *BlogPage

type BlogPost

type BlogPost struct {
	Id       *bson.ObjectId `bson:"_id,omitempty" json:"id,omitempty"`
	BlogPost *blogger.Post  `bson:"blogPost" json:"blogPost"`
	Updated  *time.Time     `bson:"updated" json:"updated"`
}

func WrapBlogPost

func WrapBlogPost(post *blogger.Post) *BlogPost

type BlogStasher

type BlogStasher struct {
	BlogPageCollection *mgo.Collection
	BlogPostCollection *mgo.Collection
	BlogCollection     *mgo.Collection
}

func DefaultBlogStasher

func DefaultBlogStasher(db *mgo.Database) (m *BlogStasher)

func (*BlogStasher) GetPageListEtag

func (m *BlogStasher) GetPageListEtag(ctx context.Context, blogId string) (etag *string)

func (*BlogStasher) GetPostListEtag

func (m *BlogStasher) GetPostListEtag(ctx context.Context, blogId string) (etag *string)

func (*BlogStasher) HasPage

func (m *BlogStasher) HasPage(ctx context.Context, pageId string, etag string) bool

func (*BlogStasher) HasPost

func (m *BlogStasher) HasPost(ctx context.Context, postId string, etag string) bool

func (*BlogStasher) StashBlog

func (m *BlogStasher) StashBlog(ctx context.Context, blog *blogger.Blog)

func (*BlogStasher) StashPage

func (m *BlogStasher) StashPage(ctx context.Context, page *blogger.Page)

func (*BlogStasher) StashPageEtags

func (m *BlogStasher) StashPageEtags(ctx context.Context, blogId string, listEtag string, pageEtags map[string]string, newUpdated *time.Time)

func (*BlogStasher) StashPost

func (m *BlogStasher) StashPost(ctx context.Context, post *blogger.Post)

func (*BlogStasher) StashPostEtags

func (m *BlogStasher) StashPostEtags(ctx context.Context, blogId string, listEtag string, postEtags map[string]string, newUpdated *time.Time)

type Tweet

type Tweet struct {
	Id     *bson.ObjectId       `bson:"_id,omitempty" json:",omitempty"`
	Tweet  *twitter.Tweet       `bson:"tweet" json:"tweet"`
	OEmbed *twitter.OEmbedTweet `bson:"oEmbed" json:"oEmbed"`
}

type TwitterStasher

type TwitterStasher struct {
	TweetCollection       *mgo.Collection
	TwitterUserCollection *mgo.Collection
}

func DefaultTwitterStasher

func DefaultTwitterStasher(db *mgo.Database) (m *TwitterStasher)

func (*TwitterStasher) GetLastTweetId

func (m *TwitterStasher) GetLastTweetId(ctx context.Context, userId int64) int64

func (*TwitterStasher) StashTweet

func (m *TwitterStasher) StashTweet(ctx context.Context, tweet *twitter.Tweet, oembed *twitter.OEmbedTweet)

func (*TwitterStasher) StashUser

func (m *TwitterStasher) StashUser(ctx context.Context, user *twitter.User)

type TwitterUser

type TwitterUser struct {
	Id          *bson.ObjectId `bson:"_id,omitempty" json:",omitempty"`
	TwitterUser *twitter.User  `bson:"twitterUser"`
}

Jump to

Keyboard shortcuts

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