Skip to main content

Module client

Module client 

Source
Expand description

RedseatClient: authenticated requests to one server, with the server token refreshed before it expires. Port of @redseat/api client.ts.

Structs§

AuthorizedUrl
A server URL with the token that opens it, for code that fetches the file itself (a video player, a browser). Send the token in a header with Self::authorization, or in the URL with Self::with_token_query when the fetcher cannot set headers. The token expires at Self::expires: ask for a new URL before then.
ClientOptions
How to build a RedseatClient.
CloudTokenSource
Server tokens from the cloud, for a signed-in user.
EventOptions
Options of RedseatClient::subscribe_events.
RedseatClient
Client of one Redseat server. Cheap to clone; clones share the token.

Constants§

DEFAULT_REFRESH_THRESHOLD
Default margin before expiry at which the server token is refreshed (5 minutes).

Traits§

ServerTokenSource
Gives fresh tokens for a server. CloudTokenSource asks the cloud.

Type Aliases§

ServerEventStream
Typed server events. Each item is an event, or an error for an event that could not be read (the stream goes on) or for a broken connection (the stream ends).