putio

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound check whether given error is a not found error.

Types

type Client

type Client struct {
	*putio.Client
	Rss RssService
	// contains filtered or unexported fields
}

Client is a Put.io client on top of github.com/putdotio/go-putio Add missing features like RSS management.

func New

func New(ctx context.Context, httpClient *http.Client) *Client

type Feed

type Feed struct {
	ID                   *uint  `json:"id"`
	Title                string `json:"title"`
	RssSourceURL         string `json:"rss_source_url"`
	ParentDirID          uint   `json:"parent_dir_id"`
	DeleteOldFiles       bool   `json:"delete_old_files"`
	DontProcessWholeFeed bool   `json:"dont_process_whole_feed"`
	Keyword              string `json:"keyword"`
	UnwantedKeywords     string `json:"unwanted_keywords"`
	Paused               bool   `json:"paused"`

	Extract         bool   `json:"extract"`
	FailedItemCount uint   `json:"failed_item_count"`
	LastError       string `json:"last_error"`
	LastFetch       Time   `json:"last_fetch"`
	CreatedAt       Time   `json:"created_at"`
	PausedAt        Time   `json:"paused_at"`
	StartAt         Time   `json:"start_at"`
	UpdatedAt       Time   `json:"updated_at"`
}

type InvalidStatusReceivedError

type InvalidStatusReceivedError struct {
	Status string
}

InvalidStatusReceivedError error from Putio when an update action is failed.

func (InvalidStatusReceivedError) Error

type RssService

type RssService interface {
	// List RSS feeds.
	List(ctx context.Context) ([]*Feed, error)
	// Get a RSS feed.
	Get(ctx context.Context, id uint) (*Feed, error)
	// Delete a RSS feed.
	Delete(ctx context.Context, id uint) error
	// Create an RSS feed.
	Create(ctx context.Context, feed *Feed) (*Feed, error)
	// Update an RSS feed.
	Update(ctx context.Context, feed *Feed, id uint) error
	// Pause given feed.
	Pause(ctx context.Context, id uint) error
	// Resume given feed.
	Resume(ctx context.Context, id uint) error
}

RssService ...

type Time

type Time struct {
	time.Time
}

func (*Time) GetTime

func (t *Time) GetTime() time.Time

func (*Time) MarshalJSON

func (t *Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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