1
0

Utility for my infrastructure. Added MainSite function.

This commit is contained in:
Alexander Andreev 2022-02-06 15:23:32 +04:00
parent bc83e033a1
commit 8341fba20f
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

14
pkg/utils/dwelling.go Normal file
View File

@ -0,0 +1,14 @@
package utils
import "strings"
// MainSite returns homepage address depending on network used.
func MainSite(host string) string {
if strings.HasPrefix(host, "i2p") {
return "http://arav.i2p"
} else if strings.HasPrefix(host, "onion") {
return "http://.onion"
}
return "https://arav.top"
}