func GetExtension(text string) string {
	pos := strings.LastIndex(text, ".")
	if pos == -1 {
		return ""
	}
	adjustedPos := pos + len(".")
	if adjustedPos >= len(text) {
		return ""
	}
	return text[adjustedPos:]
}
GetExtension : get file extension
package api
import (
	"math/rand"
	"strings"
	"time"
	"github.com/Waifu-pics/waifu-api/config"
)
func CheckValid(endpoint string, nsfw bool, conf config.Config) bool {
	var list = conf.Endpoints.Sfw
	if nsfw {
		list = conf.Endpoints.Nsfw
	}
	for _, v := range list {
		if v == endpoint {
			return true
		}
	}
	return false
}