pocket

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: MIT 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 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) AuthorizeURL

func (v *Pocket) AuthorizeURL() string

func (*Pocket) GetAccessToken

func (v *Pocket) GetAccessToken(code string) (interface{}, error)

func (*Pocket) GetCode

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

func (*Pocket) Redirect added in v0.0.17

func (v *Pocket) Redirect(c *fiber.Ctx, mid pb.MiddleClient) error

func (*Pocket) Retrieve

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

func (*Pocket) SetRDB added in v0.0.17

func (v *Pocket) SetRDB(rdb *redis.Client)

func (*Pocket) StoreAccessToken added in v0.0.17

func (v *Pocket) StoreAccessToken(c *fiber.Ctx, mid pb.MiddleClient) 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