public static IServiceCollection AddWebhooksServer(this IServiceCollection services, Action <WebhooksHttpClientOptions> configure)
        {
            var options = new WebhooksHttpClientOptions();

            configure.Invoke(options);

            return(AddWebhooksServer(services, options: options));
        }
예제 #2
0
 public WebhooksManager(IWebhooksStorageProvider storageProvider, WebhooksHttpClientOptions options)
 {
     _storageProvider = storageProvider;
     Options          = options;
     _httpClient      = new WebhooksHttpClient(Options.PayloadSigningSecret)
     {
         BaseAddress = Options.ServerBaseUri,
         Timeout     = Options.RequestTimeout
     };
 }
 public InMemoryWebhooksManager(IWebhooksStorageProvider storageProvider, WebhooksHttpClientOptions options) : base(storageProvider, options)
 {
 }
 public HangfireWebhooksManager(IWebhooksStorageProvider storageProvider, WebhooksHttpClientOptions options) : base(storageProvider, options)
 {
 }
        public static IServiceCollection AddWebhooksServer(this IServiceCollection services, WebhooksHttpClientOptions options)
        {
            if (options == null)
            {
                throw new InvalidOperationException("The webhooks HTTP client options are missing.  Please check your configuration.");
            }

            services.AddSingleton(options);
            services.AddSingleton <IWebhooksStorageProvider, InMemoryWebhooksStorageProvider>();
            services.AddSingleton <IWebhooksManager, InMemoryWebhooksManager>();

            return(services);
        }