Documentation
¶
Index ¶
- Constants
- Variables
- func GetWithQuery(action, auth string, data, res interface{}) error
- func PostWithJSON(action, auth string, data, res interface{}) error
- func PutWithJSON(action, auth string, data, res interface{}) error
- func SimpleGet(action, auth string, res interface{}) error
- type Article
- type ArticleContent
- type Client
- func (c *Client) AddArticle(option *DraftArticle) (*Article, error)
- func (c *Client) ModifyArticle(id int, option *DraftArticle) (*Article, error)
- func (c *Client) RetrieveArticleById(id int) (*Article, error)
- func (c *Client) RetrieveArticles(option *RetrieveArticlesOption) ([]*Article, error)
- func (c *Client) RetrieveAuthenticatedUser() (*User, error)
- func (c *Client) RetrieveCommentById(id string) (*Comment, error)
- func (c *Client) RetrieveComments(option *RetrieveCommentsOption) ([]*Comment, error)
- func (c *Client) RetrieveFollowers(option *RetrieveFollowersOption) ([]*Follower, error)
- func (c *Client) RetrievePodcastEpisodes(option *RetrievePodcastOption) ([]*PodcastEpisode, error)
- func (c *Client) RetrieveTags(option *RetrieveTagsOption) ([]*Tag, error)
- func (c *Client) RetrieveUser(id int) (*User, error)
- func (c *Client) RetrieveUserAllArticles(option *RetrieveUserArticlesOption) ([]*Article, error)
- func (c *Client) RetrieveUserArticles(option *RetrieveUserArticlesOption) ([]*Article, error)
- func (c *Client) RetrieveUserPublishedArticles(option *RetrieveUserArticlesOption) ([]*Article, error)
- func (c *Client) RetrieveUserUnpublishedArticles(option *RetrieveUserArticlesOption) ([]*Article, error)
- func (c *Client) RetrieveVideoArticles(option *RetrieveVideoArticlesOption) ([]*VideoArticle, error)
- type Comment
- type DraftArticle
- type FlareTag
- type Follower
- type Organization
- type Podcast
- type PodcastEpisode
- type RetrieveArticlesOption
- type RetrieveCommentsOption
- type RetrieveFollowersOption
- type RetrievePodcastOption
- type RetrieveTagsOption
- type RetrieveUserArticlesOption
- type RetrieveVideoArticlesOption
- type State
- type Tag
- type User
- type VideoArticle
Constants ¶
View Source
const ( StateFresh State = "fresh" StateRising = "rising" StateAll = "all" )
Variables ¶
View Source
var DefaultClient = http.DefaultClient
View Source
var Origin = "https://dev.to/api"
Functions ¶
func GetWithQuery ¶
func PostWithJSON ¶
func PutWithJSON ¶
Types ¶
type Article ¶
type Article struct { TypeOf string `json:"type_of"` Id int `json:"id"` Title string `json:"title"` Description string `json:"description"` CoverImage string `json:"cover_image"` Slug string `json:"slug"` Path string `json:"path"` Url string `json:"url"` CanonicalUrl string `json:"canonical_url"` CommentsCount int `json:"comments_count"` PublicReactionsCount int `json:"public_reactions_count"` PublishedAt string `json:"published_at"` PublishedTimestamp string `json:"published_timestamp"` User User `json:"user"` Organization Organization `json:"organization"` FlareTag FlareTag `json:"flare_tag"` }
type ArticleContent ¶
type ArticleContent struct { Title string `json:"title"` BodyMarkdown string `json:"body_markdown"` Published bool `json:"published"` Series string `json:"series"` MainImage string `json:"main_image"` CanonicalUrl string `json:"canonical_url"` Description string `json:"description"` Tags []string `json:"tags"` OrganizationId int `json:"organization_id"` }
type Client ¶
type Client struct {
ApiKey string
}
func (*Client) AddArticle ¶
func (c *Client) AddArticle(option *DraftArticle) (*Article, error)
POST /articles
func (*Client) ModifyArticle ¶
func (c *Client) ModifyArticle(id int, option *DraftArticle) (*Article, error)
func (*Client) RetrieveArticleById ¶
GET /articles/:id
func (*Client) RetrieveArticles ¶
func (c *Client) RetrieveArticles(option *RetrieveArticlesOption) ([]*Article, error)
GET /articles
func (*Client) RetrieveAuthenticatedUser ¶
GET /users/me
func (*Client) RetrieveCommentById ¶
GET /comments/:id
func (*Client) RetrieveComments ¶
func (c *Client) RetrieveComments(option *RetrieveCommentsOption) ([]*Comment, error)
GET /comments
func (*Client) RetrieveFollowers ¶
func (c *Client) RetrieveFollowers(option *RetrieveFollowersOption) ([]*Follower, error)
GET /followers/users
func (*Client) RetrievePodcastEpisodes ¶
func (c *Client) RetrievePodcastEpisodes(option *RetrievePodcastOption) ([]*PodcastEpisode, error)
GET /podcast_episodes
func (*Client) RetrieveTags ¶
func (c *Client) RetrieveTags(option *RetrieveTagsOption) ([]*Tag, error)
GET /tags
func (*Client) RetrieveUserAllArticles ¶
func (c *Client) RetrieveUserAllArticles(option *RetrieveUserArticlesOption) ([]*Article, error)
GET /articles/me/all
func (*Client) RetrieveUserArticles ¶
func (c *Client) RetrieveUserArticles(option *RetrieveUserArticlesOption) ([]*Article, error)
GET /articles/me
func (*Client) RetrieveUserPublishedArticles ¶
func (c *Client) RetrieveUserPublishedArticles(option *RetrieveUserArticlesOption) ([]*Article, error)
GET /articles/me/published
func (*Client) RetrieveUserUnpublishedArticles ¶
func (c *Client) RetrieveUserUnpublishedArticles(option *RetrieveUserArticlesOption) ([]*Article, error)
GET /articles/me/unpublished
func (*Client) RetrieveVideoArticles ¶
func (c *Client) RetrieveVideoArticles(option *RetrieveVideoArticlesOption) ([]*VideoArticle, error)
GET /videos
type DraftArticle ¶
type DraftArticle struct {
Article ArticleContent `json:"article"`
}
type Organization ¶
type PodcastEpisode ¶
type RetrieveArticlesOption ¶
type RetrieveCommentsOption ¶
type RetrieveCommentsOption struct {
AId int
}
type RetrieveFollowersOption ¶
type RetrievePodcastOption ¶
type RetrieveTagsOption ¶
type User ¶
type User struct { Id int `json:"id"` Name string `json:"name"` Username string `json:"username"` TwitterUsername string `json:"twitter_username"` GithubUsername string `json:"github_username"` WebsiteUrl string `json:"website_url"` ProfileImage string `json:"profile_image"` ProfileImage90 string `json:"profile_image_90"` }
type VideoArticle ¶
type VideoArticle struct { TypeOf string `json:"type_of"` Id int `json:"id"` Path string `json:"path"` CloudinaryVideoUrl string `json:"cloudinary_video_url"` Title string `json:"title"` UserId int `json:"user_id"` VideoDurationInMinutes string `json:"video_duration_in_minutes"` User User `json:"user"` }
Click to show internal directories.
Click to hide internal directories.