27 lines
409 B
Go
27 lines
409 B
Go
package config
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
var (
|
|
NotFoundError = errors.New("env variable not set")
|
|
)
|
|
|
|
func getEnv(key string) string {
|
|
if key == "" {
|
|
panic(fmt.Errorf("%w : key -> %s", NotFoundError, key))
|
|
}
|
|
return os.Getenv(key)
|
|
}
|
|
|
|
func GetDomainProvider(provider string) string {
|
|
return getEnv(provider)
|
|
}
|
|
|
|
func GetServiceVerifyURL(verifyIPURL string) string {
|
|
return getEnv(verifyIPURL)
|
|
}
|