Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class WolfClientBuilder

    A builder for WolfClient.

    Inheritance
    System.Object
    WolfClientBuilder
    Namespace: TehGM.Wolfringo
    Assembly: Wolfringo.Core.dll
    Syntax
    public class WolfClientBuilder

    Constructors

    | Improve this Doc View Source

    WolfClientBuilder()

    Creates a new WolfClient builder with default values pre-set.

    Declaration
    public WolfClientBuilder()
    | Improve this Doc View Source

    WolfClientBuilder(IServiceCollection)

    Creates a new WolfClient builder with provided services.

    Declaration
    public WolfClientBuilder(IServiceCollection services)
    Parameters
    Type Name Description
    Microsoft.Extensions.DependencyInjection.IServiceCollection services

    Initial services to use.

    Properties

    | Improve this Doc View Source

    Options

    Options for the client.

    Declaration
    public WolfClientOptions Options { get; set; }
    Property Value
    Type Description
    WolfClientOptions

    Methods

    | Improve this Doc View Source

    Build()

    Builds a new WolfClient with provided values.

    Declaration
    public WolfClient Build()
    Returns
    Type Description
    WolfClient

    A new WolfClient instance,

    Exceptions
    Type Condition
    System.ArgumentNullException

    Server URL is null.

    | Improve this Doc View Source

    Build(out IServiceProvider)

    Builds a new WolfClient with provided values.

    Declaration
    public WolfClient Build(out IServiceProvider services)
    Parameters
    Type Name Description
    System.IServiceProvider services

    The built service provider.

    Returns
    Type Description
    WolfClient

    A new WolfClient instance,

    Exceptions
    Type Condition
    System.ArgumentNullException

    Server URL is null.

    | Improve this Doc View Source

    ConfigureOptions(Action<WolfClientOptions>)

    Allows configuring options for Wolf Client.

    Declaration
    public WolfClientBuilder ConfigureOptions(Action<WolfClientOptions> configure)
    Parameters
    Type Name Description
    System.Action<WolfClientOptions> configure

    Delegate that can be used for options configuration.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    | Improve this Doc View Source

    WithBetaServerURL()

    Sets WOLF server URL to beta/rc value.

    Declaration
    public WolfClientBuilder WithBetaServerURL()
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    See Also
    BetaServerURL
    WithDefaultServerURL()
    WithServerURL(String)
    | Improve this Doc View Source

    WithCaching(IWolfClientCache)

    Sets entity cache container that client will use.

    Declaration
    public WolfClientBuilder WithCaching(IWolfClientCache cache)
    Parameters
    Type Name Description
    IWolfClientCache cache

    The entity cache container.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    | Improve this Doc View Source

    WithCaching<TImplementation>()

    Sets entity cache container that client will use.

    Declaration
    public WolfClientBuilder WithCaching<TImplementation>()
        where TImplementation : class, IWolfClientCache
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Type Parameters
    Name Description
    TImplementation

    Type of entity cache container.

    | Improve this Doc View Source

    WithDefaultCaching()

    Switches to default entity cache container with all caches enabled.

    Declaration
    public WolfClientBuilder WithDefaultCaching()
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    WolfClientCache will be used.

    | Improve this Doc View Source

    WithDefaultCaching(WolfCacheOptions)

    Switches to default entity cache container.

    Declaration
    public WolfClientBuilder WithDefaultCaching(WolfCacheOptions options)
    Parameters
    Type Name Description
    WolfCacheOptions options

    Options for the default entity cache container.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    WolfClientCache will be used.

    | Improve this Doc View Source

    WithDefaultMessageSerializers()

    Switches to default message serializers provider with default options to use for serializing messages.

    Declaration
    public WolfClientBuilder WithDefaultMessageSerializers()
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    MessageSerializerProvider will be used.

    See Also
    WithMessageSerializers(ISerializerProvider<String, IMessageSerializer>)
    | Improve this Doc View Source

    WithDefaultMessageSerializers(MessageSerializerProviderOptions)

    Switches to default message serializers provider to use for serializing messages.

    Declaration
    public WolfClientBuilder WithDefaultMessageSerializers(MessageSerializerProviderOptions options)
    Parameters
    Type Name Description
    MessageSerializerProviderOptions options

    Options for the default provider.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    MessageSerializerProvider will be used.

    See Also
    WithMessageSerializers(ISerializerProvider<String, IMessageSerializer>)
    | Improve this Doc View Source

    WithDefaultResponseSerializers()

    Switches to default response serializers provider with default options to use for deserializing responses.

    Declaration
    public WolfClientBuilder WithDefaultResponseSerializers()
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    ResponseSerializerProvider will be used.

    See Also
    WithResponseSerializers(ISerializerProvider<Type, IResponseSerializer>)
    | Improve this Doc View Source

    WithDefaultResponseSerializers(ResponseSerializerProviderOptions)

    Switches to default response serializers provider to use for deserializing responses.

    Declaration
    public WolfClientBuilder WithDefaultResponseSerializers(ResponseSerializerProviderOptions options)
    Parameters
    Type Name Description
    ResponseSerializerProviderOptions options

    Options for the default provider.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    ResponseSerializerProvider will be used.

    See Also
    WithResponseSerializers(ISerializerProvider<Type, IResponseSerializer>)
    | Improve this Doc View Source

    WithDefaultResponseTypeResolver()

    Switches to default response type resolver to use for deserializing responses.

    Declaration
    public WolfClientBuilder WithDefaultResponseTypeResolver()
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    ResponseTypeResolver will be used.

    See Also
    WithResponseTypeResolver(IResponseTypeResolver)
    | Improve this Doc View Source

    WithDefaultServerURL()

    Sets WOLF server URL to default value.

    Declaration
    public WolfClientBuilder WithDefaultServerURL()
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    See Also
    DefaultServerURL
    WithBetaServerURL()
    WithServerURL(String)
    | Improve this Doc View Source

    WithDefaultSocketClient()

    Switches to default socket client.

    Declaration
    public WolfClientBuilder WithDefaultSocketClient()
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    SocketClient will be used.

    See Also
    WithResponseTypeResolver(IResponseTypeResolver)
    | Improve this Doc View Source

    WithDefaultTokenProvider()

    Switches to default token provider to generate a token for connection.

    Declaration
    public WolfClientBuilder WithDefaultTokenProvider()
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    RandomizedWolfTokenProvider will be used.

    Using this method disables token set by using WithToken(String).

    See Also
    WithTokenProvider(IWolfTokenProvider)
    WithToken(String)
    | Improve this Doc View Source

    WithDevice(WolfDevice)

    Sets device to connect as.

    Declaration
    public WolfClientBuilder WithDevice(WolfDevice device)
    Parameters
    Type Name Description
    WolfDevice device

    Device to connect as.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    | Improve this Doc View Source

    WithLogging(ILogger)

    Sets a logger to be used by the client.

    Declaration
    public WolfClientBuilder WithLogging(ILogger logger)
    Parameters
    Type Name Description
    Microsoft.Extensions.Logging.ILogger logger

    Logger to use.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    | Improve this Doc View Source

    WithLogging(ILoggerFactory)

    Sets a logger factory that will be used to create a logger.

    Declaration
    public WolfClientBuilder WithLogging(ILoggerFactory factory)
    Parameters
    Type Name Description
    Microsoft.Extensions.Logging.ILoggerFactory factory

    Logger factory to use when creating a logger.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    | Improve this Doc View Source

    WithMessageSerializers(ISerializerProvider<String, IMessageSerializer>)

    Sets message serializers provider to use for serializing messages.

    Declaration
    public WolfClientBuilder WithMessageSerializers(ISerializerProvider<string, IMessageSerializer> provider)
    Parameters
    Type Name Description
    ISerializerProvider<System.String, IMessageSerializer> provider

    Serializers provider.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Exceptions
    Type Condition
    System.ArgumentNullException

    provider is null.

    See Also
    WithDefaultMessageSerializers()
    | Improve this Doc View Source

    WithMessageSerializers<TImplementation>()

    Sets message serializers provider to use for serializing messages.

    Declaration
    public WolfClientBuilder WithMessageSerializers<TImplementation>()
        where TImplementation : class, ISerializerProvider<string, IMessageSerializer>
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Type Parameters
    Name Description
    TImplementation

    Type of serializers provider.

    Remarks

    TImplementation must have a constructar that can be resolved from provided services.

    See Also
    WithDefaultMessageSerializers()
    | Improve this Doc View Source

    WithResponseSerializers(ISerializerProvider<Type, IResponseSerializer>)

    Sets response serializers provider to use for deserializing responses.

    Declaration
    public WolfClientBuilder WithResponseSerializers(ISerializerProvider<Type, IResponseSerializer> provider)
    Parameters
    Type Name Description
    ISerializerProvider<System.Type, IResponseSerializer> provider

    Serializers provider.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Exceptions
    Type Condition
    System.ArgumentNullException

    provider is null.

    See Also
    WithDefaultResponseSerializers()
    | Improve this Doc View Source

    WithResponseSerializers<TImplementation>()

    Sets response serializers provider to use for deserializing messages.

    Declaration
    public WolfClientBuilder WithResponseSerializers<TImplementation>()
        where TImplementation : class, ISerializerProvider<Type, IResponseSerializer>
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Type Parameters
    Name Description
    TImplementation

    Type of serializers provider.

    Remarks

    TImplementation must have a constructar that can be resolved from provided services.

    See Also
    WithDefaultResponseSerializers()
    | Improve this Doc View Source

    WithResponseTypeResolver(IResponseTypeResolver)

    Sets response type resolver to use for deserializing responses.

    Declaration
    public WolfClientBuilder WithResponseTypeResolver(IResponseTypeResolver resolver)
    Parameters
    Type Name Description
    IResponseTypeResolver resolver

    Response type resolver.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Exceptions
    Type Condition
    System.ArgumentNullException

    resolver is null.

    See Also
    WithDefaultResponseTypeResolver()
    | Improve this Doc View Source

    WithResponseTypeResolver<TImplementation>()

    Sets response type resolver to use for deserializing responses.

    Declaration
    public WolfClientBuilder WithResponseTypeResolver<TImplementation>()
        where TImplementation : class, IResponseTypeResolver
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Type Parameters
    Name Description
    TImplementation

    Type of response type resolver.

    Remarks

    TImplementation must have a constructar that can be resolved from provided services.

    See Also
    WithDefaultResponseTypeResolver()
    | Improve this Doc View Source

    WithServerURL(String)

    Sets WOLF server URL to connect to.

    Declaration
    public WolfClientBuilder WithServerURL(string url)
    Parameters
    Type Name Description
    System.String url

    WOLF server URL to connect to.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Exceptions
    Type Condition
    System.ArgumentNullException

    url is null, empty or whitespace.

    See Also
    WithDefaultServerURL()
    WithBetaServerURL()
    | Improve this Doc View Source

    WithService<TService>(TService)

    Adds any custom service so it can be resolved during Dependency Injection.

    Declaration
    public WolfClientBuilder WithService<TService>(TService service)
        where TService : class
    Parameters
    Type Name Description
    TService service

    The service instance.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Type Parameters
    Name Description
    TService

    Type of the service.

    | Improve this Doc View Source

    WithService<TService>(Func<IServiceProvider, TService>)

    Adds any custom service so it can be resolved during Dependency Injection.

    Declaration
    public WolfClientBuilder WithService<TService>(Func<IServiceProvider, TService> factory)
        where TService : class
    Parameters
    Type Name Description
    System.Func<System.IServiceProvider, TService> factory

    Delegate that will be invoked when the service is resolved.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Type Parameters
    Name Description
    TService

    Type of the service.

    | Improve this Doc View Source

    WithService<TService, TImplementation>()

    Adds any custom service so it can be resolved during Dependency Injection.

    Declaration
    public WolfClientBuilder WithService<TService, TImplementation>()
        where TService : class where TImplementation : class, TService
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Type Parameters
    Name Description
    TService

    Type of the service.

    TImplementation

    Implementation type of the service

    | Improve this Doc View Source

    WithSocketClient(ISocketClient)

    Sets the underlying socket client.

    Declaration
    public WolfClientBuilder WithSocketClient(ISocketClient client)
    Parameters
    Type Name Description
    ISocketClient client

    Socket client.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Exceptions
    Type Condition
    System.ArgumentNullException

    client is null.

    See Also
    WithDefaultSocketClient()
    | Improve this Doc View Source

    WithSocketClient<TImplementation>()

    Sets the underlying socket client.

    Declaration
    public WolfClientBuilder WithSocketClient<TImplementation>()
        where TImplementation : class, ISocketClient
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Type Parameters
    Name Description
    TImplementation

    Type of response type resolver.

    Remarks

    TImplementation must have a constructar that can be resolved from provided services.

    See Also
    WithDefaultSocketClient()
    | Improve this Doc View Source

    WithToken(String)

    Sets a specific token to use for connection.

    Declaration
    public WolfClientBuilder WithToken(string token)
    Parameters
    Type Name Description
    System.String token

    Token value.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    Using this method disables IWolfTokenProvider set by using WithTokenProvider(IWolfTokenProvider) and WithDefaultTokenProvider().

    Exceptions
    Type Condition
    System.ArgumentNullException

    token is null, empty or whitespace.

    See Also
    WithDefaultTokenProvider()
    WithTokenProvider(IWolfTokenProvider)
    | Improve this Doc View Source

    WithTokenProvider(IWolfTokenProvider)

    Sets token provider used to generate a token for connection.

    Declaration
    public WolfClientBuilder WithTokenProvider(IWolfTokenProvider provider)
    Parameters
    Type Name Description
    IWolfTokenProvider provider

    Token provider.

    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Remarks

    Using this method disables token set by using WithToken(String).

    Exceptions
    Type Condition
    System.ArgumentNullException

    provider is null.

    See Also
    WithDefaultTokenProvider()
    WithToken(String)
    | Improve this Doc View Source

    WithTokenProvider<TImplementation>()

    Sets token provider used to generate a token for connection.

    Declaration
    public WolfClientBuilder WithTokenProvider<TImplementation>()
        where TImplementation : class, IWolfTokenProvider
    Returns
    Type Description
    WolfClientBuilder

    Current builder instance.

    Type Parameters
    Name Description
    TImplementation

    Type of token provider.

    Remarks

    Using this method disables token set by using WithToken(String).

    TImplementation must have a constructar that can be resolved from provided services.

    See Also
    WithDefaultTokenProvider()
    WithToken(String)

    Events

    | Improve this Doc View Source

    Building

    Invoked when the builder is about to build a new instance of WolfClient.

    Declaration
    public event Action<IServiceCollection> Building
    Event Type
    Type Description
    System.Action<Microsoft.Extensions.DependencyInjection.IServiceCollection>
    | Improve this Doc View Source

    Built

    Invoked when the builder has finished building a new instance of WolfClient.

    Declaration
    public event Action<WolfClient, IServiceProvider> Built
    Event Type
    Type Description
    System.Action<WolfClient, System.IServiceProvider>

    Extension Methods

    WolfClientBuilderUtilitiesExtensions.WithAutoReconnection(WolfClientBuilder, Action<ReconnectorConfig>)
    WolfClientBuilderCommandsExtensions.WithCommands(WolfClientBuilder, Action<CommandsServiceBuilder>)