config

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config resuelve las rutas del store local de nem (~/.nem) y la configuración persistida en config.toml.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChatsDir

func ChatsDir() (string, error)

ChatsDir devuelve la ruta donde se exportan los .jsonl por commit (~/.nem/store/chats).

func ConfigPath

func ConfigPath() (string, error)

ConfigPath devuelve la ruta del archivo de configuración (~/.nem/config.toml).

func DBPath

func DBPath() (string, error)

DBPath devuelve la ruta de la base SQLite local (~/.nem/nem.db).

func Dir

func Dir() (string, error)

Dir devuelve la ruta raíz del store local de nem (~/.nem).

func Get added in v0.2.0

func Get(key string) (string, error)

Get devuelve el valor de una clave punteada (p.ej. "summarize.backend").

func Keys added in v0.2.0

func Keys() []string

Keys devuelve las claves configurables (para `nem config list`).

func Save added in v0.2.0

func Save(f *File) error

Save escribe el File a config.toml (sobrescribe; los comentarios se pierden).

func Scopes

func Scopes() (map[string]Scope, error)

Scopes devuelve los scopes configurados (mapa vacío si no hay).

func Set added in v0.2.0

func Set(key, value string) error

Set fija una clave punteada y persiste el archivo.

func StoreDir

func StoreDir() (string, error)

StoreDir devuelve la ruta del directorio versionado por git (~/.nem/store).

Types

type Backend added in v0.2.0

type Backend struct {
	Backend  string `toml:"backend,omitempty"`
	Model    string `toml:"model,omitempty"`
	Endpoint string `toml:"endpoint,omitempty"`
}

Backend configura un backend pluggable (summarize/embed): "heuristic" | "ollama" | "api" | "static", con modelo y endpoint opcionales.

type File added in v0.2.0

type File struct {
	Scopes    map[string]Scope `toml:"scopes,omitempty"`
	Summarize Backend          `toml:"summarize,omitempty"`
	Embed     Backend          `toml:"embed,omitempty"`
}

File es el contenido completo de ~/.nem/config.toml.

func Load added in v0.2.0

func Load() (*File, error)

Load lee config.toml. Si no existe, devuelve un File vacío (sin error).

type Scope

type Scope struct {
	Titles  []string `toml:"titles,omitempty"`
	Sources []string `toml:"sources,omitempty"`
	Chats   []string `toml:"chats,omitempty"`
}

Scope define un alcance de acceso de lectura (ver internal/scope).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL