<commit_before>// Code generated by Wire. DO NOT EDIT.

//go:generate wire
//+build !wireinject

package main

import (
	"context"
	"database/sql"
	"github.com/gilcrest/go-api-basic/app"
	"github.com/gilcrest/go-api-basic/datastore"
	"github.com/gilcrest/go-api-basic/handler"
	"github.com/google/wire"
	"github.com/gorilla/mux"
	"github.com/rs/zerolog"
	"go.opencensus.io/trace"
	"gocloud.dev/server"
	"gocloud.dev/server/driver"
	"gocloud.dev/server/health"
	"gocloud.dev/server/health/sqlhealth"
	"gocloud.dev/server/requestlog"
	"net/http"
	"time"
)

// Injectors from inject_main.go:

func setupLocal(ctx context.Context, envName app.EnvName, dsName datastore.DSName, loglvl zerolog.Level) (*server.Server, func(), error) {
	db, cleanup, err := datastore.NewLocalDB(dsName)
	if err != nil {
		return nil, nil, err
	}
	datastoreDatastore, err := datastore.NewDatastore(dsName, db)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	logger := newLogger(loglvl)
	application := app.NewApplication(envName, datastoreDatastore, logger)
	appHandler := handler.NewAppHandler(application)
	router := newRouter(appHandler)
	mainRequestLogger := newRequestLogger(logger)
	v, cleanup2 := appHealthChecks(dsName, db)
	exporter := _wireExporterValue
	sampler := trace.AlwaysSample()
	defaultDriver := server.NewDefaultDriver()
	options := &server.Options{
		RequestLogger:         mainRequestLogger,
		HealthChecks:          v,
		TraceExporter:         exporter,
		DefaultSamplingPolicy: sampler,
		Driver:                defaultDriver,
	}
	serverServer := server.New(router, options)
	return serverServer, func() {
		cleanup2()
		cleanup()
	}, nil
}

var (
	_wireExporterValue = trace.Exporter(nil)
)

func setupLocalMock(ctx context.Context, envName app.EnvName, dsName datastore.DSName, loglvl zerolog.Level) (*server.Server, func(), error) {
	db := datastore.NewMockDB(dsName)
	datastoreDatastore, err := datastore.NewDatastore(dsName, db)
	if err != nil {
		return nil, nil, err
	}
	logger := newLogger(loglvl)
	application := app.NewApplication(envName, datastoreDatastore, logger)
	appHandler := handler.NewAppHandler(application)
	router := newRouter(appHandler)
	mainRequestLogger := newRequestLogger(logger)
	v, cleanup := appHealthChecks(dsName, db)
	exporter := _wireTraceExporterValue
	sampler := trace.AlwaysSample()
	defaultDriver := server.NewDefaultDriver()
	options := &server.Options{
		RequestLogger:         mainRequestLogger,
		HealthChecks:          v,
		TraceExporter:         exporter,<commit_msg>Latest<commit_after>// Code generated by Wire. DO NOT EDIT.

//go:generate wire
//+build !wireinject

package main

import (
	"context"
	"database/sql"
	"github.com/gilcrest/go-api-basic/app"
	"github.com/gilcrest/go-api-basic/datastore"
	"github.com/gilcrest/go-api-basic/handler"
	"github.com/google/wire"
	"github.com/gorilla/mux"
	"github.com/rs/zerolog"
	"go.opencensus.io/trace"
	"gocloud.dev/server"
	"gocloud.dev/server/driver"
	"gocloud.dev/server/health"
	"gocloud.dev/server/health/sqlhealth"
	"gocloud.dev/server/requestlog"
	"net/http"
	"time"
)

// Injectors from inject_main.go:

func setupApp(ctx context.Context, envName app.EnvName, dsName datastore.DSName, loglvl zerolog.Level) (*server.Server, func(), error) {
	db, cleanup, err := datastore.NewDB(dsName)
	if err != nil {
		return nil, nil, err
	}
	datastoreDatastore, err := datastore.NewDatastore(dsName, db)
	if err != nil {
		cleanup()
		return nil, nil, err
	}
	logger := newLogger(loglvl)
	application := app.NewApplication(envName, datastoreDatastore, logger)
	appHandler := handler.NewAppHandler(application)
	router := newRouter(appHandler)
	mainRequestLogger := newRequestLogger(logger)
	v, cleanup2 := appHealthChecks(dsName, db)
	exporter := _wireExporterValue
	sampler := trace.AlwaysSample()
	defaultDriver := server.NewDefaultDriver()
	options := &server.Options{
		RequestLogger:         mainRequestLogger,
		HealthChecks:          v,
		TraceExporter:         exporter,
		DefaultSamplingPolicy: sampler,
		Driver:                defaultDriver,
	}
	serverServer := server.New(router, options)
	return serverServer, func() {
		cleanup2()
		cleanup()
	}, nil
}

var (
	_wireExporterValue = trace.Exporter(nil)
)

func setupAppwMock(ctx context.Context, envName app.EnvName, dsName datastore.DSName, loglvl zerolog.Level) (*server.Server, func(), error) {
	db := datastore.NewMockDB(dsName)
	datastoreDatastore, err := datastore.NewDatastore(dsName, db)
	if err != nil {
		return nil, nil, err
	}
	logger := newLogger(loglvl)
	application := app.NewApplication(envName, datastoreDatastore, logger)
	appHandler := handler.NewAppHandler(application)
	router := newRouter(appHandler)
	mainRequestLogger := newRequestLogger(logger)
	v, cleanup := appHealthChecks(dsName, db)
	exporter := _wireTraceExporterValue
	sampler := trace.AlwaysSample()
	defaultDriver := server.NewDefaultDriver()
	options := &server.Options{
		RequestLogger:         mainRequestLogger,
		HealthChecks:          v,
		TraceExporter:         exporter,
{'fraction_non_alphanumeric': 0.12542305395182163, 'fraction_numerical': 0.0007963368504877563, 'mean_word_length': 4.576026637069923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4062356', 'n_tokens_mistral': 1798, 'n_tokens_neox': 1747, 'n_words': 339}