client

package
v0.0.0-...-aee00b0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHost      = "https://scrapbox.io"
	DefaultUserAgent = "Scrapgox/0.1.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	URL        *url.URL
	HTTPClient *http.Client
	Token      string
	UserAgent  string
}

func NewClient

func NewClient(url *url.URL, token string, userAgent string) (*Client, error)

func (*Client) GetPages

func (c *Client) GetPages(project string, query string) ([]*Page, error)

type Page

type Page struct {
	Title string
}

type Response

type Response struct {
	ProjectName string `json:"projectName"`
	SearchQuery string `json:"searchQuery"`
	Limit       int    `json:"limit"`
	Count       int    `json:"count"`
	Pages       []struct {
		ID           string   `json:"id"`
		Title        string   `json:"title"`
		Image        string   `json:"image"`
		Descriptions []string `json:"descriptions"`
		User         struct {
			ID string `json:"id"`
		} `json:"user"`
		Pin             int         `json:"pin"`
		Views           int         `json:"views"`
		Linked          int         `json:"linked"`
		Created         int         `json:"created"`
		Updated         int         `json:"updated"`
		Accessed        int         `json:"accessed"`
		SnapshotCreated interface{} `json:"snapshotCreated"`
		Snipet          []string    `json:"snipet"`
	} `json:"pages"`
	ExistsExactTitleMatch bool `json:"existsExactTitleMatch"`
	Query                 struct {
		Words    []string      `json:"words"`
		Excludes []interface{} `json:"excludes"`
	} `json:"query"`
}

Jump to

Keyboard shortcuts

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