feat: mem, local uploader
This commit is contained in:
25
internal/api/api.go
Normal file
25
internal/api/api.go
Normal file
@ -0,0 +1,25 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/loveuer/nf"
|
||||
"nf-repo/internal/handler"
|
||||
"nf-repo/internal/interfaces"
|
||||
"nf-repo/internal/opt"
|
||||
)
|
||||
|
||||
func NewApi(
|
||||
ctx context.Context,
|
||||
bh interfaces.BlobHandler,
|
||||
uh interfaces.UploadHandler,
|
||||
mh interfaces.ManifestHandler,
|
||||
) *nf.App {
|
||||
app := nf.New(nf.Config{BodyLimit: opt.DefaultMaxSize})
|
||||
|
||||
{
|
||||
api := app.Group("/v2")
|
||||
api.Any("/*path", handler.Root(bh, uh, mh))
|
||||
}
|
||||
|
||||
return app
|
||||
}
|
Reference in New Issue
Block a user