ddns/config/config.go
2024-11-13 16:44:46 -04:00

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)
}