instapaper

package
v0.0.0-...-51b0b4b Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Instapaper models

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bookmark

type Bookmark struct {
	Hash              string  `json:"hash"`
	Description       string  `json:"description"`
	Tags              []Tag   `json:"tags"`
	BookmarkID        int64   `json:"bookmark_id"`
	PrivateSource     string  `json:"private_source"`
	Title             string  `json:"title"`
	URL               string  `json:"url"`
	ProgressTimestamp int64   `json:"progress_timestamp"`
	Time              int64   `json:"time"`
	Progress          float64 `json:"progress"`
	Starred           string  `json:"starred"`
	Type              string  `json:"type"`
}

type Client

type Client struct {
	HttpClient *http.Client
}

Client

func NewClient

func NewClient() (Client, error)

func (Client) GetBookmarkTitles

func (c Client) GetBookmarkTitles(limit int) ([]string, error)

func (Client) GetBookmarks

func (c Client) GetBookmarks(limit int) ([]Bookmark, error)

type Highlight

type Highlight struct {
	HighlightID int64       `json:"highlight_id"`
	Text        string      `json:"text"`
	Note        interface{} `json:"note"` // using interface{} since it can be null
	BookmarkID  int64       `json:"bookmark_id"`
	Time        int64       `json:"time"`
	Position    int         `json:"position"`
	Type        string      `json:"type"`
}

type Response

type Response struct {
	Highlights []Highlight `json:"highlights"` // empty array
	Bookmarks  []Bookmark  `json:"bookmarks"`
	User       User        `json:"user"`
}

func (Response) GetBookmarkTitles

func (r Response) GetBookmarkTitles() []string

func (Response) GetBookmarks

func (r Response) GetBookmarks() []Bookmark

type Tag

type Tag struct {
	Count int     `json:"count"`
	Hash  string  `json:"hash"`
	Name  string  `json:"name"`
	ID    int     `json:"id"`
	Time  float64 `json:"time"`
	Slug  string  `json:"slug"`
}

type User

type User struct {
	Username             string `json:"username"`
	UserID               int    `json:"user_id"`
	Type                 string `json:"type"`
	SubscriptionIsActive string `json:"subscription_is_active"`
}

Jump to

Keyboard shortcuts

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