a8m / a8m/envsubst

Feature Request - Loop by pattern matching.

Ouverte
#5 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Go
Étoiles
907
Forks
96
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I have a case where I need to create multiple entries in a config file based on the existence of environment variables. (its for a reverse proxy and I want to be able to add new entries simply by adding additional environment variables)

Something like:

**Env Vars:**
```
SRVCS_FIRST_HOSTNAME=sample.service.com
SRVCS_FIRST_DEST=internal.server.name
SRVCS_SECOND_HOSTNAME=second.service.com
SRVCS_SECOND_DEST=internal2.server.name
```

**Template:**
```
${SRVCS_*_<
host: ${HOSTNAME}
destination: ${DEST}

>}
```

**Result:**
```
host: sample.service.com
destination: internal.server.name

host: second.service.com
destination: internal2.server.name

```

Any thoughts on this idea? _I_ think it'd be pretty handy.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Look at the existing substitution logic in the Go codebase, likely in a main package or command. Understand how environment variables are currently parsed and replaced. The feature requires adding pattern matching to iterate over groups of variables (like SRVCS_*_HOSTNAME and SRVCS_*_DEST) and generating repeated blocks. Check if there are existing tests for expansion to see the expected behavior and add new tests for the loop feature.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
go, shell
Domaine
cli, tooling
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.