agecem-org/pkg/agecemorg/response.go
Victor Lacasse-Beaudoin 7d4a747774 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
2024-09-27 20:25:12 -04:00

110 lines
1.6 KiB
Go

/*
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
}