Module client

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§

BasinClient
Client for basin-level operations.
Client
Client for account-level operations.
ClientConfig
Client configuration.
S2Endpoints
Endpoints for the S2 environment.
StreamClient
Client for stream-level operations.

Enums§

AppendRetryPolicy
Retry policy for append requests.
BasinEndpoint
Endpoint for connecting to an S2 basin.
ClientError
Error from client operations.
S2Cloud
S2 cloud environment to connect with.