raindrop

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://api.raindrop.io/rest/v1"

Variables

This section is empty.

Functions

func ValidateCreateItems added in v0.2.0

func ValidateCreateItems(items []CreateItem) error

Types

type APIError added in v0.2.0

type APIError struct {
	StatusCode int
	RetryAfter string
	Message    string
}

func (*APIError) Error added in v0.2.0

func (e *APIError) Error() string

type Client

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

func NewClient

func NewClient(baseURL, token string) *Client

func (*Client) Backups

func (c *Client) Backups(ctx context.Context) (json.RawMessage, error)

func (*Client) BatchDelete

func (c *Client) BatchDelete(ctx context.Context, collectionID int64, search string, ids []int64) (json.RawMessage, error)

func (*Client) BatchUpdate

func (c *Client) BatchUpdate(ctx context.Context, collectionID int64, body map[string]any) (json.RawMessage, error)

func (*Client) Bytes

func (c *Client) Bytes(ctx context.Context, method, path string, query url.Values, body any) ([]byte, string, error)

func (*Client) Cache

func (c *Client) Cache(ctx context.Context, id int64) ([]byte, string, error)

func (*Client) CleanCollections

func (c *Client) CleanCollections(ctx context.Context) (json.RawMessage, error)

func (*Client) CollectionCovers

func (c *Client) CollectionCovers(ctx context.Context, search string) (json.RawMessage, error)

func (*Client) CollectionTree added in v0.2.0

func (c *Client) CollectionTree(ctx context.Context) ([]CollectionPath, error)

func (*Client) Collections

func (c *Client) Collections(ctx context.Context, children bool) ([]Collection, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, body map[string]any) (Raindrop, error)

func (*Client) CreateBackup

func (c *Client) CreateBackup(ctx context.Context) ([]byte, string, error)

func (*Client) CreateCollection

func (c *Client) CreateCollection(ctx context.Context, title string, parentID int64) (json.RawMessage, error)

func (*Client) CreateMany added in v0.2.0

func (c *Client) CreateMany(ctx context.Context, items []CreateItem) ([]Raindrop, error)

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, id int64) (json.RawMessage, error)

func (*Client) DeleteCollection

func (c *Client) DeleteCollection(ctx context.Context, id int64) (json.RawMessage, error)

func (*Client) DeleteTags

func (c *Client) DeleteTags(ctx context.Context, collectionID int64, tags []string) (json.RawMessage, error)

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, query url.Values, body any, out any) error

func (*Client) DownloadBackup

func (c *Client) DownloadBackup(ctx context.Context, id, format string) ([]byte, string, error)

func (*Client) ExpandCollections

func (c *Client) ExpandCollections(ctx context.Context, expanded bool) (json.RawMessage, error)

func (*Client) Export

func (c *Client) Export(ctx context.Context, collectionID int64, format, search, sort string) ([]byte, string, error)

func (*Client) Filters

func (c *Client) Filters(ctx context.Context, collectionID int64, search string) (Filters, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, id int64) (Raindrop, error)

func (*Client) Highlights

func (c *Client) Highlights(ctx context.Context, collectionID int64, page, perPage int) (json.RawMessage, error)

func (*Client) ImportFile

func (c *Client) ImportFile(ctx context.Context, filePath string) (json.RawMessage, error)

func (*Client) JoinCollection

func (c *Client) JoinCollection(ctx context.Context, collectionID int64, token string) (json.RawMessage, error)

func (*Client) List

func (c *Client) List(ctx context.Context, opts ListOptions) ([]Raindrop, int64, error)

func (*Client) MergeCollections

func (c *Client) MergeCollections(ctx context.Context, to int64, ids []int64) (json.RawMessage, error)

func (*Client) Multipart

func (c *Client) Multipart(ctx context.Context, method, path string, query url.Values, fileField, filePath string, fields map[string]string) (json.RawMessage, error)

func (*Client) ParseURL

func (c *Client) ParseURL(ctx context.Context, link string) (json.RawMessage, error)

func (*Client) Raw

func (c *Client) Raw(ctx context.Context, method, path string, query url.Values, body any) (json.RawMessage, error)

func (*Client) RawBytes

func (c *Client) RawBytes(ctx context.Context, method, path string, query url.Values, body any) ([]byte, string, error)

func (*Client) RemoveCollaborator

func (c *Client) RemoveCollaborator(ctx context.Context, collectionID, userID int64) (json.RawMessage, error)

func (*Client) RenameTags

func (c *Client) RenameTags(ctx context.Context, collectionID int64, tags []string, replace string) (json.RawMessage, error)

func (*Client) Share

func (c *Client) Share(ctx context.Context, collectionID int64, emails []string, role string) (json.RawMessage, error)

func (*Client) Sharing

func (c *Client) Sharing(ctx context.Context, collectionID int64) (json.RawMessage, error)

func (*Client) SortCollections

func (c *Client) SortCollections(ctx context.Context, sort string) (json.RawMessage, error)

func (*Client) Stats

func (c *Client) Stats(ctx context.Context) (UserStats, error)

func (*Client) Suggest

func (c *Client) Suggest(ctx context.Context, link string) (json.RawMessage, error)

func (*Client) Tags

func (c *Client) Tags(ctx context.Context, collectionID int64) ([]Tag, error)

func (*Client) URLsExist

func (c *Client) URLsExist(ctx context.Context, urls []string) (json.RawMessage, error)

func (*Client) Unshare

func (c *Client) Unshare(ctx context.Context, collectionID int64) (json.RawMessage, error)

func (*Client) Update

func (c *Client) Update(ctx context.Context, id int64, body map[string]any) (Raindrop, error)

func (*Client) UpdateCollaborator

func (c *Client) UpdateCollaborator(ctx context.Context, collectionID, userID int64, role string) (json.RawMessage, error)

func (*Client) UpdateCollection

func (c *Client) UpdateCollection(ctx context.Context, id int64, body map[string]any) (json.RawMessage, error)

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, body map[string]any) (json.RawMessage, error)

func (*Client) UploadCollectionCover

func (c *Client) UploadCollectionCover(ctx context.Context, id int64, filePath string) (json.RawMessage, error)

func (*Client) UploadRaindropCover

func (c *Client) UploadRaindropCover(ctx context.Context, id int64, filePath string) (json.RawMessage, error)

func (*Client) UploadRaindropFile

func (c *Client) UploadRaindropFile(ctx context.Context, filePath string, collectionID int64) (json.RawMessage, error)

func (*Client) User

func (c *Client) User(ctx context.Context) (json.RawMessage, error)

type Collection

type Collection struct {
	ID     int64  `json:"_id"`
	Title  string `json:"title"`
	Count  int64  `json:"count"`
	Public bool   `json:"public"`
	Parent *Ref   `json:"parent,omitempty"`
	View   string `json:"view"`
	Color  string `json:"color"`
}

type CollectionPath added in v0.2.0

type CollectionPath struct {
	ID       int64  `json:"id"`
	Title    string `json:"title"`
	ParentID int64  `json:"parentId,omitempty"`
	Path     string `json:"path"`
	Depth    int    `json:"depth"`
	Count    int64  `json:"count"`
}

func BuildCollectionTree added in v0.2.0

func BuildCollectionTree(items []Collection) ([]CollectionPath, error)

type Count

type Count struct {
	Count int64 `json:"count"`
}

type CreateItem added in v0.2.0

type CreateItem struct {
	Link        string    `json:"link"`
	Title       string    `json:"title,omitempty"`
	Tags        []string  `json:"tags,omitempty"`
	Note        string    `json:"note,omitempty"`
	Excerpt     string    `json:"excerpt,omitempty"`
	Collection  *Ref      `json:"collection,omitempty"`
	Important   *bool     `json:"important,omitempty"`
	PleaseParse *struct{} `json:"pleaseParse,omitempty"`
}

type Filters

type Filters struct {
	Result     bool  `json:"result"`
	Broken     Count `json:"broken"`
	Duplicates Count `json:"duplicates"`
	Important  Count `json:"important"`
	NoTag      Count `json:"notag"`
	Tags       []Tag `json:"tags"`
	Types      []Tag `json:"types"`
}

type ListOptions

type ListOptions struct {
	CollectionID int64
	Search       string
	Sort         string
	Page         int
	PerPage      int
	Nested       bool
}

type Raindrop

type Raindrop struct {
	ID         int64    `json:"_id"`
	Title      string   `json:"title"`
	Link       string   `json:"link"`
	Domain     string   `json:"domain"`
	Excerpt    string   `json:"excerpt"`
	Note       string   `json:"note"`
	Type       string   `json:"type"`
	Tags       []string `json:"tags"`
	Important  bool     `json:"important"`
	Collection Ref      `json:"collection"`
	Created    string   `json:"created"`
	LastUpdate string   `json:"lastUpdate"`
}

type Ref

type Ref struct {
	ID int64 `json:"$id"`
}

type Tag

type Tag struct {
	ID    string `json:"_id"`
	Count int64  `json:"count"`
}

type UserStats

type UserStats struct {
	Result bool `json:"result"`
	Items  []struct {
		ID    int64 `json:"_id"`
		Count int64 `json:"count"`
	} `json:"items"`
	Meta struct {
		Pro        bool  `json:"pro"`
		ID         int64 `json:"_id"`
		Duplicates Count `json:"duplicates"`
		Broken     Count `json:"broken"`
	} `json:"meta"`
}

Jump to

Keyboard shortcuts

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