api

package
v0.0.0-...-091137d Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 8 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 {
	URL *url.URL
	// contains filtered or unexported fields
}

Client represents the singular of api client.

func NewClient

func NewClient() *Client

NewClient creates a Client.

func (*Client) Do

func (c *Client) Do(method string, path string, query map[string]string, data []byte) (*http.Response, error)

Do sends an HTTP request and returns an HTTP response.

func (*Client) GetCategories

func (c *Client) GetCategories(page int, limit int) (*http.Response, error)

GetCategories requests categories.

func (*Client) GetPageAndLimit

func (c *Client) GetPageAndLimit(r *http.Request) (int, int, error)

GetPageAndLimit gets page and limit.

func (*Client) GetPost

func (c *Client) GetPost(title string) (*http.Response, error)

GetPost requests a post.

func (*Client) GetPosts

func (c *Client) GetPosts(page int, limit int) (*http.Response, error)

GetPosts requests posts

func (*Client) GetPostsByCategory

func (c *Client) GetPostsByCategory(name string, page int, limit int) (*http.Response, error)

GetPostsByCategory requests posts by category.

func (*Client) GetPostsByKeyword

func (c *Client) GetPostsByKeyword(keyword string, page int, limit int) (*http.Response, error)

GetPostsByKeyword requests posts by keyword.

func (*Client) GetPostsByTag

func (c *Client) GetPostsByTag(name string, page int, limit int) (*http.Response, error)

GetPostsByTag requests posts by tag.

func (*Client) GetTags

func (c *Client) GetTags(page int, limit int) (*http.Response, error)

GetTags requests categories

func (*Client) PostComment

func (c *Client) PostComment()

PostComment requests post a comment.

Jump to

Keyboard shortcuts

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