All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.src.config.storage-configuration.d.ts Maven / Gradle / Ivy

The newest version!
import { MomentoLoggerFactory, RetryStrategy } from '../';
import { StorageTransportStrategy } from './transport/storage';
/**
 * Configuration options for Momento StorageClient
 *
 * @export
 * @interface StorageConfiguration
 */
export interface StorageConfiguration {
    /**
     * @returns {MomentoLoggerFactory} the current configuration options for logging verbosity and format
     */
    getLoggerFactory(): MomentoLoggerFactory;
    /**
     * @returns {StorageTransportStrategy} the current configuration options for wire interactions with the Momento service
     */
    getTransportStrategy(): StorageTransportStrategy;
    /**
     * @returns {RetryStrategy} the current configuration options for how and when failed requests will be retried
     */
    getRetryStrategy(): RetryStrategy;
    /**
     * Convenience copy constructor that updates the client-side timeout setting in the TransportStrategy
     * @param {number} clientTimeoutMillis
     * @returns {StorageConfiguration} a new Configuration object with its TransportStrategy updated to use the specified client timeout
     */
    withClientTimeoutMillis(clientTimeoutMillis: number): StorageConfiguration;
    /**
     * Copy constructor for overriding TransportStrategy
     * @param {StorageTransportStrategy} transportStrategy
     * @returns {StorageConfiguration} a new Configuration object with the specified TransportStrategy
     */
    withTransportStrategy(transportStrategy: StorageTransportStrategy): StorageConfiguration;
    /**
     * Copy constructor for overriding RetryStrategy
     * @param {RetryStrategy} retryStrategy
     * @returns {StorageConfiguration} a new Configuration object with the specified RetryStrategy
     */
    withRetryStrategy(retryStrategy: RetryStrategy): StorageConfiguration;
}
export interface StorageConfigurationProps {
    /**
     * Configures logging verbosity and format
     */
    loggerFactory: MomentoLoggerFactory;
    /**
     * Configures low-level options for network interactions with the Momento service
     */
    transportStrategy: StorageTransportStrategy;
    /**
     * Configures how and when failed requests will be retried
     */
    retryStrategy: RetryStrategy;
}
export declare class StorageClientConfiguration implements StorageConfiguration {
    private readonly loggerFactory;
    private readonly transportStrategy;
    private readonly retryStrategy;
    constructor(props: StorageConfigurationProps);
    getLoggerFactory(): MomentoLoggerFactory;
    getTransportStrategy(): StorageTransportStrategy;
    getRetryStrategy(): RetryStrategy;
    withClientTimeoutMillis(clientTimeoutMillis: number): StorageConfiguration;
    withTransportStrategy(transportStrategy: StorageTransportStrategy): StorageConfiguration;
    withRetryStrategy(retryStrategy: RetryStrategy): StorageConfiguration;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy