Skip to content

Commit

Permalink
docs: Update README with info on using environment variables for defa…
Browse files Browse the repository at this point in the history
…ults
  • Loading branch information
Sch8ill committed Jul 16, 2023
1 parent 893e5ab commit e8af76e
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,25 @@
Take a look at the other [command flags](#usage) for more features.
### Libary
#### Environment Variables
Instead of specifying command line options each time, you can also use environment variables to set the default values.
Environment variables are automatically checked and used if available. Environment variables take precedence over the default values.
Available environment variables:
DEFAULT_RCON_ADDRESS: Address of the server you want to connect to.
DEFAULT_RCON_PASSWORD: Password of the RCON server you want to connect to.
DEFAULT_RCON_TIMEOUT: Default timeout for the connection to the server.
Example:
```bash
export DEFAULT_RCON_ADDRESS="my-server:25575"
export DEFAULT_RCON_PASSWORD="my-password"
export DEFAULT_RCON_TIMEOUT="10s"
```
### Libary usage
Install the module using:
Expand All @@ -101,7 +119,7 @@
Execute a command over RCON:
```go
output, err := client.ExecuteCmd("<your-command>")
output, err := client.ExecuteCmd("some-command")
if err != nil {
panic(err)
}
Expand Down

0 comments on commit e8af76e

Please sign in to comment.