Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentType ¶
type ContentType string
const ( ContentTypeArticle ContentType = "article" ContentTypeVideo ContentType = "video" ContentTypeImage ContentType = "image" )
type DetailType ¶
type DetailType string
const ( DetailTypeSimple DetailType = "simple" DetailTypeComplete DetailType = "complete" )
type FavoriteFilter ¶
type FavoriteFilter string
const ( FavoriteFilterUnspecified FavoriteFilter = "" FavoriteFilterUnfavorited FavoriteFilter = "0" FavoriteFilterFavorited FavoriteFilter = "1" )
type Item ¶
type Item struct {
ItemID int `json:"item_id,string"`
ResolvedId int `json:"resolved_id,string"`
GivenURL string `json:"given_url"`
ResolvedURL string `json:"resolved_url"`
GivenTitle string `json:"given_title"`
ResolvedTitle string `json:"resolved_title"`
Favorite int `json:",string"`
Status ItemStatus `json:",string"`
Excerpt string
IsArticle int `json:"is_article,string"`
HasImage ItemMediaAttachment `json:"has_image,string"`
HasVideo ItemMediaAttachment `json:"has_video,string"`
WordCount int `json:"word_count,string"`
// Fields for detailed response
Tags map[string]map[string]interface{}
Authors map[string]map[string]interface{}
Images map[string]map[string]interface{}
Videos map[string]map[string]interface{}
// Fields that are not documented but exist
SortId int `json:"sort_id"`
TimeAdded Time `json:"time_added"`
TimeUpdated Time `json:"time_updated"`
TimeRead Time `json:"time_read"`
TimeFavorited Time `json:"time_favorited"`
}
type ItemMediaAttachment ¶
type ItemMediaAttachment int
const ( ItemMediaAttachmentNoMedia ItemMediaAttachment = 0 ItemMediaAttachmentHasMedia ItemMediaAttachment = 1 ItemMediaAttachmentIsMedia ItemMediaAttachment = 2 )
type ItemStatus ¶
type ItemStatus int
const ( ItemStatusUnread ItemStatus = 0 ItemStatusArchived ItemStatus = 1 ItemStatusDeleted ItemStatus = 2 )
type Pocket ¶
type Pocket struct {
UpdateFrequency time.Duration `envconfig:"UPDATE_FREQUENCY" default:"1h" required:"true" desc:"How often to query getPocket"`
HealthCheck time.Duration `envconfig:"HEALTH_CHECK" default:"30s" required:"true"`
URL string `envconfig:"POCKET_URL" default:"https://getpocket.com/v3/get" required:"true"`
ConsumerKey string `envconfig:"CONSUMER_KEY" required:"true" desc:"See https://getpocket.com/developer/apps/ to get a consumer key"`
Username string `envconfig:"USERNAME" desc:"The pocket username (will try to fetch it if not found)"`
Token string `envconfig:"TOKEN" desc:"The access token, will try to fetch it if not found or invalid"`
ItemsC chan Item `ignored:"true"`
// contains filtered or unexported fields
}
type RetrieveOption ¶
type RetrieveOption struct {
ConsumerKey string `json:"consumer_key"`
AccessToken string `json:"access_token"`
State State `json:"state,omitempty"`
Favorite FavoriteFilter `json:"favorite,omitempty"`
Tag string `json:"tag,omitempty"`
ContentType ContentType `json:"contentType,omitempty"`
Sort Sort `json:"sort,omitempty"`
DetailType DetailType `json:"detailType,omitempty"`
Search string `json:"search,omitempty"`
Domain string `json:"domain,omitempty"`
Since int `json:"since,omitempty"`
Count int `json:"count,omitempty"`
Offset int `json:"offset,omitempty"`
}
RetrieveOption is the options for retrieve API.
type RetrieveResult ¶
Click to show internal directories.
Click to hide internal directories.