feat: funciones Go para API Metabase y tipo MetabaseClient
Añade funciones Go stub para la API de Metabase en dominio infra: auth, CRUD de cards, dashboards y users, execute_query y execute_card. Incluye tipo MetabaseClient y helper HTTP compartido. Todas las funciones son impuras con stubs not-implemented.
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
---
|
||||
name: metabase_get_card
|
||||
kind: function
|
||||
lang: go
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "func MetabaseGetCard(client MetabaseClient, cardID int) (map[string]any, error)"
|
||||
description: "Obtiene los detalles completos de una card/pregunta de Metabase por su ID. Incluye la query, visualizacion y metadata. Endpoint: GET /api/card/:id."
|
||||
tags: [metabase, card, question, get, api]
|
||||
uses_functions: []
|
||||
uses_types: [MetabaseClient_go_infra]
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: "error_go_core"
|
||||
imports: [fmt]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "functions/infra/metabase_get_card.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```go
|
||||
card, err := MetabaseGetCard(client, 42)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println(card["name"], card["display"])
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Retorna el objeto card completo. Error 404 si no existe.
|
||||
|
||||
### Campos principales
|
||||
|
||||
| Campo | Tipo | Descripcion |
|
||||
|-------|------|-------------|
|
||||
| id | float64 | ID de la card |
|
||||
| name | string | Nombre |
|
||||
| description | string | Descripcion |
|
||||
| display | string | Tipo visualizacion |
|
||||
| dataset_query | map | Query (native.query para SQL, query para MBQL) |
|
||||
| visualization_settings | map | Config de visualizacion |
|
||||
| collection_id | float64 | Coleccion contenedora |
|
||||
| database_id | float64 | Database asociada |
|
||||
| archived | bool | Archivada |
|
||||
| creator | map | Objeto del usuario creador |
|
||||
| created_at | string | Fecha creacion |
|
||||
| updated_at | string | Fecha actualizacion |
|
||||
Reference in New Issue
Block a user