client

package
v0.0.0-...-eb541bc Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHost       = "https://scrapbox.io"
	DefaultExpiration = 60 * 60 // time.Second
	DefaultUserAgent  = "ScrapboxGoClient/0.3.0"
)
View Source
const (
	EnvHome = "SCRAPBOX_HOME"
)

Variables

This section is empty.

Functions

func EncodeFilename

func EncodeFilename(filename string) string

func GetURL

func GetURL(host, project, page string) string

Types

type Client

type Client struct {
	URL        *url.URL
	HTTPClient *http.Client

	Token      string
	Expiration time.Duration
	UserAgent  string
}

func NewClient

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

func (*Client) ExecQuery

func (c *Client) ExecQuery(ctx context.Context, project string, tags []string, skip, limit int) (*QueryResult, error)

func (*Client) GetPage

func (c *Client) GetPage(ctx context.Context, project, page string) (*Page, error)

type Page

type Page struct {
	Title string
	Lines []string
	Links []string
}
func (p *Page) ExtractExternalLinks() []string

type QueryResult

type QueryResult struct {
	Count int
	Pages []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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