Documentation ¶
Overview ¶
The package 'qiita' provides a client using Qiita API v2.
You can also use http.Client compatible client object like oauth2. Here are simple examples.
import ( "github.com/uetchy/go-qiita/qiita" "golang.org/x/oauth2" "fmt" ) func main() { // Create OAuth2 client ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: "personal access token"}) tc := oauth2.NewClient(oauth2.NoContext, ts) // Create Qiita client using OAuth2 adapter client := qiita.NewClient(tc) // Fetch articles and print them items, _, _ := client.Items.List(&qiita.ItemsListOptions{Query: "Alfred"}) fmt.Println(items) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachedTag ¶
type AuthenticatedUserService ¶
type AuthenticatedUserService struct {
// contains filtered or unexported fields
}
func (*AuthenticatedUserService) Items ¶
func (s *AuthenticatedUserService) Items(opt *ListOptions) ([]Item, *http.Response, error)
List the authenticated user's items in newest order
func (*AuthenticatedUserService) Show ¶
func (s *AuthenticatedUserService) Show() (*User, error)
Get a user associated to the current access token.
type Client ¶
type Client struct { BaseURL *url.URL UserAgent string Items *ItemsService Users *UsersService AuthenticatedUser *AuthenticatedUserService Tags *TagsService // contains filtered or unexported fields }
type Item ¶
type Item struct { RenderedBody string `json:"rendered_body"` Body string `json:"body"` CoEditing bool `json:"coediting"` CreatedAt time.Time `json:"created_at"` Id string `json:"id"` Private bool `json:"private"` Tags []AttachedTag `json:"tags"` Title string `json:"title"` UpdatedAt time.Time `json:"updated_at"` URL string `json:"url"` User User `json:"user"` }
type ItemsListOptions ¶
type ItemsListOptions struct { Query string `url:"query,omitempty"` ListOptions }
type ItemsService ¶
type ItemsService struct {
// contains filtered or unexported fields
}
func (*ItemsService) List ¶
func (s *ItemsService) List(opt *ItemsListOptions) ([]Item, *http.Response, error)
type ListOptions ¶
type TagsService ¶
type TagsService struct {
// contains filtered or unexported fields
}
func (*TagsService) List ¶
func (s *TagsService) List(opt *ListOptions) ([]Tag, *http.Response, error)
type User ¶
type User struct { Name string `json:"name"` Description string `json:"description"` FacebookId string `json:"facebook_id"` FolloweesCount int `json:"followees_count"` FollowersCount int `json:"followers_count"` GithubLoginName string `json:"github_login_name"` Id string `json:"id"` ItemsCount int `json:"items_count"` LinkedinId string `json:"linkedin_id"` Location string `json:"location"` Organization string `json:"organization"` PermanentId int `json:"permanent_id"` ProfileImageURL string `json:"profile_image_url"` TwitterScreenName string `json:"twitter_screen_name"` WebsiteURL string `json:"website_url"` }
type UsersService ¶
type UsersService struct {
// contains filtered or unexported fields
}
func (*UsersService) Stocks ¶
func (s *UsersService) Stocks(userId string, opt *ListOptions) ([]Item, *http.Response, error)
List a user's stocked items in recently-stocked order.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.