pinboard

package module
v0.0.0-...-39ec4c1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2014 License: MIT Imports: 10 Imported by: 0

README

pinboard api in golang

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTooManyRequests = PinboardError("429: Too Many Requests")
	ErrForbidden       = PinboardError("403: Forbidden")
)

Functions

func GetAuthToken

func GetAuthToken(username, password string) (string, error)

func ValidateURL

func ValidateURL(u string) error

Types

type AddPostOptions

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

func (*AddPostOptions) Description

func (ap *AddPostOptions) Description(s string) *AddPostOptions

func (*AddPostOptions) Do

func (ap *AddPostOptions) Do() error

func (*AddPostOptions) Replace

func (ap *AddPostOptions) Replace(b bool) *AddPostOptions

func (*AddPostOptions) Shared

func (ap *AddPostOptions) Shared(b bool) *AddPostOptions

func (*AddPostOptions) Tag

func (ap *AddPostOptions) Tag(s string) *AddPostOptions

func (*AddPostOptions) Time

func (ap *AddPostOptions) Time(t *time.Time) *AddPostOptions

func (*AddPostOptions) Title

func (ap *AddPostOptions) Title(t string) *AddPostOptions

func (*AddPostOptions) Toread

func (ap *AddPostOptions) Toread(b bool) *AddPostOptions

func (*AddPostOptions) URL

func (ap *AddPostOptions) URL(u string) *AddPostOptions

type FilterFunc

type FilterFunc func(*Post) bool

type GetAllPostsOptions

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

func (*GetAllPostsOptions) Do

func (gp *GetAllPostsOptions) Do() ([]*Post, error)

func (*GetAllPostsOptions) From

func (*GetAllPostsOptions) Meta

func (*GetAllPostsOptions) Results

func (gp *GetAllPostsOptions) Results(i int) *GetAllPostsOptions

func (*GetAllPostsOptions) Start

func (*GetAllPostsOptions) Tag

func (*GetAllPostsOptions) To

type GetPostsOptions

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

func (*GetPostsOptions) Do

func (gp *GetPostsOptions) Do() ([]*Post, error)

func (*GetPostsOptions) Meta

func (gp *GetPostsOptions) Meta(b bool) *GetPostsOptions

func (*GetPostsOptions) Tags

func (gp *GetPostsOptions) Tags(s string) *GetPostsOptions

func (*GetPostsOptions) Time

func (gp *GetPostsOptions) Time(t *time.Time) *GetPostsOptions

func (*GetPostsOptions) URL

type GetRecentPostsOptions

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

func (*GetRecentPostsOptions) Count

func (*GetRecentPostsOptions) Do

func (rp *GetRecentPostsOptions) Do() ([]*Post, error)

func (*GetRecentPostsOptions) Tags

type Pinboard

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

func New

func New(token string) *Pinboard

func NewWithPassword

func NewWithPassword(username, password string) *Pinboard

func (*Pinboard) AddPost

func (p *Pinboard) AddPost(url, title string) error

func (*Pinboard) AddPostWith

func (p *Pinboard) AddPostWith(url, title string) *AddPostOptions

func (*Pinboard) DeletePost

func (p *Pinboard) DeletePost(url string) error

func (*Pinboard) DeleteTag

func (p *Pinboard) DeleteTag(tag string) error

func (*Pinboard) GetAllPosts

func (p *Pinboard) GetAllPosts() ([]*Post, error)

func (*Pinboard) GetAllPostsWith

func (p *Pinboard) GetAllPostsWith() *GetAllPostsOptions

func (*Pinboard) GetAllTags

func (p *Pinboard) GetAllTags() (TagCloud, error)

func (*Pinboard) GetPost

func (p *Pinboard) GetPost(url string) (*Post, error)

func (*Pinboard) GetPosts

func (p *Pinboard) GetPosts() ([]*Post, error)

func (*Pinboard) GetPostsAtDates

func (p *Pinboard) GetPostsAtDates() ([]PostsAtDates, error)

func (*Pinboard) GetPostsWith

func (p *Pinboard) GetPostsWith() *GetPostsOptions

func (*Pinboard) GetRecentPosts

func (p *Pinboard) GetRecentPosts() ([]*Post, error)

func (*Pinboard) GetRecentPostsWith

func (p *Pinboard) GetRecentPostsWith() *GetRecentPostsOptions

func (*Pinboard) GetSuggestedTags

func (p *Pinboard) GetSuggestedTags(url string) (popular, recommended []string, err error)

func (*Pinboard) GetUpdatedTime

func (p *Pinboard) GetUpdatedTime() (*time.Time, error)

func (*Pinboard) GetUserSecret

func (p *Pinboard) GetUserSecret() (string, error)

func (*Pinboard) RenameTag

func (p *Pinboard) RenameTag(o, n string) error

type PinboardAPIError

type PinboardAPIError string

func (PinboardAPIError) Error

func (e PinboardAPIError) Error() string

type PinboardError

type PinboardError string

func (PinboardError) Error

func (e PinboardError) Error() string

type Post

type Post struct {
	URL         string    `json:"href"`
	Title       string    `json:"title"`
	Description string    `json:"description"`
	Hash        string    `json:"hash"`
	Meta        string    `json:"meta"`
	Shared      bool      `json:"shared"`
	Tag         string    `json:"tag"`
	User        string    `json:"user"`
	Time        time.Time `json:"time"`
	Toread      bool      `json:"toread"`
	Others      int       `json:"others"`
}

func ParsePost

func ParsePost(i interface{}) (*Post, error)

type PostsAtDates

type PostsAtDates struct {
	Date  time.Time
	Count int
}

type TagCloud

type TagCloud []struct {
	Tag   string
	Count string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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