github.com/lovung/GoCleanArchitecture@v0.0.0-20210302152432-50d91fd29f9f/app/registry/wire.go (about)

     1  // +build wireinject
     2  // The build tag makes sure the stub is not built in the final build.
     3  
     4  package registry
     5  
     6  import (
     7  	"github.com/lovung/GoCleanArchitecture/app/internal/interface/restful/handler"
     8  	"github.com/lovung/GoCleanArchitecture/app/internal/interface/restful/middleware"
     9  
    10  	"github.com/google/wire"
    11  )
    12  
    13  // TransactionMiddleware DI for middleware
    14  func TransactionMiddleware() middleware.TransactionMiddleware {
    15  	wire.Build(txnMwSet)
    16  	return middleware.TransactionMiddleware{}
    17  }
    18  
    19  // AuthHandler DI for handler
    20  func AuthHandler() handler.AuthHandler {
    21  	wire.Build(authHanlderSet)
    22  	return handler.AuthHandler{}
    23  }