Documentation ¶
Index ¶
- type APICredentials
- type AltSizeData
- type AnswerPost
- type AudioPost
- type Blog
- type BlogFollowers
- type BlogInfo
- type BlogLikes
- type ChatPost
- type DialogueData
- type EmbedObjectData
- type FollowingUser
- type LimitOffset
- type LinkPost
- type Meta
- type NoteData
- type PhotoData
- type PhotoPost
- type Post
- type PostBase
- func (p *PostBase) PostBlogName() string
- func (p *PostBase) PostBookmarklet() bool
- func (p *PostBase) PostDate() string
- func (p *PostBase) PostFormat() string
- func (p *PostBase) PostId() int64
- func (p *PostBase) PostLiked() bool
- func (p *PostBase) PostMobile() bool
- func (p *PostBase) PostNotes() []NoteData
- func (p *PostBase) PostPostURL() string
- func (p *PostBase) PostReblogKey() string
- func (p *PostBase) PostSourceTitle() string
- func (p *PostBase) PostSourceURL() string
- func (p *PostBase) PostState() string
- func (p *PostBase) PostTags() []string
- func (p *PostBase) PostTimestamp() int64
- func (p *PostBase) PostTotalPosts() int64
- func (p *PostBase) PostType() PostType
- type PostCollection
- type PostRequestParams
- type PostType
- type QuotePost
- type TextPost
- type Tumblr
- type TumblrAPIResponse
- type TumblrError
- type User
- type VideoPost
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APICredentials ¶
type AltSizeData ¶
One alternate size of a Photo
type AnswerPost ¶
type AnswerPost struct { PostBase AskingName string AskingURL string Question string Answer string }
Answer post
type AudioPost ¶
type AudioPost struct { PostBase Caption string Player string Plays int64 AlbumArt string Artist string Album string TrackName string TrackNumber int64 Year int }
Audio post
type Blog ¶
type Blog struct { BaseHostname string // contains filtered or unexported fields }
func (Blog) Followers ¶
func (blog Blog) Followers(params LimitOffset) ([]Blog, error)
Blog followers
func (*Blog) Likes ¶
func (blog *Blog) Likes(params LimitOffset) (*BlogLikes, error)
Posts liked by a blog
func (*Blog) Posts ¶
func (blog *Blog) Posts(params PostRequestParams) (*PostCollection, error)
Posts posted by a blog
type BlogFollowers ¶
type BlogFollowers struct { TotalUsers int64 Users []FollowingUser }
type BlogInfo ¶
type BlogInfo struct { Title string Posts int64 Name string Updated int64 Description string Ask bool AskAnon bool Likes int64 }
Type returned by blog.Info()
type BlogLikes ¶
type BlogLikes struct { Likes *PostCollection TotalCount int64 }
type ChatPost ¶
type ChatPost struct { PostBase Title string Body string Dialogue []DialogueData }
Chat post
type DialogueData ¶
One component of a conversation in a Dialogue in a Chat
type EmbedObjectData ¶
One embedded video player in a VideoPost
type FollowingUser ¶
type LimitOffset ¶
type NoteData ¶
type NoteData struct { Timestamp interface{} // this is either a string or an integer :( BlogName string `json:"blog_name"` BlogURL string `json:"blog_url"` PostID string `json:"post_id"` // wtf Type string `json:"type"` // reblog, like, post, ...? }
General notes information
{ "timestamp": "1401041794", // or an integer! lol "blog_name": "nalisification", "blog_url": "http://nalisification.tumblr.com/", "post_id": "1234", "type": "reblog" },
type PhotoData ¶
type PhotoData struct { Caption string // photosets only AltSizes []AltSizeData }
One photo in a PhotoPost
type Post ¶
type Post interface { PostBlogName() string PostId() int64 PostPostURL() string PostTimestamp() int64 PostType() PostType PostDate() string PostFormat() string PostReblogKey() string PostTags() []string PostBookmarklet() bool PostMobile() bool PostSourceURL() string PostSourceTitle() string PostLiked() bool PostState() string // published, ueued, draft, private PostNotes() []NoteData PostTotalPosts() int64 // total posts in result set for pagination }
Accessors for the common fields of a Post
type PostBase ¶
type PostBase struct { BlogName string Id int64 PostURL string Type string Timestamp int64 Date string Format string ReblogKey string Tags []string Bookmarklet bool Mobile bool SourceURL string SourceTitle string Liked bool State string // published, ueued, draft, private Notes []NoteData TotalPosts int64 // total posts in result set for pagination }
Stuff in the "response":"posts" field
func (*PostBase) PostBlogName ¶
func (*PostBase) PostBookmarklet ¶
func (*PostBase) PostFormat ¶
func (*PostBase) PostMobile ¶
func (*PostBase) PostPostURL ¶
func (*PostBase) PostReblogKey ¶
func (*PostBase) PostSourceTitle ¶
func (*PostBase) PostSourceURL ¶
func (*PostBase) PostTimestamp ¶
func (*PostBase) PostTotalPosts ¶
type PostCollection ¶
type PostCollection struct { Posts []Post // A conjunction of the below TextPosts []TextPost QuotePosts []QuotePost LinkPosts []LinkPost AnswerPosts []AnswerPost VideoPosts []VideoPost AudioPosts []AudioPost PhotoPosts []PhotoPost ChatPosts []ChatPost }
func NewPostCollection ¶
func NewPostCollection(r *json.RawMessage) (*PostCollection, error)
Constructs a PostCollection of typed Posts given the json.RawMessage of "response":"posts" which must be an array
type PostRequestParams ¶
type PostRequestParams struct { PostType string `url:"-"` Id int64 `url:"id,omitempty"` Tag string `url:"tag,omitempty"` ReblogInfo bool `url:"reblog_info,omitempty"` NotesInfo bool `url:"notes_info,omitempty"` Filter string `url:"filter,omitempty"` LimitOffset }
Search criteria to be passed to the Posts method
type PostType ¶
type PostType int
Post Types
func TypeOfPost ¶
Return the PostType of the type described in the JSON
type Tumblr ¶
type Tumblr struct {
Credentials APICredentials
}
type TumblrAPIResponse ¶
type TumblrAPIResponse struct { Meta Meta Response *json.RawMessage }
type TumblrError ¶
type TumblrError struct {
Message string
}
Errors
func (TumblrError) Error ¶
func (err TumblrError) Error() string
type VideoPost ¶
type VideoPost struct { PostBase Caption string Players []EmbedObjectData }
Video post - TODO Handle all the different sources - not documented :(