28 lines
492 B
Go
28 lines
492 B
Go
//go:build wireinject
|
|
// +build wireinject
|
|
|
|
package wirex
|
|
|
|
// The build tag makes sure the stub is not built in the final build.
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/google/wire"
|
|
|
|
"ifms/internal/mods"
|
|
"ifms/pkg/util"
|
|
)
|
|
|
|
func BuildInjector(ctx context.Context) (*Injector, func(), error) {
|
|
wire.Build(
|
|
InitCacher,
|
|
InitDB,
|
|
InitAuth,
|
|
wire.NewSet(wire.Struct(new(util.Trans), "*")),
|
|
wire.NewSet(wire.Struct(new(Injector), "*")),
|
|
mods.Set,
|
|
) // end
|
|
return new(Injector), nil, nil
|
|
}
|