pocket

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID          = "pocket"
	ClientIdKey = "consumer_key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeResponse

type CodeResponse struct {
	Code  string `json:"code"`
	State string `json:"state"`
}

type Item

type Item struct {
	Id            string `json:"item_id"`
	ResolvedId    string `json:"resolved_id"`
	GivenUrl      string `json:"given_url"`
	GivenTitle    string `json:"given_title"`
	Favorite      string `json:"favorite"`
	Status        string `json:"status"`
	TimeAdded     string `json:"time_added"`
	TimeUpdated   string `json:"time_updated"`
	TimeRead      string `json:"time_read"`
	TimeFavorited string `json:"time_favorited"`
	ResolvedTitle string `json:"resolved_title"`
	ResolvedUrl   string `json:"resolved_url"`
	Excerpt       string `json:"excerpt"`
	IsArticle     string `json:"is_article"`
	IsIndex       string `json:"is_index"`
	HasVideo      string `json:"has_video"`
	HasImage      string `json:"has_image"`
	WordCount     string `json:"word_count"`
}

type ItemResponse

type ItemResponse struct {
	Status int  `json:"status"`
	Item   Item `json:"item"`
}

type ListResponse

type ListResponse struct {
	Status int             `json:"status"`
	List   map[string]Item `json:"list"`
}

type Pocket

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

func NewPocket

func NewPocket(clientId, clientSecret, redirectURI, accessToken string) *Pocket

func (*Pocket) Add

func (v *Pocket) Add(url string) (int, error)

func (*Pocket) GetAccessToken

func (v *Pocket) GetAccessToken(_ *fiber.Ctx) (types.KV, error)

func (*Pocket) GetAuthorizeURL

func (v *Pocket) GetAuthorizeURL() string

func (*Pocket) GetCode

func (v *Pocket) GetCode(state string) (*CodeResponse, error)

func (*Pocket) Redirect

func (v *Pocket) Redirect(_ *http.Request) (string, error)

func (*Pocket) Retrieve

func (v *Pocket) Retrieve(count int) (*ListResponse, error)

type TokenResponse

type TokenResponse struct {
	AccessToken string `json:"access_token"`
	Username    string `json:"username"`
}

Jump to

Keyboard shortcuts

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