log.Fatal("Error during NewMediaClientFromViper for API handlers")
}
p:=pave.New()
v1Handler:=V1Handler{
Config:cfg,
MediaClient:mediaClient,
Pave:&p,
}
groupV1.GET("",v1Handler.ListRoutes)
iferr:=pave.EchoRegister[
ExecuteSeedRequest,
ExecuteSeedResponse](groupV1,&p,"/v1",http.MethodPost,"/seed","Créer buckets manquants définis dans `server.documents.buckets`","ExecuteSeed",v1Handler.ExecuteSeed);err!=nil{
log.Fatal(err)
}
iferr:=pave.EchoRegister[
UpdateDocumentKeyRequest,
UpdateDocumentKeyResponse](groupV1,&p,"/v1",http.MethodPut,"/bucket/:bucket/:document/key","Renommer un document","UpdateDocumentKey",v1Handler.UpdateDocumentKey);err!=nil{
CreateDocumentsResponse](groupV1,&p,"/v1",http.MethodPost,"/bucket/:bucket/many","Upload documents to specified bucket","CreateDocuments",v1Handler.CreateDocuments);err!=nil{
log.Fatal(err)
}
iferr:=pave.EchoRegister[
CreateDocumentRequest,
CreateDocumentResponse](groupV1,&p,"/v1",http.MethodPost,"/bucket/:bucket","Upload document to specified bucket","CreateDocument",v1Handler.CreateDocument);err!=nil{
log.Fatal(err)
}
// Do not move to pave, uses echo.Stream instead of echo.JSON
DeleteDocumentResponse](groupV1,&p,"/v1",http.MethodDelete,"/bucket/:bucket/:document","Delete document in specified bucket","DeleteDocument",v1Handler.DeleteDocument);err!=nil{