Documentation ¶
Index ¶
- func RequestUserOAuthCode(w http.ResponseWriter, r *http.Request, clientID string, redirectUrl string, ...)
- type Client
- func (c *Client) ClearNotifications() ([]Notification, error)
- func (c *Client) CreateComment(postID int, parentCommentID int, body string) (Comment, error)
- func (c *Client) CreatePost(link string, name string, tagline string) (Post, error)
- func (c *Client) Follow(userID int, following bool) (User, error)
- func (c *Client) GetAllPosts(searchUrl string, olderThanID int, newerThanID int, count int) ([]Post, error)
- func (c *Client) GetAllUsers(olderThanID int, newerThanID int, count int, order string) ([]User, error)
- func (c *Client) GetFollowers(userID int, olderThanID int, newerThanID int, count int, order string) ([]User, error)
- func (c *Client) GetFollowing(userID int, olderThanID int, newerThanID int, count int, order string) ([]User, error)
- func (c *Client) GetNotifications(olderThanID int, newerThanID int, count int, order string) ([]Notification, error)
- func (c *Client) GetPost(id int) (Post, error)
- func (c *Client) GetPostComments(postID int, olderThanID int, newerThanID int, count int, order string) ([]Comment, error)
- func (c *Client) GetPostVotes(postID int, olderThanID int, newerThanID int, count int, order string) ([]Vote, error)
- func (c *Client) GetPosts() ([]Post, error)
- func (c *Client) GetPostsOnDay(day string) ([]Post, error)
- func (c *Client) GetPreviousPosts(daysAgo int) ([]Post, error)
- func (c *Client) GetRelatedLinks(searchUrl string) ([]RelatedLink, error)
- func (c *Client) GetSettings() (UserSettings, error)
- func (c *Client) GetUser(username string) (User, error)
- func (c *Client) GetUserComments(userID int, olderThanID int, newerThanID int, count int, order string) ([]Comment, error)
- func (c *Client) GetUserVotes(userID int, olderThanID int, newerThanID int, count int, order string) ([]Vote, error)
- func (c *Client) UpdateComment(commentID int, parentCommentID int, body string) (Comment, error)
- func (c *Client) UpdateSettings(settings *UserSettings) error
- func (c *Client) VoteForPost(postID int, voting bool) (Vote, error)
- type Comment
- type Notification
- type NotificationInfo
- type PermissionInfo
- type Post
- type RelatedLink
- type Request
- type Token
- type User
- type UserSettings
- type Vote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequestUserOAuthCode ¶
func RequestUserOAuthCode(w http.ResponseWriter, r *http.Request, clientID string, redirectUrl string, state string)
Request Access Grant Code and send to redirectUrl
Types ¶
type Client ¶
func GenAuthClient ¶
func NewOAuthClient ¶
OAuth2 Client-Only Authentication
func NewUserClient ¶
User-Authenticated Client with Developer Token
func NewUserOAuthClient ¶
func NewUserOAuthClient(clientID string, clientSecret string, redirectUrl string, code string) (*Client, error)
OAuth2 User-Authenticated Client with Access Grant Code
func (*Client) ClearNotifications ¶
func (c *Client) ClearNotifications() ([]Notification, error)
func (*Client) CreateComment ¶
func (*Client) CreatePost ¶
func (*Client) GetAllPosts ¶
func (*Client) GetAllUsers ¶
func (*Client) GetFollowers ¶
func (c *Client) GetFollowers(userID int, olderThanID int, newerThanID int, count int, order string) ([]User, error)
Follow Routes
func (*Client) GetFollowing ¶
func (*Client) GetNotifications ¶
func (c *Client) GetNotifications(olderThanID int, newerThanID int, count int, order string) ([]Notification, error)
Notification Routes
func (*Client) GetPostComments ¶
func (c *Client) GetPostComments(postID int, olderThanID int, newerThanID int, count int, order string) ([]Comment, error)
Comment Routes
func (*Client) GetPostVotes ¶
func (c *Client) GetPostVotes(postID int, olderThanID int, newerThanID int, count int, order string) ([]Vote, error)
Vote Routes
func (*Client) GetRelatedLinks ¶
func (c *Client) GetRelatedLinks(searchUrl string) ([]RelatedLink, error)
Related Links Route
func (*Client) GetUserComments ¶
func (*Client) GetUserVotes ¶
func (*Client) UpdateComment ¶
func (*Client) UpdateSettings ¶
func (c *Client) UpdateSettings(settings *UserSettings) error
type Comment ¶
type Comment struct { ID int `json:"id"` PostID int `json:"post_id"` ParentCommentID int `json:"parent_comment_id"` UserID int `json:"user_id"` RepliesCount int `json:"child_comments_count"` Body string `json:"body"` Created string `json:"created_at"` Maker bool `json:"maker"` User User `json:"user"` Replies []Comment `json:"child_comments"` }
type Notification ¶
type Notification struct { ID int `json:"id"` Type string `json:"type"` // 'comment' or 'post' ShortBody string `json:"body"` FullBody string `json:"sentence"` Seen bool `json:"seen"` Reference interface{} FromUser User `json:"from_user"` ToUser User `json:"to_user"` }
func (Notification) Summary ¶
func (n Notification) Summary() string
type NotificationInfo ¶
type PermissionInfo ¶
type Post ¶
type Post struct { ID int `json:"id,"` Name string `json:"name"` Tagline string `json:"tagline"` Created string `json:"created_at"` Day string `json:"day"` CommentsCount int `json:"comments_count"` VotesCount int `json:"votes_count"` DiscussionUrl string `json:"discussion_url"` RedirectUrl string `json:"redirect_url"` ScreenshotUrl map[string]string `json:"screenshot_url"` CurrentUser currentUser `json:"current_user"` User User `json:"user"` MakerInside bool `json:"maker_inside"` Makers []User `json:"makers"` }
type RelatedLink ¶
type RelatedLink struct { ID int `json:"id"` Url string `json:"url"` Title string `json:"title"` Domain string `json:"domain"` Favicon string `json:"favicon"` PostID int `json:"post_id"` UserID int `json:"user_id"` Post Post `json:"post"` }
func (RelatedLink) Summary ¶
func (c RelatedLink) Summary() string
type User ¶
type User struct { ID int `json:"id"` Name string `json:"name"` Username string `json:"username"` Headline string `json:"headline"` Created string `json:"created_at"` ImageUrl map[string]string `json:"image_url"` ProfileUrl string `json:"profile_url"` WebsiteUrl string `json:"website_url"` Votes []Vote `json:"votes"` Posts []Post `json:"posts"` MakerOf []Post `json:"maker_of"` Followers []User `json:"followers"` Following []User `json:"followings"` CollectionsCount int64 `json:"collections_count"` CreatedAt string `json:"created_at"` FollowersCount int64 `json:"followers_count"` FollowingsCount int64 `json:"followings_count"` MakerOfCount int64 `json:"maker_of_count"` PostsCount int64 `json:"posts_count"` VotesCount int64 `json:"votes_count"` TwitterUsername string `json:"twitter_username"` }
type UserSettings ¶
type UserSettings struct { ID int `json:"id"` Name string `json:"name"` Username string `json:"username"` Headline string `json:"headline"` Created string `json:"created_at"` ImageUrl map[string]string `json:"image_url"` ProfileUrl string `json:"profile_url"` WebsiteUrl string `json:"website_url"` VotesCount int `json:"votes_count"` PostsCount int `json:"posts_count"` MakerCount int `json:"maker_of_count"` FollowersCount int `json:"followers_count"` FollowingCount int `json:"followings_count"` SendMentionEmail bool `json:"send_mention_email"` SendMentionPush bool `json:"send_mention_push"` SendFriendPostEmail bool `json:"send_friend_post_email"` SendFriendPostPush bool `json:"send_friend_post_push"` PushSubscriber bool `json:"subscribed_to_push"` SendNewFollowerPush bool `json:"send_new_follower_push"` SendNewFollowerEmail bool `json:"send_new_follower_email"` SendAnnouncementPush bool `json:"send_announcement_push"` SendAnnouncementEmail bool `json:"send_announcement_email"` SendRecommendationPush bool `json:"send_recommendation_push"` SendRecommendationEmail bool `json:"send_recommendation_email"` Email string `json:"email"` Role string `json:"rile"` Permissions PermissionInfo `json:"permissions"` Notification NotificationInfo `json:"notifications"` FirstTimeUser bool `json:"first_time_user"` Votes []Vote `json:"votes"` Posts []Post `json:"posts"` MakerOf []Post `json:"maker_of"` Followers []User `json:"followers"` Following []User `json:"followings"` }
func (UserSettings) Summary ¶
func (u UserSettings) Summary() string
Click to show internal directories.
Click to hide internal directories.