Documentation ¶
Index ¶
- Variables
- type API
- type APIIdent
- type CacheEntry
- type Request
- func (r *Request) ApplyCache(c *CacheEntry)
- func (r *Request) ApplyResponse(resp *napping.Response)
- func (r *Request) CacheRead() error
- func (r *Request) CacheWrite() error
- func (r *Request) Do() (err error)
- func (r *Request) Error(err error)
- func (r *Request) Lock() error
- func (r *Request) LogStatus()
- func (r *Request) Marshal() ([]byte, error)
- func (r *Request) MarshalCache() ([]byte, error)
- func (r *Request) Prepare() (err error)
- func (r *Request) Reset()
- func (r *Request) Size(size uint64)
- func (r *Request) String() string
- func (r *Request) Unlock() error
- func (r *Request) Unmarshal(b *bytes.Buffer) error
- func (r *Request) UnmarshalCache(b *bytes.Buffer) (*CacheEntry, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TMDBAPI = &API{ Ident: TMDBIdent, Endpoint: "https://api.themoviedb.org/3", RetriesLeft: 3, RateLimiter: util.NewRateLimiter(50, 1*time.Second, 50), } TraktAPI = &API{ Ident: TraktIdent, Endpoint: "https://api.trakt.tv", RetriesLeft: 3, RateLimiter: util.NewRateLimiter(100, 10*time.Second, 25), } FanartAPI = &API{ Ident: FanArtIdent, Endpoint: "http://webservice.fanart.tv/v3", RetriesLeft: 3, RateLimiter: util.NewRateLimiter(100, 10*time.Second, 25), } OpenSubtitlesAPI = &API{ Ident: OpenSubtitlesIdent, Endpoint: "https://api.opensubtitles.com/api/v1", RetriesLeft: 3, RateLimiter: util.NewRateLimiter(100, 10*time.Second, 25), } )
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct { Ident APIIdent RateLimiter *util.RateLimiter Endpoint string RetriesLeft int }
func (*API) GetSession ¶
type CacheEntry ¶
type Request ¶
type Request struct { trace.Tracer API *API Method string URL string Params url.Values `msg:"-"` Header http.Header `msg:"-"` Payload *bytes.Buffer Description string Retry int RetryBackoff time.Duration ResponseError error ResponseStatus string ResponseStatusCode int ResponseHeader http.Header ResponseBody *bytes.Buffer ResponseSize uint64 ResponseIgnore []int Result any Cache bool CacheExpire time.Duration CacheForceExpire bool CacheKey string // contains filtered or unexported fields }
func (*Request) ApplyCache ¶
func (r *Request) ApplyCache(c *CacheEntry)
func (*Request) ApplyResponse ¶
func (*Request) CacheWrite ¶
func (*Request) MarshalCache ¶
func (*Request) UnmarshalCache ¶
func (r *Request) UnmarshalCache(b *bytes.Buffer) (*CacheEntry, error)
Click to show internal directories.
Click to hide internal directories.