Monorepo for Tangled
tangled.org
1package pages
2
3import "strings"
4
5type Source string
6
7const (
8 SourcePatch Source = "patch"
9 SourceBranch Source = "branch"
10 SourceFork Source = "fork"
11)
12
13func ParseSource(s string) (Source, bool) {
14 switch strings.ToLower(s) {
15 case string(SourcePatch):
16 return SourcePatch, true
17 case string(SourceFork):
18 return SourceFork, true
19 case string(SourceBranch):
20 return SourceBranch, true
21 default:
22 return "", false
23 }
24}