@@ -4,16 +4,18 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"git.unistack.org/unistack-org/pkgdash/internal/storage"
|
||||
pb "git.unistack.org/unistack-org/pkgdash/proto"
|
||||
"github.com/google/uuid"
|
||||
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v4"
|
||||
"go.unistack.org/micro/v4/codec"
|
||||
jsonpbcodec "go.unistack.org/micro-codec-jsonpb/v3"
|
||||
"go.unistack.org/micro/v3/codec"
|
||||
"go.unistack.org/micro/v3/logger"
|
||||
"go.unistack.org/pkgdash/internal/storage"
|
||||
pb "go.unistack.org/pkgdash/proto"
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
store storage.Storage
|
||||
codec codec.Codec
|
||||
logger logger.Logger
|
||||
store storage.Storage
|
||||
codec codec.Codec
|
||||
}
|
||||
|
||||
func NewNotFoundError(err error) *pb.ErrorRsp {
|
||||
@@ -43,10 +45,11 @@ func NewValidationError(err error) *pb.ErrorRsp {
|
||||
}
|
||||
}
|
||||
|
||||
func NewHandler(store storage.Storage) (*Handler, error) {
|
||||
func NewHandler(log logger.Logger, store storage.Storage) (*Handler, error) {
|
||||
h := &Handler{
|
||||
codec: jsonpbcodec.NewCodec(),
|
||||
store: store,
|
||||
logger: log,
|
||||
codec: jsonpbcodec.NewCodec(),
|
||||
store: store,
|
||||
}
|
||||
|
||||
return h, nil
|
||||
|
Reference in New Issue
Block a user