realdebrid

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClientOpts = ClientOptions{
	BaseURL:  "https://api.real-debrid.com",
	Timeout:  5 * time.Second,
	CacheAge: 24 * time.Hour,
}

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(opts ClientOptions, tokenCache, availabilityCache debrid.Cache, logger *zap.Logger) (*Client, error)

func (*Client) CheckInstantAvailability

func (c *Client) CheckInstantAvailability(ctx context.Context, keyOrToken string, infoHashes ...string) []string

func (*Client) GetStreamURL

func (c *Client) GetStreamURL(ctx context.Context, magnetURL, keyOrToken string, remote bool) (string, error)

func (*Client) TestToken

func (c *Client) TestToken(ctx context.Context, keyOrToken string) error

type ClientOptions

type ClientOptions struct {
	BaseURL      string
	Timeout      time.Duration
	CacheAge     time.Duration
	ExtraHeaders []string
	// When setting this to true, the user's original IP address is read from the context parameter with the key "debrid_originIP".
	ForwardOriginIP bool
}

func NewClientOpts

func NewClientOpts(baseURL string, timeout, cacheAge time.Duration, extraHeaders []string, forwardOriginIP bool) ClientOptions

Jump to

Keyboard shortcuts

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