Documentation
¶
Overview ¶
Package gisqus is a thin wrapper over the Disqus API
Index ¶
- Constants
- func ExtractForumID(forumString string) string
- func ToDisqusTime(date time.Time) string
- func ToDisqusTimeExact(date time.Time) string
- type ActiveForumsResponse
- type ActivitiesListResponse
- type ActivityResponseFragment
- type CategoriesListResponse
- type Category
- type ChannelCoverImage
- type ChannelOptions
- type ChannelTitleLogo
- type DisqusCursor
- type DisqusPermissions
- type DisqusRateLimit
- type Filter
- type Forum
- type ForumAvatar
- type ForumChannel
- type ForumDetailsResponse
- type ForumSettings
- type ForumUserListResponse
- type ForumsURLS
- type Gisqus
- func (gisqus *Gisqus) ForumCategories(ctx context.Context, forumID string, values url.Values) (*CategoriesListResponse, error)
- func (gisqus *Gisqus) ForumDetails(ctx context.Context, forumID string, values url.Values) (*ForumDetailsResponse, error)
- func (gisqus *Gisqus) ForumFollowers(ctx context.Context, forumID string, values url.Values) (*ForumUserListResponse, error)
- func (gisqus *Gisqus) ForumInteresting(ctx context.Context, values url.Values) (*InterestingForumsResponse, error)
- func (gisqus *Gisqus) ForumMostActiveUsers(ctx context.Context, forumID string, values url.Values) (*ForumUserListResponse, error)
- func (gisqus *Gisqus) ForumMostLikedUsers(ctx context.Context, forumID string, values url.Values) (*MostLikedUsersResponse, error)
- func (gisqus *Gisqus) ForumThreads(ctx context.Context, forumID string, values url.Values) (*ThreadListResponse, error)
- func (gisqus *Gisqus) ForumUsers(ctx context.Context, forumID string, values url.Values) (*ForumUserListResponse, error)
- func (g *Gisqus) Limits() DisqusRateLimit
- func (gisqus *Gisqus) PostDetails(ctx context.Context, postID string, values url.Values) (*PostDetailsResponse, error)
- func (gisqus *Gisqus) PostList(ctx context.Context, values url.Values) (*PostListResponse, error)
- func (gisqus *Gisqus) PostPopular(ctx context.Context, values url.Values) (*PostListResponseNoCursor, error)
- func (g *Gisqus) ReadForumsURLs() ForumsURLS
- func (g *Gisqus) ReadPostURLs() PostsURLS
- func (g *Gisqus) ReadThreadsURLs() ThreadsURLS
- func (g *Gisqus) ReadUsersURLs() UsersURLS
- func (g *Gisqus) SetForumsURLs(fu ForumsURLS)
- func (g *Gisqus) SetPostsURLs(pu PostsURLS)
- func (g *Gisqus) SetThreadsURLs(tu ThreadsURLS)
- func (g *Gisqus) SetUsersURLs(uu UsersURLS)
- func (gisqus *Gisqus) ThreadDetails(ctx context.Context, threadID string, values url.Values) (*ThreadDetailResponse, error)
- func (gisqus *Gisqus) ThreadHot(ctx context.Context, values url.Values) (*ThreadListResponseNoCursor, error)
- func (gisqus *Gisqus) ThreadList(ctx context.Context, values url.Values) (*ThreadListResponse, error)
- func (gisqus *Gisqus) ThreadPopular(ctx context.Context, values url.Values) (*ThreadListResponseNoCursor, error)
- func (gisqus *Gisqus) ThreadPosts(ctx context.Context, threadID string, values url.Values) (*PostListResponse, error)
- func (gisqus *Gisqus) ThreadSet(ctx context.Context, threadsIDs []string, values url.Values) (*ThreadListResponseNoCursor, error)
- func (gisqus *Gisqus) ThreadTrending(ctx context.Context, values url.Values) (*ThreadTrendingResponse, error)
- func (gisqus *Gisqus) ThreadUsersVoted(ctx context.Context, threadD string, values url.Values) (*UsersVotedResponse, error)
- func (gisqus *Gisqus) UserActiveForums(ctx context.Context, userID string, values url.Values) (*ActiveForumsResponse, error)
- func (gisqus *Gisqus) UserActivities(ctx context.Context, userID string, values url.Values) (*ActivitiesListResponse, error)
- func (gisqus *Gisqus) UserDetails(ctx context.Context, userID string, values url.Values) (*UserDetailsResponse, error)
- func (gisqus *Gisqus) UserFollowers(ctx context.Context, userID string, values url.Values) (*UserListResponse, error)
- func (gisqus *Gisqus) UserFollowing(ctx context.Context, userID string, values url.Values) (*UserListResponse, error)
- func (gisqus *Gisqus) UserForumFollowing(ctx context.Context, userID string, values url.Values) (*UserForumFollowingResponse, error)
- func (gisqus *Gisqus) UserInteresting(ctx context.Context, values url.Values) (*InterestingUsersResponse, error)
- func (gisqus *Gisqus) UserMostActiveForums(ctx context.Context, userID string, values url.Values) (*MostActiveForumsResponse, error)
- func (gisqus *Gisqus) UserPosts(ctx context.Context, userID string, values url.Values) (*PostListResponse, error)
- type Icon
- type Include
- type InterestingForums
- type InterestingForumsResponse
- type InterestingItem
- type InterestingUsers
- type InterestingUsersResponse
- type Interval
- type MostActiveForumsResponse
- type MostLikedUsersResponse
- type Order
- type Post
- type PostAuthor
- type PostDetailsResponse
- type PostListResponse
- type PostListResponseNoCursor
- type PostMedia
- type PostsURLS
- type RawPost
- type ResponseStub
- type ResponseStubWithCursor
- type Sort
- type Thread
- type ThreadDetail
- type ThreadDetailResponse
- type ThreadListResponse
- type ThreadListResponseNoCursor
- type ThreadTrendingResponse
- type ThreadsURLS
- type Trend
- type User
- type UserAvatar
- type UserDetailsResponse
- type UserForumFollowingResponse
- type UserListResponse
- type UsersURLS
- type UsersVotedResponse
Constants ¶
const DisqusDateFormat = "2006-01-02T15:04:05"
DisqusDateFormat is a constant used to export dates in a format accepted by Disqus
const DisqusDateFormatExact = "2006-01-02T15:04:05.000000"
DisqusDateFormatExact is a constant used to export dates in a format accepted by Disqus
Variables ¶
This section is empty.
Functions ¶
func ExtractForumID ¶
ExtractForumID extracts the forum ID from the keys of the map returned by the interesting forum call
func ToDisqusTime ¶
ToDisqusTime returns a string that can be used in Disqus call for timedate parameters
func ToDisqusTimeExact ¶
ToDisqusTimeExact returns a string in the format of the ForumDetails CreatedAt field.
Types ¶
type ActiveForumsResponse ¶
type ActiveForumsResponse struct { ResponseStubWithCursor Response []*Forum `json:"response"` }
ActiveForumsResponse models the response of the active forums user endpoint.
type ActivitiesListResponse ¶
type ActivitiesListResponse struct { ResponseStubWithCursor Posts []*Post `json:"response"` }
ActivitiesListResponse models the response of the user activity list endpoint
type ActivityResponseFragment ¶
type ActivityResponseFragment struct { FragmentType string `json:"type"` FragmentData json.RawMessage `json:"object"` }
ActivityResponseFragment is exported because of the json parser
type CategoriesListResponse ¶
type CategoriesListResponse struct { ResponseStubWithCursor Response []*Category `json:"response"` }
CategoriesListResponse models the category list in forum endpoint
type Category ¶
type Category struct { IsDefault bool `json:"isDefault"` Title string `json:"title"` Order int `json:"order"` Forum string `json:"forum"` ID string `json:"id"` }
Category models the category field in forums
type ChannelCoverImage ¶
type ChannelCoverImage struct {
Cache string
}
ChannelCoverImage models the fields of the coverImage field in a channel option
type ChannelOptions ¶
type ChannelOptions struct { AboutURLPath string `json:"aboutUrlPath"` Description string `json:"description"` Coverimage *ChannelCoverImage `json:"coverImage"` BannerTimestamp time.Time `json:"bannerTimestamp"` ModEmail string `json:"modEmail"` AlertBackground string `json:"alertBackground"` Favicon string `json:"favicon"` Title string `json:"title"` IsCurationChannel bool `json:"isCurationChannel"` TitleLogo *ChannelTitleLogo `json:"titleLogo"` BannerColor string `json:"bannerColor"` }
ChannelOptions models the fields of the options field in a channel
type ChannelTitleLogo ¶
ChannelTitleLogo models the fields of the titleLogo field in a channel option
type DisqusCursor ¶
type DisqusCursor struct { Prev string `json:"prev"` HasNext bool `json:"hasNext"` Next string `json:"next"` HasPrev bool `json:"hasPrev"` Total int `json:"total"` ID string `json:"id"` More bool `json:"more"` }
DisqusCursor models the cursor used by Disqus for pagination
type DisqusPermissions ¶
type DisqusPermissions struct { }
DisqusPermissions models the fields of the forum permissions field in a Forum
type DisqusRateLimit ¶
DisqusRateLimit models the rate limits for an user account
type Filter ¶
type Filter int
Filter represents the possible values for filter in calls to Disqus'API
type Forum ¶
type Forum struct { RawGuidelines string `json:"raw_guidelines"` TwitterName string `json:"twitterName"` Guidelines string `json:"guidelines"` Favicon *Icon `json:"favicon"` DisableDisqusBranding bool `json:"disableDisqusBranding"` ID string `json:"id"` CreatedAt time.Time `json:"-"` DisqusTimeCreatedAt string `json:"createdAt"` Category string `json:"category"` Founder string `json:"founder"` DaysAlive int `json:"daysAlive"` InstallCompleted bool `json:"installCompleted"` Pk string `json:"pk"` Channel *ForumChannel `json:"channel"` Description string `json:"description"` RawDescription string `json:"raw_description"` AdsReviewStatus int `json:"adsReviewStatus"` Permissions *DisqusPermissions `json:"permissions"` Name string `json:"name"` Language string `json:"language"` Settings *ForumSettings `json:"settings"` OrganizationID int `json:"organizationId"` DaysThreadAlive int `json:"daysThreadAlive"` Avatar *ForumAvatar `json:"avatar"` SignedURL string `json:"signedUrl"` }
Forum models the fields of a forum, as returned by Disqus' API
type ForumAvatar ¶
ForumAvatar models the fields of the forum avatar field in a forum
type ForumChannel ¶
type ForumChannel struct { BannerColor string `json:"bannerColor"` Slug string `json:"slug"` DateAdded time.Time `json:"-"` DisqusDateAdded string `json:"dateAdded"` Name string `json:"name"` Banner string `json:"banner"` BannerColorHex string `json:"bannerColorHex"` ID string `json:"id"` Hidden bool `json:"hidden"` IsAggregation bool `json:"isAggregation"` Avatar string `json:"avatar"` EnableCuration bool `json:"enableCuration"` IsCategory bool `json:"isCategory"` AdminOnly bool `json:"adminOnly"` Options *ChannelOptions `json:"options"` OwnerID string `json:"ownerId"` }
ForumChannel models the fields of the forum channel field in a forum
type ForumDetailsResponse ¶
type ForumDetailsResponse struct { ResponseStub Response *Forum `json:"response"` }
ForumDetailsResponse modeles the response to a call to Disqus' Forum details endpoint (https://disqus.com/api/docs/forums/details/)
type ForumSettings ¶
type ForumSettings struct { SupportLevel int `json:"supportLevel"` AdsDRNativeEnabled bool `json:"adsDRNativeEnabled"` Disable3rdPartyTrackers bool `json:"disable3rdPartyTrackers"` AdsVideoEnabled bool `json:"adsVideoEnabled"` AdsProductVideoEnabled bool `json:"adsProductVideoEnabled"` AdsPositionTopEnabled bool `json:"adsPositionTopEnabled"` AudienceSyncEnabled bool `json:"audienceSyncEnabled"` UnapproveLinks bool `json:"unapproveLinks"` AdsEnabled bool `json:"adsEnabled"` AdsProductLinksThumbnailsEnabled bool `json:"adsProductLinksThumbnailsEnabled"` AdsProductStoriesEnabled bool `json:"adsProductStoriesEnabled"` OrganicDiscoveryEnabled bool `json:"organicDiscoveryEnabled"` AdsProductDisplayEnabled bool `json:"adsProductDisplayEnabled"` DiscoveryLocked bool `json:"discoveryLocked"` HasCustomAvatar bool `json:"hasCustomAvatar"` LinkAffiliationEnabled bool `json:"linkAffiliationEnabled"` AllowAnonPost bool `json:"allowAnonPost"` AllowMedia bool `json:"allowMedia"` AdultContent bool `json:"adultContent"` AllowAnonVotes bool `json:"allowAnonVotes"` MustVerify bool `json:"mustVerify"` MustVerifyEmail bool `json:"mustVerifyEmail"` SsoRequired bool `json:"ssoRequired"` MediaembedEnabled bool `json:"mediaembedEnabled"` AdsPositionBottomEnabled bool `json:"adsPositionBottomEnabled"` AdsProductLinksEnabled bool `json:"adsProductLinksEnabled"` ValidateAllPosts bool `json:"validateAllPosts"` AdsSettingsLocked bool `json:"adsSettingsLocked"` IsVIP bool `json:"isVIP"` AdsPositionInthreadEnabled bool `json:"AdsPositionInthreadEnabled"` }
ForumSettings models the fields of the forum settings field in a Forum
type ForumUserListResponse ¶
type ForumUserListResponse struct { ResponseStubWithCursor Response []*User `json:"response"` }
ForumUserListResponse models the response of the user list in forum endpoint
type ForumsURLS ¶
type ForumsURLS struct { InterestingForumsURL string DetailsURL string CategoriesURL string ListUsersURL string ListThreadsURL string MostLikedUsersURL string ListFollowersURL string MostActiveUsersURL string }
ForumsURLS contains the URLs of the API calls for forums on Disqus
type Gisqus ¶
type Gisqus struct {
// contains filtered or unexported fields
}
Gisqus is lib's entry point
func (*Gisqus) ForumCategories ¶
func (gisqus *Gisqus) ForumCategories(ctx context.Context, forumID string, values url.Values) (*CategoriesListResponse, error)
ForumCategories wraps https://disqus.com/api/docs/forums/listCategories/ (https://disqus.com/api/3.0/forums/listCategories.json)
func (*Gisqus) ForumDetails ¶
func (gisqus *Gisqus) ForumDetails(ctx context.Context, forumID string, values url.Values) (*ForumDetailsResponse, error)
ForumDetails wraps https://disqus.com/api/docs/forums/details/ (https://disqus.com/api/3.0/forums/details.json) It does not support the "related" url parameter (other funcs can be used for drilldown)
func (*Gisqus) ForumFollowers ¶
func (gisqus *Gisqus) ForumFollowers(ctx context.Context, forumID string, values url.Values) (*ForumUserListResponse, error)
ForumFollowers wraps https://disqus.com/api/docs/forums/listFollowers/ (https://disqus.com/api/3.0/forums/listFollowers.json)
func (*Gisqus) ForumInteresting ¶
func (gisqus *Gisqus) ForumInteresting(ctx context.Context, values url.Values) (*InterestingForumsResponse, error)
ForumInteresting wraps https://disqus.com/api/docs/forums/interestingForums/ (https://disqus.com/api/3.0/forums/interestingForums.json)
func (*Gisqus) ForumMostActiveUsers ¶
func (gisqus *Gisqus) ForumMostActiveUsers(ctx context.Context, forumID string, values url.Values) (*ForumUserListResponse, error)
ForumMostActiveUsers wraps https://disqus.com/api/docs/forums/listMostActiveUsers/ (https://disqus.com/api/3.0/forums/listMostActiveUsers.json)
func (*Gisqus) ForumMostLikedUsers ¶
func (gisqus *Gisqus) ForumMostLikedUsers(ctx context.Context, forumID string, values url.Values) (*MostLikedUsersResponse, error)
ForumMostLikedUsers wraps https://disqus.com/api/docs/forums/listMostLikedUsers/ (https://disqus.com/api/3.0/forums/listMostLikedUsers.json) Disqus does not return the # of likes with this call.
func (*Gisqus) ForumThreads ¶
func (gisqus *Gisqus) ForumThreads(ctx context.Context, forumID string, values url.Values) (*ThreadListResponse, error)
ForumThreads wraps https://disqus.com/api/docs/forums/listThreads/ (https://disqus.com/api/3.0/forums/listThreads.json)
func (*Gisqus) ForumUsers ¶
func (gisqus *Gisqus) ForumUsers(ctx context.Context, forumID string, values url.Values) (*ForumUserListResponse, error)
ForumUsers wraps https://disqus.com/api/3.0/forums/listUsers.json (https://disqus.com/api/docs/forums/listUsers/)
func (*Gisqus) Limits ¶
func (g *Gisqus) Limits() DisqusRateLimit
Limits return the current rate limits for the user account
func (*Gisqus) PostDetails ¶
func (gisqus *Gisqus) PostDetails(ctx context.Context, postID string, values url.Values) (*PostDetailsResponse, error)
PostDetails wraps https://disqus.com/api/docs/posts/details/ (https://disqus.com/api/3.0/posts/details.json) It does not support the "related" argument.
func (*Gisqus) PostList ¶
PostList wraps https://disqus.com/api/docs/posts/list/ (https://disqus.com/api/3.0/posts/list.json)
func (*Gisqus) PostPopular ¶
func (gisqus *Gisqus) PostPopular(ctx context.Context, values url.Values) (*PostListResponseNoCursor, error)
PostPopular wraps https://disqus.com/api/docs/posts/listPopular/ (https://disqus.com/api/3.0/posts/listPopular.json)
func (*Gisqus) ReadForumsURLs ¶
func (g *Gisqus) ReadForumsURLs() ForumsURLS
ReadForumsURLs returns all the URLs used by Gisqus to call forum endpoints.
func (*Gisqus) ReadPostURLs ¶
ReadPostURLs returns all the URLs used by Gisqus to call post endpoints
func (*Gisqus) ReadThreadsURLs ¶
func (g *Gisqus) ReadThreadsURLs() ThreadsURLS
ReadThreadsURLs returns all the URLs used by Gisqus to call thread endpoints
func (*Gisqus) ReadUsersURLs ¶
ReadUsersURLs returns all the URLs used by Gisqus to call user endpoints
func (*Gisqus) SetForumsURLs ¶
func (g *Gisqus) SetForumsURLs(fu ForumsURLS)
SetForumsURLs changes the URLs used by Gisqus to call forum endpoints
func (*Gisqus) SetPostsURLs ¶
SetPostsURLs changes the URLs used by Gisqus to call post endpoints
func (*Gisqus) SetThreadsURLs ¶
func (g *Gisqus) SetThreadsURLs(tu ThreadsURLS)
SetThreadsURLs changes the URLs used by Gisqus to call thread endpoints
func (*Gisqus) SetUsersURLs ¶
SetUsersURLs changes the URLS used by Gisqus to call user endpoints.
func (*Gisqus) ThreadDetails ¶
func (gisqus *Gisqus) ThreadDetails(ctx context.Context, threadID string, values url.Values) (*ThreadDetailResponse, error)
ThreadDetails wraps https://disqus.com/api/docs/threads/details/ (https://disqus.com/api/3.0/threads/details.json) It does not support the "related" argument (related fields can be gotten with calls to their respective APIS)
func (*Gisqus) ThreadHot ¶
func (gisqus *Gisqus) ThreadHot(ctx context.Context, values url.Values) (*ThreadListResponseNoCursor, error)
ThreadHot wraps https://disqus.com/api/docs/threads/listHot/ (https://disqus.com/api/3.0/threads/listHot.json) It does not support the "related" argument (related fields can be gotten with calls to their respective APIS)
func (*Gisqus) ThreadList ¶
func (gisqus *Gisqus) ThreadList(ctx context.Context, values url.Values) (*ThreadListResponse, error)
ThreadList wraps https://disqus.com/api/docs/threads/list/ (https://disqus.com/api/3.0/threads/list.json) It does not support the "related" argument (related fields can be gotten with calls to their respective APIS)
func (*Gisqus) ThreadPopular ¶
func (gisqus *Gisqus) ThreadPopular(ctx context.Context, values url.Values) (*ThreadListResponseNoCursor, error)
ThreadPopular wraps https://disqus.com/api/docs/threads/listPopular/ (https://disqus.com/api/3.0/threads/listPopular.json) It does not support the "related" argument (related fields can be gotten with calls to their respective APIS)
func (*Gisqus) ThreadPosts ¶
func (gisqus *Gisqus) ThreadPosts(ctx context.Context, threadID string, values url.Values) (*PostListResponse, error)
ThreadPosts wraps https://disqus.com/api/docs/threads/listPosts/ (https://disqus.com/api/3.0/threads/listPosts.json) It does not support the "related" argument (related fields can be gotten with calls to their respective APIS)
func (*Gisqus) ThreadSet ¶
func (gisqus *Gisqus) ThreadSet(ctx context.Context, threadsIDs []string, values url.Values) (*ThreadListResponseNoCursor, error)
ThreadSet wraps https://disqus.com/api/docs/threads/set/ (https://disqus.com/api/3.0/threads/set.json)
func (*Gisqus) ThreadTrending ¶
func (gisqus *Gisqus) ThreadTrending(ctx context.Context, values url.Values) (*ThreadTrendingResponse, error)
ThreadTrending wraps https://disqus.com/api/docs/trends/listThreads/ (https://disqus.com/api/3.0/trends/listThreads.json) It does not support the "related" argument (related fields can be gotten with calls to their respective APIS)
func (*Gisqus) ThreadUsersVoted ¶
func (gisqus *Gisqus) ThreadUsersVoted(ctx context.Context, threadD string, values url.Values) (*UsersVotedResponse, error)
ThreadUsersVoted wraps https://disqus.com/api/docs/threads/listUsersVotedThread/ (https://disqus.com/api/3.0/threads/listUsersVotedThread.json) Complete users are not returned by Disqus on this call
func (*Gisqus) UserActiveForums ¶
func (gisqus *Gisqus) UserActiveForums(ctx context.Context, userID string, values url.Values) (*ActiveForumsResponse, error)
UserActiveForums wraps https://disqus.com/api/docs/users/listActiveForums/ (https://disqus.com/api/3.0/users/listActiveForums.json)
func (*Gisqus) UserActivities ¶
func (gisqus *Gisqus) UserActivities(ctx context.Context, userID string, values url.Values) (*ActivitiesListResponse, error)
UserActivities wraps https://disqus.com/api/docs/users/listActivity/ (https://disqus.com/api/3.0/users/listActivity.json)
func (*Gisqus) UserDetails ¶
func (gisqus *Gisqus) UserDetails(ctx context.Context, userID string, values url.Values) (*UserDetailsResponse, error)
UserDetails wraps https://disqus.com/api/docs/users/details/ (https://disqus.com/api/3.0/users/details.json)
func (*Gisqus) UserFollowers ¶
func (gisqus *Gisqus) UserFollowers(ctx context.Context, userID string, values url.Values) (*UserListResponse, error)
UserFollowers wraps https://disqus.com/api/docs/users/listFollowers/ (https://disqus.com/api/3.0/users/listFollowers.json) Numlikes, NumPosts, NumFollowers are not returned by Disqus' API
func (*Gisqus) UserFollowing ¶
func (gisqus *Gisqus) UserFollowing(ctx context.Context, userID string, values url.Values) (*UserListResponse, error)
UserFollowing wraps https://disqus.com/api/docs/users/listFollowing/ (https://disqus.com/api/3.0/users/listFollowing.json) Numlikes, NumPosts, NumFollowers are not returned by Disqus' API
func (*Gisqus) UserForumFollowing ¶
func (gisqus *Gisqus) UserForumFollowing(ctx context.Context, userID string, values url.Values) (*UserForumFollowingResponse, error)
UserForumFollowing wraps https://disqus.com/api/docs/users/listFollowingForums/ (https://disqus.com/api/3.0/users/listFollowingForums.json)
func (*Gisqus) UserInteresting ¶
func (gisqus *Gisqus) UserInteresting(ctx context.Context, values url.Values) (*InterestingUsersResponse, error)
UserInteresting wraps https://disqus.com/api/docs/users/interestingUsers/ (https://disqus.com/api/3.0/users/interestingUsers.json)
func (*Gisqus) UserMostActiveForums ¶
func (gisqus *Gisqus) UserMostActiveForums(ctx context.Context, userID string, values url.Values) (*MostActiveForumsResponse, error)
UserMostActiveForums wraps https://disqus.com/api/docs/users/listMostActiveForums/ (https://disqus.com/api/3.0/users/listMostActiveForums.json)
func (*Gisqus) UserPosts ¶
func (gisqus *Gisqus) UserPosts(ctx context.Context, userID string, values url.Values) (*PostListResponse, error)
UserPosts wraps https://disqus.com/api/docs/users/listPosts/ (https://disqus.com/api/3.0/users/listPosts.json) It does not support the "related" argument (related fields can be gotten with calls to their respective APIS)
type Include ¶
type Include string
Include represents the possible values for includes in calls to Disqus'API
const ( PostIsUnapproved Include = "unapproved" PostIsApproved Include = "approved" PostIsSpam Include = "spam" PostIsDeleted Include = "deleted" PostIncludedIsFlagged Include = "flagged" PostIsHighlighted Include = "highlighted" )
Post constants are used by Disqus in API calls in the "include" parameter
type InterestingForums ¶
type InterestingForums struct { Items []*InterestingItem `json:"items"` Objects map[string]*Forum `json:"objects"` }
InterestingForums models the actual data contained in a call to Disqus' Interesting Forums (https://disqus.com/api/docs/forums/interestingForums/)
type InterestingForumsResponse ¶
type InterestingForumsResponse struct { ResponseStubWithCursor Response *InterestingForums `json:"response"` }
InterestingForumsResponse models the response to a call to Disqus' Interesting Forums (https://disqus.com/api/docs/forums/interestingForums/)
type InterestingItem ¶
InterestingItem models the slice returned by Interesting* Disqus endpoints.
type InterestingUsers ¶
type InterestingUsers struct { Items []*InterestingItem `json:"items"` Objects map[string]*User `json:"objects"` }
InterestingUsers models the objects returned by the interesting users endpoint.
type InterestingUsersResponse ¶
type InterestingUsersResponse struct { ResponseStubWithCursor Response *InterestingUsers `json:"response"` }
InterestingUsersResponse models the response of the interesting users endpoint.
type Interval ¶
type Interval string
Interval represents the possible values for intervals in calls to Disqus'API
type MostActiveForumsResponse ¶
type MostActiveForumsResponse struct { ResponseStub Response []*Forum `json:"response"` }
MostActiveForumsResponse models the responser of the user most active forums endpoint
type MostLikedUsersResponse ¶
type MostLikedUsersResponse struct { ResponseStubWithCursor Response []*User `json:"response"` }
MostLikedUsersResponse models the response of the most liked users in forum endpoint
type Order ¶
type Order string
Order represents the possible values for order in calls to Disqus'API
type Post ¶
type Post struct { Parent int `json:"parent"` // contains filtered or unexported fields }
Post models a Post as returned by Disqus' API
type PostAuthor ¶
type PostAuthor struct { Username string `json:"username"` About string `json:"about"` Name string `json:"name"` Disable3rdPartyTrackers bool `json:"disable3rdPartyTrackers"` URL string `json:"url"` IsAnonymous bool `json:"isAnonymous"` ProfileURL string `json:"profileUrl"` IsPowerContributor bool `json:"isPowerContributor"` Location string `json:"location"` IsPrivate bool `json:"isPrivate"` SignedURL string `json:"signedUrl"` IsPrimary bool `json:"isPrimary"` JoinedAt time.Time `json:"-"` DisqusTimeJoinedAt string `json:"joinedAt"` ID string `json:"id"` Avatar *UserAvatar `json:"avatar"` }
PostAuthor models the fields of the author field in a Post
type PostDetailsResponse ¶
type PostDetailsResponse struct { ResponseStub Response *Post `json:"response"` }
PostDetailsResponse wraps the response of the post details endpoint
type PostListResponse ¶
type PostListResponse struct { ResponseStubWithCursor Response []*Post `json:"response"` }
PostListResponse wraps the response of the post list endpoint
type PostListResponseNoCursor ¶
type PostListResponseNoCursor struct { ResponseStub Response []*Post `json:"response"` }
PostListResponseNoCursor wraps the response of the post popular endpoint
type RawPost ¶
type RawPost struct { Parent Post `json:"parent"` // contains filtered or unexported fields }
RawPost is exported because of the json parser
type ResponseStub ¶
type ResponseStub struct {
Code int `json:"code"`
}
ResponseStub is the standard Disqus response stub
type ResponseStubWithCursor ¶
type ResponseStubWithCursor struct { ResponseStub Cursor *DisqusCursor `json:"cursor"` }
ResponseStubWithCursor is the standard response stub for call that support pagination
type Thread ¶
type Thread struct { Feed string `json:"feed"` Identifiers []string `json:"identifiers"` Dislikes int `json:"dislikes"` Likes int `json:"likes"` Message string `json:"message"` ID string `json:"id"` IsDeleted bool `json:"isDeleted"` Category string `json:"category"` Author string `json:"author"` UserScore int `json:"userScore"` IsSpam bool `json:"isSpam"` SignedLink string `json:"signedLink"` CreatedAt time.Time `json:"-"` DisqusTimeCreatedAt string `json:"createdAt"` HasStreaming bool `json:"hasStreaming"` RawMessage string `json:"rawMessage"` IsClosed bool `json:"isClosed"` Link string `json:"link"` Slug string `json:"slug"` Forum string `json:"forum"` CleanTitle string `json:"clean_title"` Posts int `json:"posts"` UserSubscription bool `json:"userSubscription"` Title string `json:"title"` HighlightedPost *Post `json:"highlightedPost"` }
Thread models the Thread returned by Disqus' API calls
type ThreadDetail ¶
ThreadDetail models the fields returned by the thread detail endpoint
type ThreadDetailResponse ¶
type ThreadDetailResponse struct { ResponseStub Response *ThreadDetail `json:"response"` }
ThreadDetailResponse models the response of the thread details endpoint.
type ThreadListResponse ¶
type ThreadListResponse struct { ResponseStubWithCursor Response []*Thread `json:"response"` }
ThreadListResponse models the response of various thread endpoints.
type ThreadListResponseNoCursor ¶
type ThreadListResponseNoCursor struct { ResponseStub Response []*Thread `json:"response"` }
ThreadListResponseNoCursor models the response of various thread endpoints.
type ThreadTrendingResponse ¶
type ThreadTrendingResponse struct { ResponseStub Response []*Trend `json:"response"` }
ThreadTrendingResponse models the response of the trending threads endpoint.
type ThreadsURLS ¶
type ThreadsURLS struct { ThreadListURL string ThreadDetailURL string ThreadPostsURL string ThreadHotURL string ThreadPopularURL string ThreadTrendingURL string ThreadUsersVotedURL string ThreadSetURL string }
ThreadsURLS are the URLs of the thread endpoints of the Disqus' API
type Trend ¶
type Trend struct { TrendingThread *Thread `json:"thread"` PostLikes int `json:"postLikes"` Posts int `json:"posts"` Score float32 `json:"score"` Link string `json:"link"` Likes int `json:"likes"` }
Trend models the trend returned by the trending threads endpoint
type User ¶
type User struct { Disable3rdPartyTrackers bool `json:"disable3rdPartyTrackers"` IsPowerContributor bool `json:"isPowerContributor"` IsPrimary bool `json:"isPrimary"` ID string `json:"id"` NumFollowers int `json:"numFollowers"` Rep float32 `json:"rep"` NumFollowing int `json:"numFollowing"` NumPosts int `json:"numPosts"` Location string `json:"location"` IsPrivate bool `json:"isPrivate"` JoinedAt time.Time `json:"-"` DisqusTimeJoinedAt string `json:"joinedAt"` Username string `json:"username"` NumLikesReceived int `json:"numLikesReceived"` ReputationLabel string `json:"reputationLabel"` About string `json:"about"` Name string `json:"name"` URL string `json:"url"` NumForumsFollowing int `json:"numForumsFollowing"` ProfileURL string `json:"profileUrl"` Reputation float32 `json:"reputation"` Avatar *UserAvatar `json:"avatar"` SignedURL string `json:"signedUrl"` IsAnonymous bool `json:"isAnonymous"` }
User models the user object returned by the user detail endpoint.
type UserAvatar ¶
type UserAvatar struct { Small *Icon `json:"small"` Large *Icon `json:"large"` Icon IsCustom bool `json:"isCustom"` }
UserAvatar models the avatar field of the user object.
type UserDetailsResponse ¶
type UserDetailsResponse struct { ResponseStub Response *User `json:"response"` }
UserDetailsResponse models the response of the user detail endpoint
type UserForumFollowingResponse ¶
type UserForumFollowingResponse struct { ResponseStubWithCursor Response []*Forum `json:"response"` }
UserForumFollowingResponse models the response of the user forum following endpoint.
type UserListResponse ¶
type UserListResponse struct { ResponseStubWithCursor Response []*User `json:"response"` }
UserListResponse models the response of various user endpoints.
type UsersURLS ¶
type UsersURLS struct { DetailURL string InterestingIUsersURL string PostListURL string ActiveForumsURL string FollowersURL string FollowingURL string FollowingForumsURL string ActivityURL string MostActiveForumsURL string }
UsersURLS are the URLs used by Disqus' user endpoints
type UsersVotedResponse ¶
type UsersVotedResponse struct { ResponseStub Response []*User `json:"response"` }
UsersVotedResponse models the response of the users voted thread endpoint