Documentation
¶
Index ¶
- type AuthToken
- type Comment
- type Post
- func GetHot(subreddit string, limit int, authorization AuthToken) ([]Post, error)
- func GetNew(subreddit string, limit int, authorization AuthToken) ([]Post, error)
- func GetPosts(subreddit string, limit int, sort string, authorization AuthToken) (posts []Post, err error)
- func GetRising(subreddit string, limit int, authorization AuthToken) ([]Post, error)
- func GetTop(subreddit string, limit int, authorization AuthToken) ([]Post, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthToken ¶
type AuthToken struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` DeviceId string `json:"device_id"` ExpiresIn int `json:"expires_in"` Scope string `json:"scope"` }
func GetAuthToken ¶
type Comment ¶
type Comment struct { Id string `json:"id"` Body string `json:"body"` Ups int `json:"ups"` Downs int `json:"downs"` Score int `json:"score"` Created time.Time `json:"created_utc"` Depth int `json:"depth"` Author string `json:"author"` // Parent and children needs to be filled in after struct has been unmarshalled //Parent *Comment `json:"-"` Replies []Comment `json:"replies"` }
type Post ¶
type Post struct { Subreddit string `json:"subreddit"` Title string `json:"title"` Body string `json:"selftext"` Ups int `json:"ups"` Downs int `json:"downs"` Score int `json:"score"` UpvoteRatio float64 `json:"upvote_ratio"` Created float64 `json:"created_utc"` Author string `json:"author"` Permalink string `json:"permalink"` NumComments int `json:"num_comments"` Comments []Comment `json:"comments"` DownloadTime time.Time `json:"-"` }
Click to show internal directories.
Click to hide internal directories.