// 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 cc

import (
	"github.com/aserto-dev/certs"
	"github.com/aserto-dev/logger"
	logger2 "github.com/aserto-dev/runtime/logger"
	"github.com/aserto-dev/topaz/pkg/cc/config"
	"github.com/aserto-dev/topaz/pkg/cc/context"
	"github.com/google/wire"
)

// Injectors from wire.go:

// buildCC sets up the CC struct that contains all dependencies that
// are cross cutting
func buildCC(logOutput logger.Writer, errOutput logger.ErrWriter, configPath config.Path, overrides config.Overrider) (*CC, func(), error) {
	errGroupAndContext := context.NewContext()
	contextContext := errGroupAndContext.Ctx
	loggerConfig, err := config.NewLoggerConfig(configPath, overrides)
	if err != nil {
		return nil, nil, err
	}
	zerologLogger, err := logger2.NewLogger(logOutput, errOutput, loggerConfig)
	if err != nil {
		return nil, nil, err
	}
	generator := certs.NewGenerator(zerologLogger)
	configConfig, err := config.NewConfig(configPath, zerologLogger, overrides, generator)
	if err != nil {
		return nil, nil, err
	}
	group := errGroupAndContext.ErrGroup
	ccCC := &CC{
		Context:  contextContext,
		Config:   configConfig,
		Log:      zerologLogger,
		ErrGroup: group,
	}
	return ccCC, func() {
	}, nil
}

func buildTestCC(logOutput logger.Writer, errOutput logger.ErrWriter, configPath config.Path, overrides config.Overrider) (*CC, func(), error) {
	errGroupAndContext := context.NewTestContext()
	contextContext := errGroupAndContext.Ctx
	loggerConfig, err := config.NewLoggerConfig(configPath, overrides)
	if err != nil {
		return nil, nil, err
	}
	zerologLogger, err := logger2.NewLogger(logOutput, errOutput, loggerConfig)
	if err != nil {
		return nil, nil, err
	}
	generator := certs.NewGenerator(zerologLogger)
	configConfig, err := config.NewConfig(configPath, zerologLogger, overrides, generator)
	if err != nil {
		return nil, nil, err
	}
	group := errGroupAndContext.ErrGroup
	ccCC := &CC{
		Context:  contextContext,
		Config:   configConfig,
		Log:      zerologLogger,
		ErrGroup: group,
	}
	return ccCC, func() {
	}, nil
}

// wire.go:

var (
	commonSet = wire.NewSet(config.NewConfig, config.NewLoggerConfig, logger2.NewLogger, certs.NewGenerator, wire.Struct(new(CC), "*"), wire.FieldsOf(new(*context.ErrGroupAndContext), "Ctx", "ErrGroup"))

	ccSet = wire.NewSet(
		commonSet, context.NewContext,
	)

	ccTestSet = wire.NewSet(
		commonSet, context.NewTestContext,
	)
)
