Skip to main content

Module storage

Module storage 

Source

Structs§

ChaveArmazenada
Represents a stored API key entry in the XDG configuration file.
ConfigArquivo
Represents the structured TOML configuration file.

Functions§

aplicar_permissoes_600
Sets 600 permissions (owner read/write only) on Unix systems.
carregar_chaves_api
Loads API keys using the four-layer precedence hierarchy:
cmd_keys_add
Adds a new key to the XDG storage.
cmd_keys_clear
Removes all stored keys. Asks for confirmation unless --yes is passed.
cmd_keys_export
Exports all keys to stdout in CONTEXT7_API=<value> format, one per line.
cmd_keys_import
Imports keys from a .env file, reading CONTEXT7_API= entries.
cmd_keys_list
Lists all stored keys with their 1-based indices and masked values.
cmd_keys_path
Displays the path of the XDG configuration file.
cmd_keys_remove
Removes a key by its 1-based index.
descobrir_caminho_config
Discovers the XDG configuration path for the config.toml file.
descobrir_caminho_logs_xdg
Discovers the XDG path for storing log files.
escrever_config_arquivo
Writes a complete ConfigArquivo to the XDG configuration file.
escrever_config_xdg
Writes (or updates) the XDG configuration file with the provided key.
extrair_chaves_env
Extracts CONTEXT7_API= keys from .env file content in memory.
ler_config_xdg
Layer 2: reads keys from the XDG configuration file (config.toml).
ler_config_xdg_raw
Reads the XDG configuration file and returns the full ConfigArquivo.
ler_env_compile_time
Layer 4: reads keys embedded at compile time via option_env!("CONTEXT7_API_KEYS").
ler_env_cwd
Layer 3: reads keys from the .env file in the current working directory.
ler_env_var_chave
Layer 1: reads keys from the CONTEXT7_API_KEYS runtime environment variable.
mascarar_chave
Masks an API key showing only the first 12 and last 4 characters.