refactor: déplacer fichiers go source vers pkg/ et cmd/
Déplacer public/ et templates/ vers ui/ et ui/public/ Bump projet à v3, API toujours v1
This commit is contained in:
parent
e46033d4a9
commit
7d4a747774
107 changed files with 68 additions and 107 deletions
110
pkg/agecemorg/response.go
Normal file
110
pkg/agecemorg/response.go
Normal file
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
File response.go contains the JSON and HTML response types for HTTP endpoints.
|
||||
|
||||
Le fichier response.go contient les types de réponses JSON et HTML pour les endpoints HTTP.
|
||||
*/
|
||||
package agecemorg
|
||||
|
||||
import (
|
||||
"codeberg.org/vlbeaudoin/voki/v3"
|
||||
)
|
||||
|
||||
type APIResponse struct {
|
||||
voki.MessageResponse
|
||||
statusCode int
|
||||
Error string
|
||||
}
|
||||
|
||||
func (R APIResponse) StatusCode() int {
|
||||
return R.statusCode
|
||||
}
|
||||
|
||||
func (R *APIResponse) SetStatusCode(code int) {
|
||||
R.statusCode = code
|
||||
}
|
||||
|
||||
type ListBucketsResponse struct {
|
||||
APIResponse
|
||||
Data struct {
|
||||
Buckets map[string]string
|
||||
}
|
||||
}
|
||||
|
||||
type ReadBucketResponse struct {
|
||||
APIResponse
|
||||
Data struct {
|
||||
Keys []string
|
||||
}
|
||||
}
|
||||
|
||||
type DataDocument struct {
|
||||
Key string
|
||||
Size int64
|
||||
}
|
||||
|
||||
type CreateDocumentsResponse struct {
|
||||
APIResponse
|
||||
Data struct {
|
||||
Bucket string
|
||||
Documents []DataDocument
|
||||
}
|
||||
}
|
||||
|
||||
type CreateDocumentResponse struct {
|
||||
APIResponse
|
||||
Data struct {
|
||||
Bucket string
|
||||
DataDocument
|
||||
}
|
||||
}
|
||||
|
||||
type DeleteDocumentResponse struct {
|
||||
APIResponse
|
||||
}
|
||||
|
||||
type UpdateDocumentKeyResponse struct {
|
||||
APIResponse
|
||||
Data struct {
|
||||
Bucket string
|
||||
Key string
|
||||
}
|
||||
}
|
||||
|
||||
type ExecuteSeedResponse struct {
|
||||
APIResponse
|
||||
Data struct {
|
||||
Buckets []string
|
||||
}
|
||||
}
|
||||
|
||||
type ReadSpecResponse struct {
|
||||
APIResponse
|
||||
Data struct {
|
||||
Spec string
|
||||
}
|
||||
}
|
||||
|
||||
type HandleAdminDocumentsUploadResponse struct {
|
||||
APIResponse
|
||||
Data struct {
|
||||
Buckets []Bucket
|
||||
}
|
||||
}
|
||||
|
||||
type HandleDocumentationResponse struct {
|
||||
APIResponse
|
||||
Data struct {
|
||||
Buckets []Bucket
|
||||
}
|
||||
}
|
||||
|
||||
type UploadDocumentAPIResponse struct {
|
||||
APIResponse
|
||||
Data UploadDocumentResponseData
|
||||
}
|
||||
|
||||
type UploadDocumentResponseData struct {
|
||||
Bucket string
|
||||
Object string
|
||||
Size float64
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue