qiita

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 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) CreateItem added in v0.0.3

func (cl *Client) CreateItem(params *CreateItemParameters) (Item, error)

func (*Client) DeleteItem added in v0.0.3

func (cl *Client) DeleteItem(id string) error

func (*Client) GetItem added in v0.0.3

func (cl *Client) GetItem(id string) (Item, error)

func (*Client) ListAuthenticatedUserItems added in v0.0.3

func (cl *Client) ListAuthenticatedUserItems(p *ListAuthenticatedUserItemsParameters) (Items, error)

func (*Client) ListItems

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

func (*Client) UpdateItem added in v0.0.3

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

type CreateItemParameters added in v0.0.3

type CreateItemParameters struct {
	Title   *string `json:"title,omitempty"`
	Tags    *Tags   `json:"tags,omitempty"`
	Body    *string `json:"body,omitempty"`
	Private *bool   `json:"private,omitempty"`
	Tweet   *bool   `json:"tweet,omitempty"`
}

type Item

type Item map[string]interface{}

func (Item) Body added in v0.0.3

func (item Item) Body() string

func (Item) FrontMatter added in v0.0.4

func (item Item) FrontMatter() ItemFrontMatter

func (Item) ID added in v0.0.3

func (item Item) ID() string

func (Item) Private added in v0.0.3

func (item Item) Private() bool

func (Item) TableRows

func (item Item) TableRows() []map[string]interface{}

func (Item) Tags added in v0.0.3

func (item Item) Tags() Tags

func (Item) Title added in v0.0.3

func (item Item) Title() string

func (Item) URL added in v0.2.0

func (item Item) URL() string

type ItemFrontMatter added in v0.0.4

type ItemFrontMatter struct {
	ID      *string   `yaml:"id,omitempty"`
	Title   *string   `yaml:"title,omitempty"`
	Tags    *[]string `yaml:"tags,flow,omitempty"`
	Private *bool     `yaml:"private,omitempty"`
}

func (ItemFrontMatter) QiitaTags added in v0.0.4

func (fm ItemFrontMatter) QiitaTags() *Tags

type Items

type Items []Item

func (Items) TableRows

func (items Items) TableRows() []map[string]interface{}

type ListAuthenticatedUserItemsParameters added in v0.0.3

type ListAuthenticatedUserItemsParameters struct {
	Page    *int `url:"page,omitempty"`
	PerPage *int `url:"per_page,omitempty"`
}

type ListItemsParameters

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

type Tag added in v0.0.3

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

type Tags added in v0.0.3

type Tags []*Tag

func TagsFromStrings added in v0.0.3

func TagsFromStrings(ss []string) Tags

func (Tags) Names added in v0.0.3

func (tags Tags) Names() []string

type UpdateItemParameters added in v0.0.3

type UpdateItemParameters struct {
	Title   *string `json:"title,omitempty"`
	Tags    *Tags   `json:"tags,omitempty"`
	Body    *string `json:"body,omitempty"`
	Private *bool   `json:"private,omitempty"`
}

Jump to

Keyboard shortcuts

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