-
Notifications
You must be signed in to change notification settings - Fork 31
/
wire_gen.go
44 lines (37 loc) Β· 1.06 KB
/
wire_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package copper
import (
"github.com/gocopper/copper/cconfig"
"github.com/gocopper/copper/clifecycle"
"github.com/gocopper/copper/clogger"
"github.com/google/wire"
)
// Injectors from wire.go:
// InitApp creates a new Copper app along with its dependencies.
func InitApp() (*App, error) {
lifecycle := clifecycle.New()
flags := NewFlags()
path := flags.ConfigPath
overrides := flags.ConfigOverrides
loader, err := cconfig.NewWithKeyOverrides(path, overrides)
if err != nil {
return nil, err
}
config, err := clogger.LoadConfig(loader)
if err != nil {
return nil, err
}
logger, err := clogger.NewWithConfig(config)
if err != nil {
return nil, err
}
app := NewApp(lifecycle, loader, logger)
return app, nil
}
// wire.go:
// WireModule can be used as part of google/wire setup to include the app's
// lifecycle, config, and logger.
var WireModule = wire.NewSet(wire.FieldsOf(new(*App), "Lifecycle", "Config", "Logger"))