// Code generated by Wire. DO NOT EDIT.

//go:generate go run -mod=mod github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject

package app

import (
	"easyaudioencode/domain/version/versionapi"
	"easyaudioencode/internal/conf"
	"easyaudioencode/internal/core/host"
	"easyaudioencode/internal/core/media"
	"easyaudioencode/internal/core/transcode"
	"easyaudioencode/internal/data"
	"easyaudioencode/internal/web/api"
	"log/slog"
	"net/http"
)

// Injectors from wire.go:

func WireApp(bc *conf.Bootstrap, log *slog.Logger) (http.Handler, func(), error) {
	db, err := data.SetupDB(bc, log)
	if err != nil {
		return nil, nil, err
	}
	core := versionapi.NewVersionCore(db)
	versionapiAPI := versionapi.New(core)
	pullToPushCore := api.NewAudioEncodeCore(db)
	hostCore := host.NewCore(bc)
	mediaCore := media.NewCore(hostCore)
	transcodeCore := transcode.NewCore(hostCore, pullToPushCore)
	pullToPushAPI := api.NewAudioEncodeAPI(pullToPushCore, mediaCore,transcodeCore,hostCore, bc)

	usecase := &api.Usecase{
		Conf:        bc,
		DB:          db,
		Version:     versionapiAPI,
		AudioEncodeCore: pullToPushCore,
		AudioEncodeAPI: pullToPushAPI,
		HostCore:    hostCore,
		MediaCore:   mediaCore,
		TranscodeCore:  transcodeCore,
	}
	handler := api.NewHTTPHandler(usecase)
	return handler, func() {
		//mediaCore.Close()
	}, nil
}
