s2

Module client

Source
Expand description

SDK client implementation.

The module defines three clients:

OperationsAPI Service
ClientAccount level operationsAccountService
BasinClientBasin level operationsBasinService
StreamClientStream level operationsStreamService

To interact with any client, you need an authentication token which can be generated by the the web console at s2.dev. This token is passed to the client via a ClientConfig.

Along with the authentication token, a ClientConfig defines other request parameters such as timeouts, S2 endpoints, etc.

A client can be created using the corresponding new() method. To avoid creating multiple connections to each service, Client::basin_client can be used to create a BasinClient and BasinClient::stream_client can be used to create a StreamClient.

Note: Even though the client creation operation is cheap, a BasinClient should preferably be stored instead of using Client::basin_client multiple times as the account endpoint might vary from the basin endpoint creating a new connection each time the request is sent. See S2Endpoints.

Structs§

Enums§