refactor: mover .go de tipos Go a functions/{domain}/ para compilación unificada
Los archivos .go de tipos ahora viven junto a las funciones en functions/{domain}/
(mismo paquete Go), resolviendo errores de compilación por tipos no encontrados
(Option, Pair, Result, etc.). Los .md de metadata permanecen en types/{domain}/
con file_path actualizado a functions/. Se elimina types.go duplicado de infra.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
package core
|
||||
|
||||
// Error is the standard error type for impure functions in the registry.
|
||||
// Wraps a message string. Used as error_type reference.
|
||||
type Error struct {
|
||||
Message string
|
||||
}
|
||||
|
||||
func (e Error) Error() string {
|
||||
return e.Message
|
||||
}
|
||||
+1
-1
@@ -11,5 +11,5 @@ definition: |
|
||||
description: "Tipo de error base del registry. Referenciado como error_type por funciones impuras."
|
||||
tags: [error, base, impure]
|
||||
uses_types: []
|
||||
file_path: "types/core/error.go"
|
||||
file_path: "functions/core/error.go"
|
||||
---
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
package core
|
||||
|
||||
// Option represents a value that may or may not be present.
|
||||
// A sum type: Some(T) | None.
|
||||
type Option[T any] struct {
|
||||
value *T
|
||||
}
|
||||
|
||||
// Some creates an Option containing a value.
|
||||
func Some[T any](v T) Option[T] {
|
||||
return Option[T]{value: &v}
|
||||
}
|
||||
|
||||
// None creates an empty Option.
|
||||
func None[T any]() Option[T] {
|
||||
return Option[T]{}
|
||||
}
|
||||
|
||||
// IsSome returns true if the Option contains a value.
|
||||
func (o Option[T]) IsSome() bool {
|
||||
return o.value != nil
|
||||
}
|
||||
|
||||
// IsNone returns true if the Option is empty.
|
||||
func (o Option[T]) IsNone() bool {
|
||||
return o.value == nil
|
||||
}
|
||||
|
||||
// Unwrap returns the value or panics if None.
|
||||
func (o Option[T]) Unwrap() T {
|
||||
if o.value == nil {
|
||||
panic("called Unwrap on None")
|
||||
}
|
||||
return *o.value
|
||||
}
|
||||
|
||||
// UnwrapOr returns the value or a default if None.
|
||||
func (o Option[T]) UnwrapOr(def T) T {
|
||||
if o.value != nil {
|
||||
return *o.value
|
||||
}
|
||||
return def
|
||||
}
|
||||
@@ -11,7 +11,7 @@ definition: |
|
||||
description: "Tipo suma generico que representa un valor opcional: Some(T) o None. Alternativa a punteros nil para modelar ausencia de valor de forma explicita."
|
||||
tags: [option, sum, nullable, functional, generic]
|
||||
uses_types: []
|
||||
file_path: "types/core/option.go"
|
||||
file_path: "functions/core/option.go"
|
||||
---
|
||||
|
||||
## Notas
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package core
|
||||
|
||||
// Pair holds two values of potentially different types.
|
||||
type Pair[A any, B any] struct {
|
||||
First A
|
||||
Second B
|
||||
}
|
||||
+1
-1
@@ -12,5 +12,5 @@ definition: |
|
||||
description: "Tipo producto generico que agrupa dos valores de tipos potencialmente distintos. Util para ZipSlices y operaciones que devuelven dos resultados."
|
||||
tags: [pair, tuple, product, generic]
|
||||
uses_types: []
|
||||
file_path: "types/core/pair.go"
|
||||
file_path: "functions/core/pair.go"
|
||||
---
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
package core
|
||||
|
||||
// Result is a sum type representing either a successful value or an error.
|
||||
// Exactly one of Ok or Err is non-nil at any time.
|
||||
type Result[T any] struct {
|
||||
ok *T
|
||||
err error
|
||||
}
|
||||
|
||||
// Ok creates a successful Result.
|
||||
func Ok[T any](v T) Result[T] {
|
||||
return Result[T]{ok: &v}
|
||||
}
|
||||
|
||||
// Err creates a failed Result.
|
||||
func Err[T any](err error) Result[T] {
|
||||
return Result[T]{err: err}
|
||||
}
|
||||
|
||||
// IsOk returns true if the Result contains a value.
|
||||
func (r Result[T]) IsOk() bool {
|
||||
return r.ok != nil
|
||||
}
|
||||
|
||||
// IsErr returns true if the Result contains an error.
|
||||
func (r Result[T]) IsErr() bool {
|
||||
return r.err != nil
|
||||
}
|
||||
|
||||
// Unwrap returns the value or panics if the Result is an error.
|
||||
func (r Result[T]) Unwrap() T {
|
||||
if r.ok == nil {
|
||||
panic("called Unwrap on an Err Result")
|
||||
}
|
||||
return *r.ok
|
||||
}
|
||||
|
||||
// UnwrapErr returns the error or panics if the Result is Ok.
|
||||
func (r Result[T]) UnwrapErr() error {
|
||||
if r.err == nil {
|
||||
panic("called UnwrapErr on an Ok Result")
|
||||
}
|
||||
return r.err
|
||||
}
|
||||
|
||||
// UnwrapOr returns the value or a default if the Result is an error.
|
||||
func (r Result[T]) UnwrapOr(def T) T {
|
||||
if r.ok != nil {
|
||||
return *r.ok
|
||||
}
|
||||
return def
|
||||
}
|
||||
@@ -12,7 +12,7 @@ definition: |
|
||||
description: "Tipo suma generico que representa exito (Ok) o fallo (Err). Permite componer operaciones que pueden fallar sin recurrir a multiples returns (T, error)."
|
||||
tags: [result, sum, error-handling, functional, generic]
|
||||
uses_types: []
|
||||
file_path: "types/core/result.go"
|
||||
file_path: "functions/core/result.go"
|
||||
---
|
||||
|
||||
## Notas
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestResultOk(t *testing.T) {
|
||||
r := Ok(42)
|
||||
if !r.IsOk() {
|
||||
t.Error("expected IsOk")
|
||||
}
|
||||
if r.IsErr() {
|
||||
t.Error("expected not IsErr")
|
||||
}
|
||||
if r.Unwrap() != 42 {
|
||||
t.Errorf("got %d, want 42", r.Unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
func TestResultErr(t *testing.T) {
|
||||
r := Err[int](errors.New("fail"))
|
||||
if r.IsOk() {
|
||||
t.Error("expected not IsOk")
|
||||
}
|
||||
if !r.IsErr() {
|
||||
t.Error("expected IsErr")
|
||||
}
|
||||
if r.UnwrapErr().Error() != "fail" {
|
||||
t.Errorf("got %v", r.UnwrapErr())
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnwrapOr(t *testing.T) {
|
||||
ok := Ok(10)
|
||||
if ok.UnwrapOr(0) != 10 {
|
||||
t.Error("UnwrapOr on Ok should return value")
|
||||
}
|
||||
|
||||
err := Err[int](errors.New("fail"))
|
||||
if err.UnwrapOr(99) != 99 {
|
||||
t.Error("UnwrapOr on Err should return default")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUnwrapPanics(t *testing.T) {
|
||||
defer func() {
|
||||
if recover() == nil {
|
||||
t.Error("Unwrap on Err should panic")
|
||||
}
|
||||
}()
|
||||
Err[int](errors.New("fail")).Unwrap()
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package cybersecurity
|
||||
|
||||
import "net"
|
||||
|
||||
// CIDRBlock represents a parsed CIDR network range.
|
||||
type CIDRBlock struct {
|
||||
Network *net.IPNet
|
||||
Broadcast net.IP
|
||||
Hosts int
|
||||
}
|
||||
@@ -13,5 +13,5 @@ definition: |
|
||||
description: "Rango de red CIDR parseado con network, broadcast y numero de hosts."
|
||||
tags: [cybersecurity, network, cidr, ip]
|
||||
uses_types: []
|
||||
file_path: "types/cybersecurity/cidr_block.go"
|
||||
file_path: "functions/cybersecurity/cidr_block.go"
|
||||
---
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package cybersecurity
|
||||
|
||||
// PortResult is a sum type for TCP port scan results.
|
||||
type PortResult interface{ portResult() }
|
||||
|
||||
// PortOpen indicates the port accepted a connection.
|
||||
type PortOpen struct {
|
||||
Port int
|
||||
Banner string
|
||||
}
|
||||
|
||||
// PortClosed indicates the port refused the connection.
|
||||
type PortClosed struct {
|
||||
Port int
|
||||
}
|
||||
|
||||
// PortFiltered indicates the port did not respond (timeout).
|
||||
type PortFiltered struct {
|
||||
Port int
|
||||
}
|
||||
|
||||
func (PortOpen) portResult() {}
|
||||
func (PortClosed) portResult() {}
|
||||
func (PortFiltered) portResult() {}
|
||||
@@ -12,5 +12,5 @@ definition: |
|
||||
description: "Tipo suma para resultados de escaneo TCP: Open (con banner), Closed o Filtered."
|
||||
tags: [cybersecurity, port, scan, network]
|
||||
uses_types: []
|
||||
file_path: "types/cybersecurity/port_result.go"
|
||||
file_path: "functions/cybersecurity/port_result.go"
|
||||
---
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package cybersecurity
|
||||
|
||||
// ThreatResult is a sum type for SQL injection detection results.
|
||||
type ThreatResult interface{ threatResult() }
|
||||
|
||||
// Clean indicates no threat was detected.
|
||||
type Clean struct{}
|
||||
|
||||
// Suspicious indicates a possible threat with a reason.
|
||||
type Suspicious struct {
|
||||
Reason string
|
||||
}
|
||||
|
||||
// Malicious indicates a confirmed threat pattern.
|
||||
type Malicious struct {
|
||||
Pattern string
|
||||
}
|
||||
|
||||
func (Clean) threatResult() {}
|
||||
func (Suspicious) threatResult() {}
|
||||
func (Malicious) threatResult() {}
|
||||
@@ -12,5 +12,5 @@ definition: |
|
||||
description: "Tipo suma para resultados de deteccion de amenazas: Clean, Suspicious o Malicious."
|
||||
tags: [cybersecurity, threat, detection, sqli]
|
||||
uses_types: []
|
||||
file_path: "types/cybersecurity/threat_result.go"
|
||||
file_path: "functions/cybersecurity/threat_result.go"
|
||||
---
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package datascience
|
||||
|
||||
// OutlierResult is a sum type representing whether a data point is normal or an outlier.
|
||||
type OutlierResult interface{ outlierResult() }
|
||||
|
||||
// Normal indicates the data point is within expected range.
|
||||
type Normal struct {
|
||||
Index int
|
||||
Value float64
|
||||
}
|
||||
|
||||
// Outlier indicates the data point is anomalous.
|
||||
type Outlier struct {
|
||||
Index int
|
||||
Value float64
|
||||
ZScore float64
|
||||
}
|
||||
|
||||
func (Normal) outlierResult() {}
|
||||
func (Outlier) outlierResult() {}
|
||||
@@ -11,5 +11,5 @@ definition: |
|
||||
description: "Tipo suma que clasifica un dato como Normal o Outlier con su z-score. Usado por DetectOutliers."
|
||||
tags: [datascience, outlier, anomaly, statistics]
|
||||
uses_types: []
|
||||
file_path: "types/datascience/outlier_result.go"
|
||||
file_path: "functions/datascience/outlier_result.go"
|
||||
---
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package finance
|
||||
|
||||
// BollingerResult holds the three bands of a Bollinger Bands calculation.
|
||||
type BollingerResult struct {
|
||||
Upper []float64
|
||||
Middle []float64
|
||||
Lower []float64
|
||||
}
|
||||
@@ -13,5 +13,5 @@ definition: |
|
||||
description: "Resultado de Bollinger Bands con bandas superior, media e inferior."
|
||||
tags: [finance, bollinger, indicator, bands]
|
||||
uses_types: []
|
||||
file_path: "types/finance/bollinger_result.go"
|
||||
file_path: "functions/finance/bollinger_result.go"
|
||||
---
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package finance
|
||||
|
||||
// DrawdownResult holds the maximum drawdown value and the indices where it occurred.
|
||||
type DrawdownResult struct {
|
||||
Value float64
|
||||
Start int
|
||||
End int
|
||||
}
|
||||
@@ -13,5 +13,5 @@ definition: |
|
||||
description: "Resultado de maximo drawdown con el valor de caida y los indices de inicio y fin."
|
||||
tags: [finance, drawdown, risk, metric]
|
||||
uses_types: []
|
||||
file_path: "types/finance/drawdown_result.go"
|
||||
file_path: "functions/finance/drawdown_result.go"
|
||||
---
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package finance
|
||||
|
||||
// OHLCV represents a market candle with open, high, low, close prices and volume.
|
||||
type OHLCV struct {
|
||||
Open float64
|
||||
High float64
|
||||
Low float64
|
||||
Close float64
|
||||
Volume float64
|
||||
}
|
||||
@@ -15,5 +15,5 @@ definition: |
|
||||
description: "Vela de mercado con precios de apertura, maximo, minimo, cierre y volumen."
|
||||
tags: [finance, market, candle, ohlcv]
|
||||
uses_types: []
|
||||
file_path: "types/finance/ohlcv.go"
|
||||
file_path: "functions/finance/ohlcv.go"
|
||||
---
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package finance
|
||||
|
||||
import "time"
|
||||
|
||||
// Tick represents a single trade event in a market.
|
||||
type Tick struct {
|
||||
Symbol string
|
||||
Price float64
|
||||
Volume float64
|
||||
Timestamp time.Time
|
||||
}
|
||||
@@ -14,5 +14,5 @@ definition: |
|
||||
description: "Evento de trade individual en un mercado. Contiene simbolo, precio, volumen y timestamp."
|
||||
tags: [finance, market, tick, trade]
|
||||
uses_types: []
|
||||
file_path: "types/finance/tick.go"
|
||||
file_path: "functions/finance/tick.go"
|
||||
---
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package infra
|
||||
|
||||
// ContainerInfo representa la información básica de un contenedor Docker.
|
||||
type ContainerInfo struct {
|
||||
ID string // ID corto del contenedor
|
||||
Name string // Nombre del contenedor
|
||||
Image string // Imagen usada
|
||||
Status string // Estado actual (running, exited, etc.)
|
||||
State string // Estado detallado
|
||||
Ports string // Mapeo de puertos
|
||||
Created string // Fecha de creación
|
||||
Labels map[string]string // Labels del contenedor
|
||||
}
|
||||
@@ -18,7 +18,7 @@ definition: |
|
||||
description: "Información básica de un contenedor Docker: ID, nombre, imagen, estado, puertos, labels."
|
||||
tags: [docker, container, infra]
|
||||
uses_types: []
|
||||
file_path: "types/infra/container_info.go"
|
||||
file_path: "functions/infra/container_info.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package infra
|
||||
|
||||
// ImageInfo representa la información básica de una imagen Docker local.
|
||||
type ImageInfo struct {
|
||||
ID string // ID corto de la imagen
|
||||
Repository string // Nombre del repositorio
|
||||
Tag string // Tag de la imagen
|
||||
Size string // Tamaño legible (ej: "142MB")
|
||||
Created string // Fecha de creación
|
||||
}
|
||||
@@ -15,7 +15,7 @@ definition: |
|
||||
description: "Información básica de una imagen Docker local: ID, repositorio, tag, tamaño, fecha."
|
||||
tags: [docker, image, infra]
|
||||
uses_types: []
|
||||
file_path: "types/infra/image_info.go"
|
||||
file_path: "functions/infra/image_info.go"
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package infra
|
||||
|
||||
// MetabaseClient holds the connection details for a Metabase instance API.
|
||||
type MetabaseClient struct {
|
||||
BaseURL string // e.g. "http://localhost:3000"
|
||||
Token string // session token or API key
|
||||
}
|
||||
@@ -12,7 +12,7 @@ definition: |
|
||||
description: "Cliente para la API REST de Metabase. Contiene la URL base de la instancia y el token de autenticacion (session token o API key)."
|
||||
tags: [metabase, api, client, infra]
|
||||
uses_types: []
|
||||
file_path: "types/infra/metabase_client.go"
|
||||
file_path: "functions/infra/metabase_client.go"
|
||||
---
|
||||
|
||||
## Notas
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package shell
|
||||
|
||||
// CmdResult almacena el resultado de ejecutar un comando del sistema.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/shell
|
||||
type CmdResult struct {
|
||||
Stdout string
|
||||
Stderr string
|
||||
ExitCode int
|
||||
}
|
||||
@@ -13,7 +13,7 @@ definition: |
|
||||
description: "Resultado de la ejecucion de un comando del sistema con stdout, stderr y codigo de salida."
|
||||
tags: [shell, command, process, result]
|
||||
uses_types: []
|
||||
file_path: "types/shell/cmd_result.go"
|
||||
file_path: "functions/shell/cmd_result.go"
|
||||
---
|
||||
|
||||
## Notas
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package tui
|
||||
|
||||
// BaseModel provee funcionalidad comun a todas las vistas TUI:
|
||||
// dimensiones de terminal, estilos y manejo de errores.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type BaseModel struct {
|
||||
Width int
|
||||
Height int
|
||||
Styles Styles
|
||||
Err error
|
||||
}
|
||||
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Modelo base que provee dimensiones de terminal, estilos y manejo de errores comunes a todas las vistas TUI."
|
||||
tags: [tui, base, model, component]
|
||||
uses_types: [styles_go_tui]
|
||||
file_path: "types/tui/base_model.go"
|
||||
file_path: "functions/tui/base_model.go"
|
||||
---
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package tui
|
||||
|
||||
// ConfirmModel es un dialogo de confirmacion Si/No interactivo.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type ConfirmModel struct {
|
||||
BaseModel
|
||||
prompt string
|
||||
selected bool
|
||||
done bool
|
||||
}
|
||||
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Dialogo de confirmacion Si/No interactivo. Embeds BaseModel. Implementa tea.Model."
|
||||
tags: [tui, confirm, dialog, component, interactive]
|
||||
uses_types: [base_model_go_tui]
|
||||
file_path: "types/tui/confirm_model.go"
|
||||
file_path: "functions/tui/confirm_model.go"
|
||||
---
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package tui
|
||||
|
||||
// FilteredListModel extiende ListModel con filtrado por texto en tiempo real.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type FilteredListModel struct {
|
||||
ListModel
|
||||
query string
|
||||
allItems []ListItem
|
||||
placeholder string
|
||||
}
|
||||
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Lista con filtrado por texto en tiempo real. Embeds ListModel y añade busqueda interactiva."
|
||||
tags: [tui, list, filter, component, interactive]
|
||||
uses_types: [list_model_go_tui, list_item_go_tui]
|
||||
file_path: "types/tui/filtered_list_model.go"
|
||||
file_path: "functions/tui/filtered_list_model.go"
|
||||
---
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package tui
|
||||
|
||||
// ListItem representa un item individual en una lista TUI.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type ListItem struct {
|
||||
Title string
|
||||
Description string
|
||||
Value interface{}
|
||||
}
|
||||
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Item individual de una lista TUI con titulo, descripcion y valor arbitrario."
|
||||
tags: [tui, list, component]
|
||||
uses_types: []
|
||||
file_path: "types/tui/list_item.go"
|
||||
file_path: "functions/tui/list_item.go"
|
||||
---
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package tui
|
||||
|
||||
// ListModel es un componente lista seleccionable con cursor, scroll y seleccion.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type ListModel struct {
|
||||
items []ListItem
|
||||
cursor int
|
||||
selected map[int]struct{}
|
||||
multi bool
|
||||
styles Styles
|
||||
height int
|
||||
width int
|
||||
offset int
|
||||
}
|
||||
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Componente lista seleccionable con cursor, scroll y seleccion simple o multiple. Implementa tea.Model."
|
||||
tags: [tui, list, component, interactive]
|
||||
uses_types: [list_item_go_tui, styles_go_tui]
|
||||
file_path: "types/tui/list_model.go"
|
||||
file_path: "functions/tui/list_model.go"
|
||||
---
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package tui
|
||||
|
||||
// MultiProgressModel gestiona multiples barras de progreso simultaneas.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type MultiProgressModel struct {
|
||||
bars []ProgressModel
|
||||
styles Styles
|
||||
}
|
||||
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Gestor de multiples barras de progreso simultaneas. Implementa tea.Model."
|
||||
tags: [tui, progress, multi, component]
|
||||
uses_types: [progress_model_go_tui, styles_go_tui]
|
||||
file_path: "types/tui/multi_progress_model.go"
|
||||
file_path: "functions/tui/multi_progress_model.go"
|
||||
---
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/charmbracelet/bubbles/progress"
|
||||
)
|
||||
|
||||
// ProgressModel es una barra de progreso con porcentaje, ETA y tiempo transcurrido.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type ProgressModel struct {
|
||||
progress progress.Model
|
||||
current float64
|
||||
total float64
|
||||
label string
|
||||
styles Styles
|
||||
showPct bool
|
||||
showETA bool
|
||||
started time.Time
|
||||
}
|
||||
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Barra de progreso con porcentaje, ETA y tiempo transcurrido. Implementa tea.Model."
|
||||
tags: [tui, progress, component, interactive]
|
||||
uses_types: [styles_go_tui]
|
||||
file_path: "types/tui/progress_model.go"
|
||||
file_path: "functions/tui/progress_model.go"
|
||||
---
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"github.com/charmbracelet/bubbles/spinner"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
)
|
||||
|
||||
// SpinnerModel es un indicador de carga animado con mensaje personalizable.
|
||||
// Implementa tea.Model del framework Bubble Tea.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type SpinnerModel struct {
|
||||
spinner spinner.Model
|
||||
message string
|
||||
style lipgloss.Style
|
||||
active bool
|
||||
}
|
||||
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Indicador de carga animado con mensaje personalizable. Implementa tea.Model."
|
||||
tags: [tui, spinner, loading, component]
|
||||
uses_types: []
|
||||
file_path: "types/tui/spinner_model.go"
|
||||
file_path: "functions/tui/spinner_model.go"
|
||||
---
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
package tui
|
||||
|
||||
import "time"
|
||||
|
||||
// SpinnerWithTimeoutModel es un spinner que se auto-detiene tras un timeout.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type SpinnerWithTimeoutModel struct {
|
||||
SpinnerModel
|
||||
timeout time.Duration
|
||||
started time.Time
|
||||
finished bool
|
||||
}
|
||||
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Spinner que se auto-detiene tras un timeout configurable. Embeds SpinnerModel."
|
||||
tags: [tui, spinner, timeout, component]
|
||||
uses_types: [spinner_model_go_tui]
|
||||
file_path: "types/tui/spinner_with_timeout_model.go"
|
||||
file_path: "functions/tui/spinner_with_timeout_model.go"
|
||||
---
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
package tui
|
||||
|
||||
import "github.com/charmbracelet/lipgloss"
|
||||
|
||||
// Styles contiene todos los estilos lipgloss pre-configurados para una aplicacion TUI.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type Styles struct {
|
||||
Theme Theme
|
||||
Title lipgloss.Style
|
||||
Subtitle lipgloss.Style
|
||||
Header lipgloss.Style
|
||||
Label lipgloss.Style
|
||||
Text lipgloss.Style
|
||||
Muted lipgloss.Style
|
||||
Code lipgloss.Style
|
||||
Success lipgloss.Style
|
||||
Error lipgloss.Style
|
||||
Warning lipgloss.Style
|
||||
Info lipgloss.Style
|
||||
Border lipgloss.Style
|
||||
Box lipgloss.Style
|
||||
List lipgloss.Style
|
||||
ListItem lipgloss.Style
|
||||
Selected lipgloss.Style
|
||||
Unselected lipgloss.Style
|
||||
Button lipgloss.Style
|
||||
ButtonActive lipgloss.Style
|
||||
Input lipgloss.Style
|
||||
Cursor lipgloss.Style
|
||||
Container lipgloss.Style
|
||||
Section lipgloss.Style
|
||||
Divider lipgloss.Style
|
||||
StatusBar lipgloss.Style
|
||||
}
|
||||
+1
-1
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Coleccion completa de estilos lipgloss pre-configurados para tipografia, estados, componentes y layout."
|
||||
tags: [tui, styles, lipgloss, theme]
|
||||
uses_types: [theme_go_tui]
|
||||
file_path: "types/tui/styles.go"
|
||||
file_path: "functions/tui/styles.go"
|
||||
---
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package tui
|
||||
|
||||
import "github.com/charmbracelet/lipgloss"
|
||||
|
||||
// Theme define una paleta de 9 colores semanticos para terminal.
|
||||
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||
type Theme struct {
|
||||
Primary lipgloss.Color
|
||||
Secondary lipgloss.Color
|
||||
Success lipgloss.Color
|
||||
Error lipgloss.Color
|
||||
Warning lipgloss.Color
|
||||
Info lipgloss.Color
|
||||
Muted lipgloss.Color
|
||||
Text lipgloss.Color
|
||||
Border lipgloss.Color
|
||||
}
|
||||
+1
-1
@@ -9,5 +9,5 @@ definition: |
|
||||
description: "Paleta de colores para terminal con 9 colores semanticos. Base del sistema de estilos."
|
||||
tags: [tui, theme, styles, colors]
|
||||
uses_types: []
|
||||
file_path: "types/tui/theme.go"
|
||||
file_path: "functions/tui/theme.go"
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user