using Microsoft.Extensions.DependencyInjection;
using NetworkResurrector.Server.Wrapper.Models;
using NetworkResurrector.Server.Wrapper.Services;
using NetworkResurrector.Server.Wrapper.Services.Internal;

namespace NetworkResurrector.Server.Wrapper
{
    public static class DependencyInjectionExtension
    {
        public static void UseResurrectorServices(this IServiceCollection services, string baseAddress, bool forwardHeaders = true)
        {
            services.AddSingleton(new ServiceConfiguration(baseAddress, forwardHeaders));
            services.AddScoped<HttpHeadersService>();
            services.AddHttpClient<IResurrectorService, ResurrectorService>();
        }
    }
}