Documentation
¶
Index ¶
- type AuthToken
- type Client
- type Date
- type NotesService
- type Post
- type PostsService
- func (s *PostsService) Add(urlStr, title, description string, tags []string, creationTime *time.Time, ...) (*http.Response, error)
- func (s *PostsService) All(tags []string, start int, results int, fromdt, todt *time.Time) ([]*Post, *http.Response, error)
- func (s *PostsService) Dates(tags []string) ([]*Date, *http.Response, error)
- func (s *PostsService) Delete(urlStr string) (*http.Response, error)
- func (s *PostsService) Get(tags []string, creationTime *time.Time, urlStr string) ([]*Post, *http.Response, error)
- func (s *PostsService) LastTimeUpdated() (*time.Time, *http.Response, error)
- func (s *PostsService) Recent(tags []string, count int) ([]*Post, *http.Response, error)
- func (s *PostsService) Suggest(urlStr string) ([]string, []string, *http.Response, error)
- type Tag
- type TagsService
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
BaseURL *url.URL
UserAgent string
Posts *PostsService
Tags *TagsService
User *UserService
Notes *NotesService
// contains filtered or unexported fields
}
func NewClient ¶
NewClient returns a new Pinboard API client. If a nil httpClient client is provided, http.DefaultClient will be used. If you want to do authenticated requests using HTTP Auth, you need to pass in an authenticated client - this library does not handle authentication.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is XML decoded and stored in the value pointed to by v, or returned as an error if an API error has occured. If v implements the io.Writer interface, the raw response will be written to v, without attempting to first decode it.
func (*Client) NewRequest ¶
NewRequest constructs a new request to the Pinboard API. A relative URL can be provided in urlStr, in which case it's resolved to the Client's BaseURL. Relative URLs should always be specified without a preceding slash. If the Client has an AuthToken set, then it is added to the urlParams.
type NotesService ¶
type NotesService struct {
// contains filtered or unexported fields
}
NotesService is the service for accessing Note-related calls from the Pinboard API.
type Post ¶
type Post struct {
Title string
Description string
Hash string
URL string
Tags []string
ToRead bool
Time *time.Time
}
Post represents a post stored in Pinboard. Fields are transformed from the actual response to be a bit more sane. For example, description from the response is renamed to Title and the extended field is renamed to Description.
type PostsService ¶
type PostsService struct {
// contains filtered or unexported fields
}
PostsService is the service for accessing Post-related calls from the Pinboard API.
func (*PostsService) Add ¶
func (s *PostsService) Add(urlStr, title, description string, tags []string, creationTime *time.Time, replace, shared, toread bool) (*http.Response, error)
Add creates a new Post for the authenticated account. urlStr and title are required.
func (*PostsService) All ¶
func (s *PostsService) All(tags []string, start int, results int, fromdt, todt *time.Time) ([]*Post, *http.Response, error)
All fetches all bookmarks in the user's account.
func (*PostsService) Delete ¶
func (s *PostsService) Delete(urlStr string) (*http.Response, error)
Delete deletes the specified Post from the authenticated account where urlStr is the URL of the Post to delete.
func (*PostsService) Get ¶
func (s *PostsService) Get(tags []string, creationTime *time.Time, urlStr string) ([]*Post, *http.Response, error)
Get returns one or more posts on a single day matching the arguments. If no date or url is given, date of most recent bookmark will be used.
func (*PostsService) LastTimeUpdated ¶
Returns the most recent time a bookmark was added, updated or deleted. Use this before calling posts/all to see if the data has changed since the last fetch.
func (*PostsService) Recent ¶
Recent fetches the most recent Posts for the authenticated account, filtered by tag. Up to 3 tags can be specified to filter by. The max count is 100. If a negative count is passed, then the default number of posts (15) is returned.
type TagsService ¶
type TagsService struct {
// contains filtered or unexported fields
}
TagsService is the service for accessing Tag-related calls from the Pinboard API.
func (*TagsService) Delete ¶
func (s *TagsService) Delete(tag string) (*http.Response, error)
Delete an existing tag.
func (*TagsService) Get ¶
func (s *TagsService) Get() ([]*Tag, *http.Response, error)
Returns a full list of the user's tags along with the number of times they were used.
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
UserService provides methods for accessing user actions through the Pinboard API.
func (*UserService) APIToken ¶
func (s *UserService) APIToken() (string, *http.Response, error)
APIToken returns the authenticated user's API token.
func (*UserService) SecretRSSKey ¶
func (s *UserService) SecretRSSKey() (string, *http.Response, error)
SecretRSSKey returns the authenticated user's secret RSS key for viewing private RSS feeds.