hugo-micropub/config.go

31 lines
668 B
Go
Raw Normal View History

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
}