Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache is the interface that the debrid clients uses for caching a user's API token validity and the "instant availability" of a torrent (via info_hash). A package user must pass an implementation of this interface. Usually you create a simple wrapper around an existing cache package. An example implementation is the InMemoryCache in this package.
type InMemoryCache ¶
type InMemoryCache struct {
// contains filtered or unexported fields
}
InMemoryCache is an example implementation of the Cache interface. It doesn't persist its data, so it's not suited for production use of the debrid packages.
func NewInMemoryCache ¶
func NewInMemoryCache() *InMemoryCache
NewInMemoryCache creates a new InMemoryCache.
func (*InMemoryCache) Get ¶
Get returns the time the API token / "instant availability" was cached. The boolean return value signals if the value was found in the cache.
func (*InMemoryCache) Set ¶
func (c *InMemoryCache) Set(key string) error
Set caches the validity of a user's API token or the "instant availability" for a torrent (via info_hash). There's no need to pass a boolean or so - if a value gets cached it means the token is valid / the torrent is "instantly available".