-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
1,143 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# envman | ||
Envman (environment variable manager) is a simple tool which stores your environment variables so you can easily load them when you want to continue your work. | ||
|
||
## Usage | ||
``` | ||
envman [global options] command [command options] [arguments...] | ||
COMMANDS: | ||
list, ls List the environments or variables in the environment | ||
load, l Load and environment to the current one | ||
save, s Save environment variables to an environment | ||
remove, rm Remove a full environment or just a variable | ||
cleanup Cleanup the backend, delete all the created files | ||
help, h Shows a list of commands or help for one command | ||
GLOBAL OPTIONS: | ||
--backend value, -b value Use and set a different backend as default | ||
--help, -h show help | ||
--version, -v print the version | ||
``` | ||
|
||
## Sample commands | ||
`envman ls` | ||
`envman ls ENV_NAME` | ||
`envman save ENV_NAME VAR_1 VAR_2` | ||
`envman load ENV_NAME` | ||
`envman rm ENV_NAME` | ||
`envman rm ENV_NAME VAR_1` | ||
|
||
## Backend development | ||
- Implement the Backend interface. | ||
- If want to use config for your backend add it to the Config struct. | ||
- In the main package declare it in backend parsing. | ||
|
||
## TODO | ||
- Autocomplete | ||
- Security: E.g. AES encrypt any text which is uploaded. | ||
- Display better error messages? | ||
- Option to rename env? | ||
### Backends | ||
#### GitHub Gist | ||
- Refactor (GraphQL?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package backend | ||
|
||
import ( | ||
"github.com/pyrooka/envman/config" | ||
) | ||
|
||
// IBackend is an interface what show what should implement if you want to create a new storage service. | ||
type IBackend interface { | ||
Init(c *config.Config) (err error) // Initialize the backend. | ||
List(envName string) ([]string, error) // Returns a list with the variables in the env or the environments in the backend if the name is empty string. | ||
Get(envName string) (vars map[string]string, err error) // Gets the variables for the environment. | ||
Update(envName string, vars map[string]string) (err error) // Updates variables in the environment. | ||
Delete(envName string, vars []string) (err error) // Deletes the given variables or the full environment if an empty slice given. | ||
CleanUp() (err error) // Removes all the created things. | ||
} |
Oops, something went wrong.