Versions in this module Expand all Collapse all v3 v3.0.2 Apr 30, 2022 Changes in this version type Media + RedditVideo RedditVideoPreview + type RedditVideoPreview struct + BitrateKbps int + DashURL string + Duration int + FallbackURL string + Height int + HlsURL string + IsGif bool + ScrubberMediaUrl string + TranscodingStatus string + Width int v3.0.1 Mar 27, 2022 v3.0.0 Mar 23, 2022 Changes in this version + func Bool(v bool) *bool + func CheckResponse(r *http.Response) error + func DoRequest(ctx context.Context, req *http.Request) (*http.Response, error) + func DoRequestWithClient(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) + func FromEnv(c *Client) error + func Int(v int) *int + func StreamDiscardInitial(c *streamConfig) + func String(v string) *string + func WithRawJSON(c *Client) error + type APIError struct + Field string + Label string + Reason string + func (e *APIError) Error() string + func (e *APIError) UnmarshalJSON(data []byte) error + type AccountService struct + func (s *AccountService) AddTrusted(ctx context.Context, username string) (*Response, error) + func (s *AccountService) Blocked(ctx context.Context) ([]Relationship, *Response, error) + func (s *AccountService) Friends(ctx context.Context) ([]Relationship, *Response, error) + func (s *AccountService) Info(ctx context.Context) (*User, *Response, error) + func (s *AccountService) Karma(ctx context.Context) ([]*SubredditKarma, *Response, error) + func (s *AccountService) Messaging(ctx context.Context) ([]Relationship, []Relationship, *Response, error) + func (s *AccountService) RemoveTrusted(ctx context.Context, username string) (*Response, error) + func (s *AccountService) Settings(ctx context.Context) (*Settings, *Response, error) + func (s *AccountService) Trophies(ctx context.Context) ([]*Trophy, *Response, error) + func (s *AccountService) Trusted(ctx context.Context) ([]Relationship, *Response, error) + func (s *AccountService) UpdateSettings(ctx context.Context, settings *Settings) (*Settings, *Response, error) + type Ban struct + DaysLeft *int + Note string + type BanConfig struct + Days *int + Message string + ModNote string + Reason string + type Blocked struct + Blocked string + BlockedID string + Created *Timestamp + type ButtonWidget struct + Buttons []*WidgetButton + Description string + Name string + func (w *ButtonWidget) GetID() string + type Client struct + Account *AccountService + BaseURL *url.URL + Collection *CollectionService + Comment *CommentService + Emoji *EmojiService + Flair *FlairService + Gold *GoldService + ID string + Listings *ListingsService + LiveThread *LiveThreadService + Message *MessageService + Moderation *ModerationService + Multi *MultiService + Password string + Post *PostService + Secret string + Stream *StreamService + Subreddit *SubredditService + TokenURL *url.URL + User *UserService + Username string + Widget *WidgetService + Wiki *WikiService + func DefaultClient() *Client + func NewClient(credentials Credentials, opts ...Opt) (*Client, error) + func NewReadonlyClient(opts ...Opt) (*Client, error) + func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error) + func (c *Client) NewJSONRequest(method string, path string, body interface{}) (*http.Request, error) + func (c *Client) NewRequest(method string, path string, form url.Values) (*http.Request, error) + func (c *Client) OnRequestCompleted(rc RequestCompletionCallback) + func (c *Client) UserAgent() string + type Collection struct + Author string + AuthorID string + Created *Timestamp + Description string + ID string + Layout string + Permalink string + PostIDs []string + PrimaryPostID string + SubredditID string + Title string + Updated *Timestamp + type CollectionCreateRequest struct + Description string + Layout string + SubredditID string + Title string + type CollectionService struct + func (s *CollectionService) AddPost(ctx context.Context, postID, collectionID string) (*Response, error) + func (s *CollectionService) Create(ctx context.Context, createRequest *CollectionCreateRequest) (*Collection, *Response, error) + func (s *CollectionService) Delete(ctx context.Context, id string) (*Response, error) + func (s *CollectionService) Follow(ctx context.Context, id string) (*Response, error) + func (s *CollectionService) FromSubreddit(ctx context.Context, id string) ([]*Collection, *Response, error) + func (s *CollectionService) Get(ctx context.Context, id string) (*Collection, *Response, error) + func (s *CollectionService) RemovePost(ctx context.Context, postID, collectionID string) (*Response, error) + func (s *CollectionService) ReorderPosts(ctx context.Context, collectionID string, postIDs ...string) (*Response, error) + func (s *CollectionService) Unfollow(ctx context.Context, id string) (*Response, error) + func (s *CollectionService) UpdateDescription(ctx context.Context, id string, description string) (*Response, error) + func (s *CollectionService) UpdateLayoutGallery(ctx context.Context, id string) (*Response, error) + func (s *CollectionService) UpdateLayoutTimeline(ctx context.Context, id string) (*Response, error) + func (s *CollectionService) UpdateTitle(ctx context.Context, id string, title string) (*Response, error) + type Comment struct + Author string + AuthorFlairID string + AuthorFlairText string + AuthorID string + Body string + CanGild bool + Controversiality int + Created *Timestamp + Edited *Timestamp + FullID string + ID string + IsSubmitter bool + Likes *bool + Locked bool + NSFW bool + ParentID string + Permalink string + PostAuthor string + PostID string + PostNumComments *int + PostPermalink string + PostTitle string + Replies Replies + Saved bool + Score int + ScoreHidden bool + Stickied bool + SubredditID string + SubredditName string + SubredditNamePrefixed string + func (c *Comment) HasMore() bool + type CommentService struct + func (s *CommentService) Edit(ctx context.Context, id string, text string) (*Comment, *Response, error) + func (s *CommentService) LoadMoreReplies(ctx context.Context, comment *Comment) (*Response, error) + func (s *CommentService) Submit(ctx context.Context, parentID string, text string) (*Comment, *Response, error) + func (s CommentService) Delete(ctx context.Context, id string) (*Response, error) + func (s CommentService) DisableReplies(ctx context.Context, id string) (*Response, error) + func (s CommentService) Downvote(ctx context.Context, id string) (*Response, error) + func (s CommentService) EnableReplies(ctx context.Context, id string) (*Response, error) + func (s CommentService) Lock(ctx context.Context, id string) (*Response, error) + func (s CommentService) RemoveVote(ctx context.Context, id string) (*Response, error) + func (s CommentService) Report(ctx context.Context, id string, reason string) (*Response, error) + func (s CommentService) Save(ctx context.Context, id string) (*Response, error) + func (s CommentService) Unlock(ctx context.Context, id string) (*Response, error) + func (s CommentService) Unsave(ctx context.Context, id string) (*Response, error) + func (s CommentService) Upvote(ctx context.Context, id string) (*Response, error) + type CommunityDetailsWidget struct + CurrentlyViewing int + CurrentlyViewingText string + Description string + Name string + Subscribers int + SubscribersText string + func (w *CommunityDetailsWidget) GetID() string + type CommunityListWidget struct + Communities []*WidgetCommunity + Name string + func (w *CommunityListWidget) GetID() string + type CommunityListWidgetCreateRequest struct + Communities []string + Name string + Style *WidgetStyle + func (r *CommunityListWidgetCreateRequest) MarshalJSON() ([]byte, error) + type Credentials struct + ID string + Password string + Secret string + Username string + type CustomWidget struct + Images []*WidgetImage + Name string + StyleSheet string + StyleSheetURL string + Text string + func (w *CustomWidget) GetID() string + type Emoji struct + CreatedBy string + ModFlairOnly bool + Name string + PostFlairAllowed bool + URL string + UserFlairAllowed bool + type EmojiCreateOrUpdateRequest struct + ModFlairOnly *bool + Name string + PostFlairAllowed *bool + UserFlairAllowed *bool + type EmojiService struct + func (s *EmojiService) Delete(ctx context.Context, subreddit string, emoji string) (*Response, error) + func (s *EmojiService) DisableCustomSize(ctx context.Context, subreddit string) (*Response, error) + func (s *EmojiService) Get(ctx context.Context, subreddit string) ([]*Emoji, []*Emoji, *Response, error) + func (s *EmojiService) SetSize(ctx context.Context, subreddit string, height, width int) (*Response, error) + func (s *EmojiService) Update(ctx context.Context, subreddit string, ...) (*Response, error) + func (s *EmojiService) Upload(ctx context.Context, subreddit string, ...) (*Response, error) + type ErrorResponse struct + Message string + Response *http.Response + func (r *ErrorResponse) Error() string + type Flair struct + BackgroundColor string + CSSClass string + Color string + Editable bool + ID string + ModOnly bool + Text string + Type string + type FlairChangeRequest struct + CSSClass string + Text string + User string + type FlairChangeResponse struct + Errors map[string]string + OK bool + Status string + Warnings map[string]string + type FlairChoice struct + CSSClass string + Editable bool + Position string + TemplateID string + Text string + type FlairConfigureRequest struct + PostFlairPosition string + PostFlairSelfAssignEnabled *bool + UserFlairEnabled *bool + UserFlairPosition string + UserFlairSelfAssignEnabled *bool + type FlairSelectRequest struct + ID string + Text string + type FlairService struct + func (s *FlairService) Assign(ctx context.Context, subreddit, user string, request *FlairSelectRequest) (*Response, error) + func (s *FlairService) Change(ctx context.Context, subreddit string, requests []FlairChangeRequest) ([]*FlairChangeResponse, *Response, error) + func (s *FlairService) Choices(ctx context.Context, subreddit string) ([]*FlairChoice, *FlairChoice, *Response, error) + func (s *FlairService) ChoicesForNewPost(ctx context.Context, subreddit string) ([]*FlairChoice, *Response, error) + func (s *FlairService) ChoicesForPost(ctx context.Context, postID string) ([]*FlairChoice, *FlairChoice, *Response, error) + func (s *FlairService) ChoicesOf(ctx context.Context, subreddit, username string) ([]*FlairChoice, *FlairChoice, *Response, error) + func (s *FlairService) Configure(ctx context.Context, subreddit string, request *FlairConfigureRequest) (*Response, error) + func (s *FlairService) Delete(ctx context.Context, subreddit, username string) (*Response, error) + func (s *FlairService) DeleteAllPostTemplates(ctx context.Context, subreddit string) (*Response, error) + func (s *FlairService) DeleteAllUserTemplates(ctx context.Context, subreddit string) (*Response, error) + func (s *FlairService) DeleteTemplate(ctx context.Context, subreddit, id string) (*Response, error) + func (s *FlairService) Disable(ctx context.Context, subreddit string) (*Response, error) + func (s *FlairService) Enable(ctx context.Context, subreddit string) (*Response, error) + func (s *FlairService) GetPostFlairs(ctx context.Context, subreddit string) ([]*Flair, *Response, error) + func (s *FlairService) GetUserFlairs(ctx context.Context, subreddit string) ([]*Flair, *Response, error) + func (s *FlairService) ListUserFlairs(ctx context.Context, subreddit string) ([]*FlairSummary, *Response, error) + func (s *FlairService) RemoveFromPost(ctx context.Context, postID string) (*Response, error) + func (s *FlairService) ReorderPostTemplates(ctx context.Context, subreddit string, ids []string) (*Response, error) + func (s *FlairService) ReorderUserTemplates(ctx context.Context, subreddit string, ids []string) (*Response, error) + func (s *FlairService) Select(ctx context.Context, subreddit string, request *FlairSelectRequest) (*Response, error) + func (s *FlairService) SelectForPost(ctx context.Context, postID string, request *FlairSelectRequest) (*Response, error) + func (s *FlairService) UpsertPostTemplate(ctx context.Context, subreddit string, ...) (*FlairTemplate, *Response, error) + func (s *FlairService) UpsertUserTemplate(ctx context.Context, subreddit string, ...) (*FlairTemplate, *Response, error) + type FlairSummary struct + CSSClass string + Text string + User string + type FlairTemplate struct + AllowableContent string + BackgroundColor string + CSSClass string + ID string + MaxEmojis int + ModOnly bool + OverrideCSS bool + RichText []map[string]string + Text string + TextColor string + TextEditable bool + TextType string + Type string + type FlairTemplateCreateOrUpdateRequest struct + AllowableContent string + BackgroundColor string + CSSClass string + ID string + MaxEmojis *int + ModOnly *bool + Text string + TextColor string + TextEditable *bool + type GalleryData struct + Items []GalleryMedia + type GalleryMedia struct + ID int64 + MediaID string + type GoldService struct + func (s *GoldService) Gild(ctx context.Context, id string) (*Response, error) + func (s *GoldService) Give(ctx context.Context, username string, months int) (*Response, error) + type ImageWidget struct + Images []*WidgetImageLink + Name string + func (w *ImageWidget) GetID() string + type JSONErrorResponse struct + JSON struct{ ... } + Response *http.Response + func (r *JSONErrorResponse) Error() string + type ListDuplicatePostOptions struct + CrosspostsOnly bool + Sort string + Subreddit string + type ListModActionOptions struct + Moderator string + Type string + type ListOptions struct + After string + Before string + Limit int + type ListPostOptions struct + Time string + type ListPostSearchOptions struct + Sort string + type ListSubredditOptions struct + Sort string + type ListUserOverviewOptions struct + Sort string + Time string + type ListingsService struct + func (s *ListingsService) Get(ctx context.Context, ids ...string) ([]*Post, []*Comment, []*Subreddit, *Response, error) + func (s *ListingsService) GetPosts(ctx context.Context, ids ...string) ([]*Post, *Response, error) + type LiveThread struct + Announcement bool + Created *Timestamp + Description string + FullID string + ID string + NSFW bool + Resources string + State string + Title string + ViewerCount int + ViewerCountFuzzed bool + WebSocketURL string + type LiveThreadContributor struct + ID string + Name string + Permissions []string + type LiveThreadContributors struct + Current []*LiveThreadContributor + Invited []*LiveThreadContributor + func (c *LiveThreadContributors) UnmarshalJSON(b []byte) error + type LiveThreadCreateOrUpdateRequest struct + Description string + NSFW *bool + Resources string + Title string + type LiveThreadPermissions struct + All bool + Close bool + Discussions bool + Edit bool + Manage bool + Settings bool + Update bool + func (p *LiveThreadPermissions) String() (s string) + type LiveThreadService struct + func (s *LiveThreadService) Accept(ctx context.Context, id string) (*Response, error) + func (s *LiveThreadService) Close(ctx context.Context, id string) (*Response, error) + func (s *LiveThreadService) Configure(ctx context.Context, id string, request *LiveThreadCreateOrUpdateRequest) (*Response, error) + func (s *LiveThreadService) Contributors(ctx context.Context, id string) (*LiveThreadContributors, *Response, error) + func (s *LiveThreadService) Create(ctx context.Context, request *LiveThreadCreateOrUpdateRequest) (string, *Response, error) + func (s *LiveThreadService) Delete(ctx context.Context, threadID, updateID string) (*Response, error) + func (s *LiveThreadService) Discussions(ctx context.Context, id string, opts *ListOptions) ([]*Post, *Response, error) + func (s *LiveThreadService) Get(ctx context.Context, id string) (*LiveThread, *Response, error) + func (s *LiveThreadService) GetMultiple(ctx context.Context, ids ...string) ([]*LiveThread, *Response, error) + func (s *LiveThreadService) HideDiscussion(ctx context.Context, threadID, postID string) (*Response, error) + func (s *LiveThreadService) Invite(ctx context.Context, id, username string, permissions *LiveThreadPermissions) (*Response, error) + func (s *LiveThreadService) Leave(ctx context.Context, id string) (*Response, error) + func (s *LiveThreadService) Now(ctx context.Context) (*LiveThread, *Response, error) + func (s *LiveThreadService) Report(ctx context.Context, id, reason string) (*Response, error) + func (s *LiveThreadService) Revoke(ctx context.Context, threadID, userID string) (*Response, error) + func (s *LiveThreadService) SetPermissions(ctx context.Context, id, username string, permissions *LiveThreadPermissions) (*Response, error) + func (s *LiveThreadService) SetPermissionsForInvite(ctx context.Context, id, username string, permissions *LiveThreadPermissions) (*Response, error) + func (s *LiveThreadService) Strike(ctx context.Context, threadID, updateID string) (*Response, error) + func (s *LiveThreadService) UnhideDiscussion(ctx context.Context, threadID, postID string) (*Response, error) + func (s *LiveThreadService) Uninvite(ctx context.Context, threadID, userID string) (*Response, error) + func (s *LiveThreadService) Update(ctx context.Context, id, text string) (*Response, error) + func (s *LiveThreadService) UpdateByID(ctx context.Context, threadID, updateID string) (*LiveThreadUpdate, *Response, error) + func (s *LiveThreadService) Updates(ctx context.Context, id string, opts *ListOptions) ([]*LiveThreadUpdate, *Response, error) + type LiveThreadUpdate struct + Author string + Body string + Created *Timestamp + EmbeddedURLs []string + FullID string + ID string + Stricken bool + func (u *LiveThreadUpdate) UnmarshalJSON(b []byte) error + type Media struct + OEmbed OEmbed + Type string + type MediaData struct + ID string + MIME string + O []MediaProperties + P []MediaProperties + S MediaProperties + Status string + Type string + type MediaMetadata map[string]MediaData + type MediaProperties struct + Height int64 + URL string + Width int64 + type MenuWidget struct + Links WidgetLinkList + ShowWiki bool + func (w *MenuWidget) GetID() string + type Message struct + Author string + Created *Timestamp + FullID string + ID string + IsComment bool + ParentID string + Subject string + Text string + To string + type MessageService struct + func (s *MessageService) Block(ctx context.Context, id string) (*Response, error) + func (s *MessageService) Collapse(ctx context.Context, ids ...string) (*Response, error) + func (s *MessageService) Delete(ctx context.Context, id string) (*Response, error) + func (s *MessageService) Inbox(ctx context.Context, opts *ListOptions) ([]*Message, []*Message, *Response, error) + func (s *MessageService) InboxUnread(ctx context.Context, opts *ListOptions) ([]*Message, []*Message, *Response, error) + func (s *MessageService) Read(ctx context.Context, ids ...string) (*Response, error) + func (s *MessageService) ReadAll(ctx context.Context) (*Response, error) + func (s *MessageService) Send(ctx context.Context, sendRequest *SendMessageRequest) (*Response, error) + func (s *MessageService) Sent(ctx context.Context, opts *ListOptions) ([]*Message, *Response, error) + func (s *MessageService) Uncollapse(ctx context.Context, ids ...string) (*Response, error) + func (s *MessageService) Unread(ctx context.Context, ids ...string) (*Response, error) + type ModAction struct + Action string + Created *Timestamp + ID string + Moderator string + ModeratorID string + Subreddit string + SubredditID string + TargetAuthor string + TargetBody string + TargetID string + TargetPermalink string + TargetTitle string + type ModPermissions struct + Access bool + All bool + ChatConfig bool + ChatOperator bool + Config bool + Flair bool + Mail bool + Posts bool + Wiki bool + func (p *ModPermissions) String() (s string) + type ModerationService struct + func (s *ModerationService) AcceptInvite(ctx context.Context, subreddit string) (*Response, error) + func (s *ModerationService) Actions(ctx context.Context, subreddit string, opts *ListModActionOptions) ([]*ModAction, *Response, error) + func (s *ModerationService) Approve(ctx context.Context, id string) (*Response, error) + func (s *ModerationService) ApproveUser(ctx context.Context, subreddit string, username string) (*Response, error) + func (s *ModerationService) ApproveUserWiki(ctx context.Context, subreddit string, username string) (*Response, error) + func (s *ModerationService) Ban(ctx context.Context, subreddit string, username string, config *BanConfig) (*Response, error) + func (s *ModerationService) BanWiki(ctx context.Context, subreddit string, username string, config *BanConfig) (*Response, error) + func (s *ModerationService) Distinguish(ctx context.Context, id string) (*Response, error) + func (s *ModerationService) DistinguishAndSticky(ctx context.Context, id string) (*Response, error) + func (s *ModerationService) Edited(ctx context.Context, subreddit string, opts *ListOptions) ([]*Post, []*Comment, *Response, error) + func (s *ModerationService) IgnoreReports(ctx context.Context, id string) (*Response, error) + func (s *ModerationService) Invite(ctx context.Context, subreddit string, username string, ...) (*Response, error) + func (s *ModerationService) Leave(ctx context.Context, subredditID string) (*Response, error) + func (s *ModerationService) LeaveContributor(ctx context.Context, subredditID string) (*Response, error) + func (s *ModerationService) Mute(ctx context.Context, subreddit string, username string) (*Response, error) + func (s *ModerationService) Queue(ctx context.Context, subreddit string, opts *ListOptions) ([]*Post, []*Comment, *Response, error) + func (s *ModerationService) Remove(ctx context.Context, id string) (*Response, error) + func (s *ModerationService) RemoveSpam(ctx context.Context, id string) (*Response, error) + func (s *ModerationService) Reported(ctx context.Context, subreddit string, opts *ListOptions) ([]*Post, []*Comment, *Response, error) + func (s *ModerationService) SetPermissions(ctx context.Context, subreddit string, username string, ...) (*Response, error) + func (s *ModerationService) Spam(ctx context.Context, subreddit string, opts *ListOptions) ([]*Post, []*Comment, *Response, error) + func (s *ModerationService) UnapproveUser(ctx context.Context, subreddit string, username string) (*Response, error) + func (s *ModerationService) UnapproveUserWiki(ctx context.Context, subreddit string, username string) (*Response, error) + func (s *ModerationService) Unban(ctx context.Context, subreddit string, username string) (*Response, error) + func (s *ModerationService) UnbanWiki(ctx context.Context, subreddit string, username string) (*Response, error) + func (s *ModerationService) Undistinguish(ctx context.Context, id string) (*Response, error) + func (s *ModerationService) UnignoreReports(ctx context.Context, id string) (*Response, error) + func (s *ModerationService) Uninvite(ctx context.Context, subreddit string, username string) (*Response, error) + func (s *ModerationService) Unmoderated(ctx context.Context, subreddit string, opts *ListOptions) ([]*Post, *Response, error) + func (s *ModerationService) Unmute(ctx context.Context, subreddit string, username string) (*Response, error) + type Moderator struct + Permissions []string + type ModeratorsWidget struct + Mods []string + Total int + func (w *ModeratorsWidget) GetID() string + func (w *ModeratorsWidget) UnmarshalJSON(data []byte) error + type More struct + Children []string + Count int + Depth int + FullID string + ID string + ParentID string + type Multi struct + CanEdit bool + CopiedFrom *string + Created *Timestamp + Description string + DisplayName string + Favorite bool + NSFW bool + Name string + NumberOfSubscribers int + Owner string + OwnerID string + Path string + Subreddits SubredditNames + Subscribed bool + Visibility string + type MultiCopyRequest struct + Description string + DisplayName string + FromPath string + ToPath string + type MultiCreateOrUpdateRequest struct + Description string + Name string + Subreddits SubredditNames + Visibility string + type MultiService struct + func (s *MultiService) AddSubreddit(ctx context.Context, multiPath string, subreddit string) (*Response, error) + func (s *MultiService) Copy(ctx context.Context, copyRequest *MultiCopyRequest) (*Multi, *Response, error) + func (s *MultiService) Create(ctx context.Context, createRequest *MultiCreateOrUpdateRequest) (*Multi, *Response, error) + func (s *MultiService) Delete(ctx context.Context, multiPath string) (*Response, error) + func (s *MultiService) DeleteSubreddit(ctx context.Context, multiPath string, subreddit string) (*Response, error) + func (s *MultiService) Description(ctx context.Context, multiPath string) (string, *Response, error) + func (s *MultiService) Get(ctx context.Context, multiPath string) (*Multi, *Response, error) + func (s *MultiService) Mine(ctx context.Context) ([]*Multi, *Response, error) + func (s *MultiService) Of(ctx context.Context, username string) ([]*Multi, *Response, error) + func (s *MultiService) Update(ctx context.Context, multiPath string, ...) (*Multi, *Response, error) + func (s *MultiService) UpdateDescription(ctx context.Context, multiPath string, description string) (string, *Response, error) + type OEmbed struct + Height int + ProviderName string + ProviderURL string + ThumbnailHeight int + ThumbnailURL string + ThumbnailWidth int + Title string + Version string + Width int + type Opt func(*Client) error + func WithBaseURL(u string) Opt + func WithHTTPClient(httpClient *http.Client) Opt + func WithTokenURL(u string) Opt + func WithUserAgent(ua string) Opt + type Post struct + Author string + AuthorID string + Body string + Created *Timestamp + Edited *Timestamp + FullID string + GalleryData GalleryData + ID string + IsSelfPost bool + Likes *bool + Locked bool + Media Media + MediaMetadata MediaMetadata + NSFW bool + NumberOfComments int + Permalink string + Saved bool + Score int + Spoiler bool + Stickied bool + SubredditID string + SubredditName string + SubredditNamePrefixed string + SubredditSubscribers int + Title string + URL string + UpvoteRatio float32 + type PostAndComments struct + Comments []*Comment + More *More + Post *Post + func (pc *PostAndComments) HasMore() bool + func (pc *PostAndComments) UnmarshalJSON(data []byte) error + type PostService struct + func (s *PostService) ClearSuggestedSort(ctx context.Context, id string) (*Response, error) + func (s *PostService) DisableContestMode(ctx context.Context, id string) (*Response, error) + func (s *PostService) Duplicates(ctx context.Context, id string, opts *ListDuplicatePostOptions) (*Post, []*Post, *Response, error) + func (s *PostService) Edit(ctx context.Context, id string, text string) (*Post, *Response, error) + func (s *PostService) EnableContestMode(ctx context.Context, id string) (*Response, error) + func (s *PostService) Get(ctx context.Context, id string) (*PostAndComments, *Response, error) + func (s *PostService) Hide(ctx context.Context, ids ...string) (*Response, error) + func (s *PostService) LoadMoreComments(ctx context.Context, pc *PostAndComments) (*Response, error) + func (s *PostService) MarkNSFW(ctx context.Context, id string) (*Response, error) + func (s *PostService) MarkVisited(ctx context.Context, ids ...string) (*Response, error) + func (s *PostService) PinToProfile(ctx context.Context, id string) (*Response, error) + func (s *PostService) Random(ctx context.Context) (*PostAndComments, *Response, error) + func (s *PostService) RandomFromSubreddits(ctx context.Context, subreddits ...string) (*PostAndComments, *Response, error) + func (s *PostService) RandomFromSubscriptions(ctx context.Context) (*PostAndComments, *Response, error) + func (s *PostService) SetSuggestedSortAMA(ctx context.Context, id string) (*Response, error) + func (s *PostService) SetSuggestedSortBest(ctx context.Context, id string) (*Response, error) + func (s *PostService) SetSuggestedSortControversial(ctx context.Context, id string) (*Response, error) + func (s *PostService) SetSuggestedSortLive(ctx context.Context, id string) (*Response, error) + func (s *PostService) SetSuggestedSortNew(ctx context.Context, id string) (*Response, error) + func (s *PostService) SetSuggestedSortOld(ctx context.Context, id string) (*Response, error) + func (s *PostService) SetSuggestedSortRandom(ctx context.Context, id string) (*Response, error) + func (s *PostService) SetSuggestedSortTop(ctx context.Context, id string) (*Response, error) + func (s *PostService) Spoiler(ctx context.Context, id string) (*Response, error) + func (s *PostService) Sticky(ctx context.Context, id string, bottom bool) (*Response, error) + func (s *PostService) SubmitLink(ctx context.Context, opts SubmitLinkRequest) (*Submitted, *Response, error) + func (s *PostService) SubmitText(ctx context.Context, opts SubmitTextRequest) (*Submitted, *Response, error) + func (s *PostService) Unhide(ctx context.Context, ids ...string) (*Response, error) + func (s *PostService) UnmarkNSFW(ctx context.Context, id string) (*Response, error) + func (s *PostService) UnpinFromProfile(ctx context.Context, id string) (*Response, error) + func (s *PostService) Unspoiler(ctx context.Context, id string) (*Response, error) + func (s *PostService) Unsticky(ctx context.Context, id string) (*Response, error) + func (s PostService) Delete(ctx context.Context, id string) (*Response, error) + func (s PostService) DisableReplies(ctx context.Context, id string) (*Response, error) + func (s PostService) Downvote(ctx context.Context, id string) (*Response, error) + func (s PostService) EnableReplies(ctx context.Context, id string) (*Response, error) + func (s PostService) Lock(ctx context.Context, id string) (*Response, error) + func (s PostService) RemoveVote(ctx context.Context, id string) (*Response, error) + func (s PostService) Report(ctx context.Context, id string, reason string) (*Response, error) + func (s PostService) Save(ctx context.Context, id string) (*Response, error) + func (s PostService) Unlock(ctx context.Context, id string) (*Response, error) + func (s PostService) Unsave(ctx context.Context, id string) (*Response, error) + func (s PostService) Upvote(ctx context.Context, id string) (*Response, error) + type Rate struct + Remaining int + Reset time.Time + Used int + type RateLimitError struct + Message string + Rate Rate + Response *http.Response + func (e *RateLimitError) Error() string + type Relationship struct + Created *Timestamp + ID string + User string + UserID string + type Replies struct + Comments []*Comment + More *More + func (r *Replies) MarshalJSON() ([]byte, error) + func (r *Replies) UnmarshalJSON(data []byte) error + type RequestCompletionCallback func(*http.Request, *http.Response) + type Response struct + After string + Rate Rate + type SendMessageRequest struct + FromSubreddit string + Subject string + Text string + To string + type Settings struct + AcceptPrivateMessages *string + ActivityRelevantAds *bool + AllowClickTracking *bool + AllowResearch *bool + AllowThirdPartyDataAdPersonalization *bool + AllowThirdPartySiteDataAdPersonalization *bool + AllowThirdPartySiteDataContentPersonalization *bool + AutoExpandMedia *string + Beta *bool + CollapseReadMessages *bool + Compress *bool + CredditAutorenew *bool + DarkMode *bool + DefaultCommentSort *string + DisableCustomThemes *bool + DisableProfanity *bool + EnableMentionNotifications *bool + EnableNotifications *bool + EnablePrivateRSSFeeds *bool + EnableThreadedMessages *bool + EnableThreadedModmail *bool + EnableVideoAutoplay *bool + HideAds *bool + HideDownvotedPosts *bool + HideFromSearchEngines *bool + HideUpvotedPosts *bool + HighlightControversialComments *bool + HighlightNewComments *bool + IgnoreSuggestedSorts *bool + IncludeNSFWSearchResults *bool + LabelNSFW *bool + Language *string + Location *string + MarkMessagesAsRead *bool + MinimumCommentScore *int + MinimumPostScore *int + NumberOfComments *int + NumberOfPosts *int + OpenLinksInNewWindow *bool + ProfileOptOut *bool + PublicizeVotes *bool + ReceiveCrosspostMessages *bool + ReceiveWelcomeMessages *bool + SendEmailDigests *bool + SendMessagesAsEmails *bool + ShowCustomSubredditThemes *bool + ShowDomainDetails *bool + ShowGoldExpiration *bool + ShowLocationBasedRecommendations *bool + ShowNSFW *bool + ShowOldSearchPage *bool + ShowPostFlair *bool + ShowPromote *bool + ShowRecentlyViewedPosts *bool + ShowSpotlightBox *bool + ShowThumbnails *string + ShowTrendingSubreddits *bool + ShowTwitter *bool + ShowUserFlair *bool + StoreVisits *bool + SubredditTheme *string + ThemeSelector *string + TopKarmaSubreddits *bool + UnsubscribeFromAllEmails *bool + UseGlobalDefaults *bool + UseNewReddit *bool + UsesNewReddit *bool + type StreamOpt func(*streamConfig) + func StreamInterval(v time.Duration) StreamOpt + func StreamMaxRequests(v int) StreamOpt + func StreamWithContext(ctx context.Context) StreamOpt + type StreamService struct + func (s *StreamService) Posts(subreddit string, opts ...StreamOpt) (<-chan *Post, <-chan error, func()) + type SubmitLinkRequest struct + FlairID string + FlairText string + NSFW bool + Resubmit bool + SendReplies *bool + Spoiler bool + Subreddit string + Title string + URL string + type SubmitTextRequest struct + FlairID string + FlairText string + NSFW bool + SendReplies *bool + Spoiler bool + Subreddit string + Text string + Title string + type Submitted struct + FullID string + ID string + URL string + type Subreddit struct + ActiveUserCount *int + Created *Timestamp + Description string + Favorite bool + FullID string + ID string + NSFW bool + Name string + NamePrefixed string + Subscribed bool + Subscribers int + SuggestedCommentSort string + Title string + Type string + URL string + UserIsMod bool + type SubredditImage struct + Link string + Name string + URL string + type SubredditKarma struct + CommentKarma int + PostKarma int + Subreddit string + type SubredditNames []string + func (n *SubredditNames) MarshalJSON() ([]byte, error) + func (n *SubredditNames) UnmarshalJSON(data []byte) error + type SubredditPostRequirements struct + BodyBlacklistedStrings []string + BodyMaxLength int + BodyMinLength int + BodyRegexes []string + BodyRequiredStrings []string + BodyRestrictionPolicy string + DomainBlacklist []string + DomainWhitelist []string + FlairRequired bool + GalleryCaptionsRequirement string + GalleryMaxItems int + GalleryMinItems int + GalleryURLsRequirement string + Guidelines string + GuidelinesDisplayPolicy string + LinkRepostAge int + LinkRestrictionPolicy string + TitleBlacklistedStrings []string + TitleMaxLength int + TitleMinLength int + TitleRegexes []string + TitleRequiredStrings []string + type SubredditRule struct + Created *Timestamp + Description string + Kind string + Name string + Priority int + ViolationReason string + type SubredditRuleCreateRequest struct + Description string + Kind string + Name string + ViolationReason string + type SubredditRulesWidget struct + Display string + Name string + Rules []string + func (w *SubredditRulesWidget) GetID() string + func (w *SubredditRulesWidget) UnmarshalJSON(data []byte) error + type SubredditService struct + func (s *SubredditService) Approved(ctx context.Context, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) + func (s *SubredditService) Banned(ctx context.Context, subreddit string, opts *ListOptions) ([]*Ban, *Response, error) + func (s *SubredditService) Contributors(ctx context.Context, subreddit string, opts *ListOptions) ([]*Relationship, *Response, error) + func (s *SubredditService) ControversialPosts(ctx context.Context, subreddit string, opts *ListPostOptions) ([]*Post, *Response, error) + func (s *SubredditService) Create(ctx context.Context, name string, request *SubredditSettings) (*Response, error) + func (s *SubredditService) CreateRule(ctx context.Context, subreddit string, request *SubredditRuleCreateRequest) (*Response, error) + func (s *SubredditService) Default(ctx context.Context, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) + func (s *SubredditService) Edit(ctx context.Context, subredditID string, request *SubredditSettings) (*Response, error) + func (s *SubredditService) Favorite(ctx context.Context, subreddit string) (*Response, error) + func (s *SubredditService) Get(ctx context.Context, name string) (*Subreddit, *Response, error) + func (s *SubredditService) GetSettings(ctx context.Context, subreddit string) (*SubredditSettings, *Response, error) + func (s *SubredditService) GetSticky1(ctx context.Context, subreddit string) (*PostAndComments, *Response, error) + func (s *SubredditService) GetSticky2(ctx context.Context, subreddit string) (*PostAndComments, *Response, error) + func (s *SubredditService) Gold(ctx context.Context, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) + func (s *SubredditService) HotPosts(ctx context.Context, subreddit string, opts *ListOptions) ([]*Post, *Response, error) + func (s *SubredditService) Moderated(ctx context.Context, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) + func (s *SubredditService) Moderators(ctx context.Context, subreddit string) ([]*Moderator, *Response, error) + func (s *SubredditService) Muted(ctx context.Context, subreddit string, opts *ListOptions) ([]*Relationship, *Response, error) + func (s *SubredditService) New(ctx context.Context, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) + func (s *SubredditService) NewPosts(ctx context.Context, subreddit string, opts *ListOptions) ([]*Post, *Response, error) + func (s *SubredditService) Popular(ctx context.Context, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) + func (s *SubredditService) PostRequirements(ctx context.Context, subreddit string) (*SubredditPostRequirements, *Response, error) + func (s *SubredditService) Random(ctx context.Context) (*Subreddit, *Response, error) + func (s *SubredditService) RandomNSFW(ctx context.Context) (*Subreddit, *Response, error) + func (s *SubredditService) RemoveHeader(ctx context.Context, subreddit string) (*Response, error) + func (s *SubredditService) RemoveImage(ctx context.Context, subreddit, imageName string) (*Response, error) + func (s *SubredditService) RemoveMobileHeader(ctx context.Context, subreddit string) (*Response, error) + func (s *SubredditService) RemoveMobileIcon(ctx context.Context, subreddit string) (*Response, error) + func (s *SubredditService) RisingPosts(ctx context.Context, subreddit string, opts *ListOptions) ([]*Post, *Response, error) + func (s *SubredditService) Rules(ctx context.Context, subreddit string) ([]*SubredditRule, *Response, error) + func (s *SubredditService) Search(ctx context.Context, query string, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) + func (s *SubredditService) SearchNames(ctx context.Context, query string) ([]string, *Response, error) + func (s *SubredditService) SearchPosts(ctx context.Context, query string, subreddit string, ...) ([]*Post, *Response, error) + func (s *SubredditService) StyleSheet(ctx context.Context, subreddit string) (*SubredditStyleSheet, *Response, error) + func (s *SubredditService) StyleSheetRaw(ctx context.Context, subreddit string) (string, *Response, error) + func (s *SubredditService) SubmissionText(ctx context.Context, name string) (string, *Response, error) + func (s *SubredditService) Subscribe(ctx context.Context, subreddits ...string) (*Response, error) + func (s *SubredditService) SubscribeByID(ctx context.Context, ids ...string) (*Response, error) + func (s *SubredditService) Subscribed(ctx context.Context, opts *ListSubredditOptions) ([]*Subreddit, *Response, error) + func (s *SubredditService) TopPosts(ctx context.Context, subreddit string, opts *ListPostOptions) ([]*Post, *Response, error) + func (s *SubredditService) Traffic(ctx context.Context, subreddit string) ([]*SubredditTrafficStats, []*SubredditTrafficStats, []*SubredditTrafficStats, ...) + func (s *SubredditService) Unfavorite(ctx context.Context, subreddit string) (*Response, error) + func (s *SubredditService) Unsubscribe(ctx context.Context, subreddits ...string) (*Response, error) + func (s *SubredditService) UnsubscribeByID(ctx context.Context, ids ...string) (*Response, error) + func (s *SubredditService) UpdateStyleSheet(ctx context.Context, subreddit, styleSheet, reason string) (*Response, error) + func (s *SubredditService) UploadHeader(ctx context.Context, subreddit, imagePath, imageName string) (string, *Response, error) + func (s *SubredditService) UploadImage(ctx context.Context, subreddit, imagePath, imageName string) (string, *Response, error) + func (s *SubredditService) UploadMobileHeader(ctx context.Context, subreddit, imagePath, imageName string) (string, *Response, error) + func (s *SubredditService) UploadMobileIcon(ctx context.Context, subreddit, imagePath, imageName string) (string, *Response, error) + func (s *SubredditService) WikiBanned(ctx context.Context, subreddit string, opts *ListOptions) ([]*Ban, *Response, error) + func (s *SubredditService) WikiContributors(ctx context.Context, subreddit string, opts *ListOptions) ([]*Relationship, *Response, error) + type SubredditSettings struct + AllOriginalContent *bool + AllowChatPosts *bool + AllowCrossposts *bool + AllowDiscoveryByIndividualUsers *bool + AllowDiscoveryInHighTrafficFeeds *bool + AllowFreeFormReports *bool + AllowImages *bool + AllowMultipleImagesPerPost *bool + AllowOriginalContent *bool + AllowPollPosts *bool + CollapseDeletedComments *bool + CrowdControlChalLevel *int + Description *string + ExcludeSitewideBannedUsersContent *bool + ExpandMediaPreviewsOnCommentsPages *bool + HeaderMouseoverText *string + HideAds *bool + ID string + Language *string + MinutesToHideCommentScores *int + MobileColour *string + NSFW *bool + PostType *string + ShowContentThumbnails *bool + Sidebar *string + SpamFilterStrengthComments *string + SpamFilterStrengthLinkPosts *string + SpamFilterStrengthTextPosts *string + SpoilersEnabled *bool + SubmissionText *string + SubmitLinkPostLabel *string + SubmitTextPostLabel *string + SuggestedCommentSort *string + Title *string + Type *string + WelcomeMessage *string + WelcomeMessageEnabled *bool + WikiMinimumAccountAge *int + WikiMinimumKarma *int + WikiMode *string + type SubredditStyleSheet struct + Images []*SubredditImage + StyleSheet string + SubredditID string + type SubredditTrafficStats struct + Start *Timestamp + Subscribers int + TotalViews int + UniqueViews int + func (s *SubredditTrafficStats) UnmarshalJSON(b []byte) error + type TextAreaWidget struct + Name string + Text string + func (w *TextAreaWidget) GetID() string + type TextAreaWidgetCreateRequest struct + Name string + Style *WidgetStyle + Text string + func (r *TextAreaWidgetCreateRequest) MarshalJSON() ([]byte, error) + type Timestamp struct + func (t *Timestamp) MarshalJSON() ([]byte, error) + func (t *Timestamp) UnmarshalJSON(data []byte) (err error) + func (t Timestamp) Equal(u Timestamp) bool + type Trophy struct + Description string + ID string + Name string + type User struct + CommentKarma int + Created *Timestamp + HasVerifiedEmail bool + ID string + IsEmployee bool + IsFriend bool + IsSuspended bool + NSFW bool + Name string + PostKarma int + type UserService struct + func (s *UserService) Block(ctx context.Context, username string) (*Blocked, *Response, error) + func (s *UserService) BlockByID(ctx context.Context, id string) (*Blocked, *Response, error) + func (s *UserService) Comments(ctx context.Context, opts *ListUserOverviewOptions) ([]*Comment, *Response, error) + func (s *UserService) CommentsOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Comment, *Response, error) + func (s *UserService) Downvoted(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, *Response, error) + func (s *UserService) DownvotedOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, *Response, error) + func (s *UserService) Friend(ctx context.Context, username string) (*Relationship, *Response, error) + func (s *UserService) Get(ctx context.Context, username string) (*User, *Response, error) + func (s *UserService) GetFriendship(ctx context.Context, username string) (*Relationship, *Response, error) + func (s *UserService) GetMultipleByID(ctx context.Context, ids ...string) (map[string]*UserSummary, *Response, error) + func (s *UserService) Gilded(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, *Response, error) + func (s *UserService) Hidden(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, *Response, error) + func (s *UserService) New(ctx context.Context, opts *ListUserOverviewOptions) ([]*Subreddit, *Response, error) + func (s *UserService) Overview(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, []*Comment, *Response, error) + func (s *UserService) OverviewOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, []*Comment, *Response, error) + func (s *UserService) Popular(ctx context.Context, opts *ListOptions) ([]*Subreddit, *Response, error) + func (s *UserService) Posts(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, *Response, error) + func (s *UserService) PostsOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, *Response, error) + func (s *UserService) Saved(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, []*Comment, *Response, error) + func (s *UserService) Search(ctx context.Context, query string, opts *ListOptions) ([]*User, *Response, error) + func (s *UserService) Trophies(ctx context.Context) ([]*Trophy, *Response, error) + func (s *UserService) TrophiesOf(ctx context.Context, username string) ([]*Trophy, *Response, error) + func (s *UserService) Unblock(ctx context.Context, username string) (*Response, error) + func (s *UserService) UnblockByID(ctx context.Context, id string) (*Response, error) + func (s *UserService) Unfriend(ctx context.Context, username string) (*Response, error) + func (s *UserService) Upvoted(ctx context.Context, opts *ListUserOverviewOptions) ([]*Post, *Response, error) + func (s *UserService) UpvotedOf(ctx context.Context, username string, opts *ListUserOverviewOptions) ([]*Post, *Response, error) + func (s *UserService) UsernameAvailable(ctx context.Context, username string) (bool, *Response, error) + type UserSummary struct + CommentKarma int + Created *Timestamp + NSFW bool + Name string + PostKarma int + type Widget interface + GetID func() string + type WidgetButton struct + FillColor string + HoverState *WidgetButtonHoverState + StrokeColor string + Text string + TextColor string + URL string + type WidgetButtonHoverState struct + FillColor string + StrokeColor string + Text string + TextColor string + type WidgetCommunity struct + NSFW bool + Name string + Subscribed bool + Subscribers int + type WidgetCreateRequest interface + type WidgetImage struct + Name string + URL string + type WidgetImageLink struct + LinkURL string + URL string + type WidgetLink interface + type WidgetLinkList []WidgetLink + func (l *WidgetLinkList) UnmarshalJSON(data []byte) error + type WidgetLinkMultiple struct + Text string + URLs []*WidgetLinkSingle + type WidgetLinkSingle struct + Text string + URL string + type WidgetList []Widget + func (l *WidgetList) UnmarshalJSON(data []byte) error + type WidgetService struct + func (s *WidgetService) Create(ctx context.Context, subreddit string, request WidgetCreateRequest) (Widget, *Response, error) + func (s *WidgetService) Delete(ctx context.Context, subreddit, id string) (*Response, error) + func (s *WidgetService) Get(ctx context.Context, subreddit string) ([]Widget, *Response, error) + func (s *WidgetService) Reorder(ctx context.Context, subreddit string, ids []string) (*Response, error) + type WidgetStyle struct + BackgroundColor string + HeaderColor string + type WikiPage struct + Content string + MayRevise bool + Reason string + RevisionBy *User + RevisionDate *Timestamp + RevisionID string + func (p *WikiPage) UnmarshalJSON(b []byte) error + type WikiPageEditRequest struct + Content string + Page string + Reason string + Subreddit string + type WikiPagePermissionLevel int + const PermissionApprovedContributorsOnly + const PermissionModeratorsOnly + const PermissionSubredditWikiPermissions + type WikiPageRevision struct + Author *User + Created *Timestamp + Hidden bool + ID string + Page string + Reason string + func (r *WikiPageRevision) UnmarshalJSON(b []byte) error + type WikiPageSettings struct + Editors []*User + Listed bool + PermissionLevel WikiPagePermissionLevel + func (s *WikiPageSettings) UnmarshalJSON(b []byte) error + type WikiPageSettingsUpdateRequest struct + Listed *bool + PermissionLevel WikiPagePermissionLevel + type WikiService struct + func (s *WikiService) Allow(ctx context.Context, subreddit, page, username string) (*Response, error) + func (s *WikiService) Deny(ctx context.Context, subreddit, page, username string) (*Response, error) + func (s *WikiService) Discussions(ctx context.Context, subreddit, page string, opts *ListOptions) ([]*Post, *Response, error) + func (s *WikiService) Edit(ctx context.Context, editRequest *WikiPageEditRequest) (*Response, error) + func (s *WikiService) Page(ctx context.Context, subreddit, page string) (*WikiPage, *Response, error) + func (s *WikiService) PageRevision(ctx context.Context, subreddit, page, revisionID string) (*WikiPage, *Response, error) + func (s *WikiService) Pages(ctx context.Context, subreddit string) ([]string, *Response, error) + func (s *WikiService) Revert(ctx context.Context, subreddit, page, revisionID string) (*Response, error) + func (s *WikiService) Revisions(ctx context.Context, subreddit string, opts *ListOptions) ([]*WikiPageRevision, *Response, error) + func (s *WikiService) RevisionsPage(ctx context.Context, subreddit, page string, opts *ListOptions) ([]*WikiPageRevision, *Response, error) + func (s *WikiService) Settings(ctx context.Context, subreddit, page string) (*WikiPageSettings, *Response, error) + func (s *WikiService) ToggleVisibility(ctx context.Context, subreddit, page, revisionID string) (bool, *Response, error) + func (s *WikiService) UpdateSettings(ctx context.Context, subreddit, page string, ...) (*WikiPageSettings, *Response, error)