29 lines
442 B
Go
29 lines
442 B
Go
package api
|
|
|
|
import (
|
|
"github.com/google/wire"
|
|
"leafdev.top/Leaf/leaf-library-3/internal/api/grpc"
|
|
"leafdev.top/Leaf/leaf-library-3/internal/api/http"
|
|
)
|
|
|
|
var Provide = wire.NewSet(
|
|
grpc.ProviderSet,
|
|
http.ProviderSet,
|
|
NewApi,
|
|
)
|
|
|
|
type Api struct {
|
|
GRPC *grpc.Handlers
|
|
HTTP *http.Handlers
|
|
}
|
|
|
|
func NewApi(
|
|
grpcHandlers *grpc.Handlers,
|
|
httpHandlers *http.Handlers,
|
|
) *Api {
|
|
return &Api{
|
|
GRPC: grpcHandlers,
|
|
HTTP: httpHandlers,
|
|
}
|
|
}
|