2019-11-07 10:00:24 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
|
|
|
func GetGiteaEndpoint() (string, error) {
|
|
|
|
giteaEndpoint := os.Getenv("GITEA_ENDPOINT")
|
|
|
|
if len(giteaEndpoint) == 0 || giteaEndpoint == "" {
|
|
|
|
return "", errors.New("GITEA_ENDPOINT not specified")
|
|
|
|
}
|
|
|
|
return giteaEndpoint, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetGiteaToken() (string, error) {
|
|
|
|
giteaToken := os.Getenv("GITEA_TOKEN")
|
|
|
|
if len(giteaToken) == 0 || giteaToken == "" {
|
|
|
|
return "", errors.New("GITEA_TOKEN not specified")
|
|
|
|
}
|
|
|
|
return giteaToken, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetBlogURL() (string, error) {
|
|
|
|
blogURL := os.Getenv("BLOG_URL")
|
|
|
|
if len(blogURL) == 0 || blogURL == "" {
|
|
|
|
return "", errors.New("BLOG_URL not specified")
|
|
|
|
}
|
|
|
|
return blogURL, nil
|
|
|
|
}
|
2019-11-09 16:35:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
func GetBunnyCDNKey() (string, error) {
|
|
|
|
bunnyCDNKey := os.Getenv("BUNNY_CDN_KEY")
|
|
|
|
if len(bunnyCDNKey) == 0 || bunnyCDNKey == "" {
|
|
|
|
return "", errors.New("BUNNY_CDN_KEY not specified")
|
|
|
|
}
|
|
|
|
return bunnyCDNKey, nil
|
|
|
|
}
|