Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: review DNS providers.
- Loading branch information
Showing
55 changed files
with
670 additions
and
559 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,27 @@ | ||
package env | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"strings" | ||
) | ||
|
||
// Get environment variables | ||
func Get(names ...string) (map[string]string, error) { | ||
values := map[string]string{} | ||
|
||
var missingEnvVars []string | ||
for _, envVar := range names { | ||
value := os.Getenv(envVar) | ||
if value == "" { | ||
missingEnvVars = append(missingEnvVars, envVar) | ||
} | ||
values[envVar] = value | ||
} | ||
|
||
if len(missingEnvVars) > 0 { | ||
return nil, fmt.Errorf("some credentials information are missing: %s", strings.Join(missingEnvVars, ",")) | ||
} | ||
|
||
return values, nil | ||
} |
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
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
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
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
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
Oops, something went wrong.