github.com/timoth-y/kicksware-api/order-service@v0.0.0-20201002192818-87b546a7ae5a/container/factory/gatewayHandlerFactory.go (about)

     1  package factory
     2  
     3  import (
     4  	"github.com/go-chi/chi"
     5  
     6  	"github.com/timoth-y/kicksware-api/order-service/api/gRPC"
     7  	"github.com/timoth-y/kicksware-api/order-service/api/rest"
     8  	"github.com/timoth-y/kicksware-api/order-service/core/service"
     9  	"github.com/timoth-y/kicksware-api/order-service/env"
    10  )
    11  
    12  func ProvideRESTGatewayHandler(service service.OrderService, auth service.AuthService, config env.ServiceConfig) *rest.Handler {
    13  	return rest.NewHandler(service, auth, config.Common)
    14  }
    15  
    16  func ProvideGRPCGatewayHandler(service service.OrderService, auth service.AuthService, config env.ServiceConfig) *gRPC.Handler {
    17  	return gRPC.NewHandler(service, auth, config.Common)
    18  }
    19  
    20  func ProvideEndpointRouter(handler *rest.Handler) chi.Router {
    21  	return rest.ProvideRoutes(handler)
    22  }