client

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReusableReader

func ReusableReader(r io.Reader) io.Reader

Types

type ApiError

type ApiError struct {
	StatusCode int
	// contains filtered or unexported fields
}

func (*ApiError) Error

func (e *ApiError) Error() string

type IMDbClient

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

func (*IMDbClient) ListExport

func (c *IMDbClient) ListExport(id string) error

func (*IMDbClient) ListsExport

func (c *IMDbClient) ListsExport(ids ...string) error

func (*IMDbClient) ListsGet

func (c *IMDbClient) ListsGet(ids ...string) ([]entities.IMDbList, error)

func (*IMDbClient) RatingsExport

func (c *IMDbClient) RatingsExport() error

func (*IMDbClient) RatingsGet

func (c *IMDbClient) RatingsGet() ([]entities.IMDbItem, error)

func (*IMDbClient) WatchlistExport

func (c *IMDbClient) WatchlistExport() error

func (*IMDbClient) WatchlistGet

func (c *IMDbClient) WatchlistGet() (*entities.IMDbList, error)

type IMDbClientInterface

type IMDbClientInterface interface {
	ListsExport(ids ...string) error
	ListsGet(ids ...string) ([]entities.IMDbList, error)
	WatchlistExport() error
	WatchlistGet() (*entities.IMDbList, error)
	RatingsExport() error
	RatingsGet() ([]entities.IMDbItem, error)
}

func NewIMDbClient

func NewIMDbClient(ctx context.Context, conf *appconfig.IMDb, logger *slog.Logger) (IMDbClientInterface, error)

type TraktClient

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

func (*TraktClient) Activate

func (tc *TraktClient) Activate(userCode, authenticityToken string) (*string, error)

func (*TraktClient) ActivateAuthorize

func (tc *TraktClient) ActivateAuthorize(authenticityToken string) error

func (*TraktClient) BrowseActivate

func (tc *TraktClient) BrowseActivate() (*string, error)

func (*TraktClient) BrowseSignIn

func (tc *TraktClient) BrowseSignIn() (*string, error)

func (*TraktClient) GetAccessToken

func (tc *TraktClient) GetAccessToken(deviceCode string) (*entities.TraktAuthTokensResponse, error)

func (*TraktClient) GetAuthCodes

func (tc *TraktClient) GetAuthCodes() (*entities.TraktAuthCodesResponse, error)

func (*TraktClient) HistoryAdd

func (tc *TraktClient) HistoryAdd(items entities.TraktItems) error

func (*TraktClient) HistoryGet

func (tc *TraktClient) HistoryGet(itemType, itemID string) (entities.TraktItems, error)

func (*TraktClient) HistoryRemove

func (tc *TraktClient) HistoryRemove(items entities.TraktItems) error

func (*TraktClient) ListAdd

func (tc *TraktClient) ListAdd(listID, listName string) error

func (*TraktClient) ListGet

func (tc *TraktClient) ListGet(listID string) (*entities.TraktList, error)

func (*TraktClient) ListItemsAdd

func (tc *TraktClient) ListItemsAdd(listID string, items entities.TraktItems) error

func (*TraktClient) ListItemsRemove

func (tc *TraktClient) ListItemsRemove(listID string, items entities.TraktItems) error

func (*TraktClient) ListRemove

func (tc *TraktClient) ListRemove(listID string) error

func (*TraktClient) ListsGet

func (tc *TraktClient) ListsGet(idsMeta entities.TraktIDMetas) ([]entities.TraktList, []error)

func (*TraktClient) RatingsAdd

func (tc *TraktClient) RatingsAdd(items entities.TraktItems) error

func (*TraktClient) RatingsGet

func (tc *TraktClient) RatingsGet() (entities.TraktItems, error)

func (*TraktClient) RatingsRemove

func (tc *TraktClient) RatingsRemove(items entities.TraktItems) error

func (*TraktClient) SignIn

func (tc *TraktClient) SignIn(authenticityToken string) error

func (*TraktClient) WatchlistGet

func (tc *TraktClient) WatchlistGet() (*entities.TraktList, error)

func (*TraktClient) WatchlistItemsAdd

func (tc *TraktClient) WatchlistItemsAdd(items entities.TraktItems) error

func (*TraktClient) WatchlistItemsRemove

func (tc *TraktClient) WatchlistItemsRemove(items entities.TraktItems) error

type TraktClientInterface

type TraktClientInterface interface {
	BrowseSignIn() (*string, error)
	SignIn(authenticityToken string) error
	BrowseActivate() (*string, error)
	Activate(userCode, authenticityToken string) (*string, error)
	ActivateAuthorize(authenticityToken string) error
	GetAccessToken(deviceCode string) (*entities.TraktAuthTokensResponse, error)
	GetAuthCodes() (*entities.TraktAuthCodesResponse, error)
	WatchlistGet() (*entities.TraktList, error)
	WatchlistItemsAdd(items entities.TraktItems) error
	WatchlistItemsRemove(items entities.TraktItems) error
	ListGet(listID string) (*entities.TraktList, error)
	ListsGet(idMeta entities.TraktIDMetas) ([]entities.TraktList, []error)
	ListItemsAdd(listID string, items entities.TraktItems) error
	ListItemsRemove(listID string, items entities.TraktItems) error
	ListAdd(listID, listName string) error
	ListRemove(listID string) error
	RatingsGet() (entities.TraktItems, error)
	RatingsAdd(items entities.TraktItems) error
	RatingsRemove(items entities.TraktItems) error
	HistoryGet(itemType, itemID string) (entities.TraktItems, error)
	HistoryAdd(items entities.TraktItems) error
	HistoryRemove(items entities.TraktItems) error
}

func NewTraktClient

func NewTraktClient(conf appconfig.Trakt, logger *slog.Logger) (TraktClientInterface, error)

type TraktListNotFoundError

type TraktListNotFoundError struct {
	Slug string
}

func (*TraktListNotFoundError) Error

func (e *TraktListNotFoundError) Error() string

Jump to

Keyboard shortcuts

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