readwisereader

package module
v0.0.0-...-7f9c7f7 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocationNew       = "new"
	LocationLater     = "later"
	LocationShortList = "shortlist"
	LocationArchive   = "archive"
	LocationFeed      = "feed"
)
View Source
const (
	CategoryArticle   = "article"
	CategoryEmail     = "email"
	CategoryRSS       = "rss"
	CategoryHighlight = "highlight"
	CategoryNote      = "note"
	CategoryPDF       = "pdf"
	CategoryEPUB      = "epub"
	CategoryTweet     = "tweet"
	CategoryVideo     = "video"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token string) *Client

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, ID string) error

func (*Client) List

func (c *Client) List(ctx context.Context, params ListParams) (*ListResponse, error)

func (*Client) ListPaginate

func (c *Client) ListPaginate(ctx context.Context, params ListParams) iter.Seq2[Page, error]

func (*Client) Save

func (c *Client) Save(ctx context.Context, params SaveParams) (*SaveResponse, error)

type Document

type Document struct {
	ID              string
	URL             string
	SourceURL       string
	Title           string
	Author          string
	Source          string
	Category        Category
	Location        Location
	Tags            map[string]any
	SiteName        string
	WordCount       int
	CreatedAt       time.Time
	UpdatedAt       time.Time
	Notes           string
	PublishedDate   time.Time
	Summary         string
	ImageURL        string
	ParentID        string
	ReadingProgress float64
	FirstOpenedAt   time.Time
	LastOpenedAt    time.Time
	SavedAt         time.Time
	LastMovedAt     time.Time
}

type ErrorRateLimited

type ErrorRateLimited struct {
	RetryAfter time.Duration
}

func (*ErrorRateLimited) Error

func (e *ErrorRateLimited) Error() string

type ListParams

type ListParams struct {
	ID              string    `url:"id,omitempty"`
	UpdatedAfter    time.Time `url:"updatedAfter,omitempty"`
	Location        Location  `url:"location,omitempty"`
	Category        Category  `url:"category,omitempty"`
	PageCursor      string    `url:"pageCursor,omitempty"`
	WithHTMLContent bool      `url:"withHTMLContent,omitempty"`
}

type ListResponse

type ListResponse struct {
	// Cursor for the next page of results
	NextPageCursor string
	Page
}

type Location

type Location string

type Page

type Page struct {
	// Total number of documents
	Count int
	// List of documents in the current page
	Results []Document
}

type SaveParams

type SaveParams struct {
	URL             string     `json:"url"`
	HTML            *string    `json:"html,omitempty"`
	ShouldCleanHTML *bool      `json:"should_clean_html,omitempty"`
	Title           *string    `json:"title,omitempty"`
	Author          *string    `json:"author,omitempty"`
	Summary         *string    `json:"summary,omitempty"`
	PublishedDate   *time.Time `json:"published_date,omitempty"`
	ImageURL        *string    `json:"image_url,omitempty"`
	Location        Location   `json:"location,omitempty"`
	Category        Category   `json:"category,omitempty"`
	SavedUsing      *string    `json:"saved_using,omitempty"`
	Tags            []string   `json:"tags,omitempty"`
	Notes           *string    `json:"notes,omitempty"`
}

type SaveResponse

type SaveResponse struct {
	ID  string
	URL string
}

Jump to

Keyboard shortcuts

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