-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
wire_gen.go
53 lines (45 loc) · 1.59 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
45
46
47
48
49
50
51
52
53
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package di
import (
"context"
"github.com/nao1215/rainbow/app/domain/model"
"github.com/nao1215/rainbow/app/external"
"github.com/nao1215/rainbow/app/interactor"
"github.com/nao1215/rainbow/app/usecase"
)
// Injectors from wire.go:
// NewS3App creates a new S3App.
func NewS3App(ctx context.Context, profile model.AWSProfile, region model.Region) (*S3App, error) {
awsConfig, err := model.NewAWSConfig(ctx, profile, region)
if err != nil {
return nil, err
}
client, err := external.NewS3Client(awsConfig)
if err != nil {
return nil, err
}
s3BucketCreator := external.NewS3BucketCreator(client)
interactorS3BucketCreator := interactor.NewS3BucketCreator(s3BucketCreator)
s3BucketLister := external.NewS3BucketLister(client)
s3BucketLocationGetter := external.NewS3BucketLocationGetter(client)
interactorS3BucketLister := interactor.NewS3BucketLister(s3BucketLister, s3BucketLocationGetter)
s3App := newS3App(interactorS3BucketCreator, interactorS3BucketLister)
return s3App, nil
}
// wire.go:
// S3App is the application service for S3.
type S3App struct {
// S3BucketCreator is the usecase for creating a new S3 bucket.
S3BucketCreator usecase.S3BucketCreator
// S3BucketLister is the usecase for listing S3 buckets.
S3BucketLister usecase.S3BucketLister
}
func newS3App(s3bucketCreator usecase.S3BucketCreator, s3bucketLister usecase.S3BucketLister) *S3App {
return &S3App{
S3BucketCreator: s3bucketCreator,
S3BucketLister: s3bucketLister,
}
}