qiita

package
v0.0.0-...-f618c29 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(token string) *Client

func (*Client) ListItems

func (cl *Client) ListItems(p *ListItemsParameters) (Items, error)

func (*Client) ListItemsWithPagination

func (cl *Client) ListItemsWithPagination(query string) (Items, error)

func (*Client) UpdateItem

func (cl *Client) UpdateItem(id string, params *UpdateItemParameters) error

type Item

type Item struct {
	ID          string    `json:"id"`
	Title       string    `json:"title"`
	LikesCount  int       `json:"likes_count"`
	StocksCount int       `json:"stocks_count"`
	URL         string    `json:"url"`
	User        User      `json:"user"`
	Tags        Tags      `json:"tags"`
	CreatedAt   time.Time `json:"created_at"`
}

type Items

type Items []*Item

func (Items) Filter

func (items Items) Filter() Items

func (Items) Sort

func (items Items) Sort()

type ListItemsParameters

type ListItemsParameters struct {
	Query   string `url:"query"`
	Page    int    `url:"page"`
	PerPage int    `url:"per_page"`
}

type Tag

type Tag struct {
	Name string `json:"name"`
}

type Tags

type Tags []*Tag

type UpdateItemParameters

type UpdateItemParameters struct {
	Title string `json:"title"`
	Body  string `json:"body"`
	Tags  Tags   `json:"tags"`
}

type User

type User struct {
	ID string `json:"id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL