-
Notifications
You must be signed in to change notification settings - Fork 0
/
provider.go
185 lines (165 loc) · 4.03 KB
/
provider.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
package provider
import (
"slices"
)
type Provider struct {
slug string
display string
}
func (p Provider) String() string {
return p.slug
}
func (p Provider) Pretty() string {
return p.display
}
var (
Unknown = Provider{"", ""}
Amazon = Provider{"amazon", "Amazon"}
Apple = Provider{"apple", "Apple"}
Auth0 = Provider{"auth0", "Auth0"}
Azure = Provider{"azuread", "Azure AD"}
Battlenet = Provider{"battlenet", "Battlenet"}
Bitbucket = Provider{"bitbucket", "Bitbucket"}
Box = Provider{"box", "Box"}
Dailymotion = Provider{"dailymotion", "Dailymotion"}
Deezer = Provider{"deezer", "Deezer"}
DigitalOcean = Provider{"digitalocean", "Digital Ocean"}
Discord = Provider{"discord", "Discord"}
Dropbox = Provider{"dropbox", "Dropbox"}
Eve = Provider{"eveonline", "Eve Online"}
Facebook = Provider{"facebook", "Facebook"}
Fitbit = Provider{"fitbit", "Fitbit"}
Gitea = Provider{"gitea", "Gitea"}
Github = Provider{"github", "Github"}
Gitlab = Provider{"gitlab", "Gitlab"}
Google = Provider{"google", "Google"}
GooglePlus = Provider{"gplus", "Google Plus"}
Heroku = Provider{"heroku", "Heroku"}
Instagram = Provider{"instagram", "Instagram"}
Intercom = Provider{"intercom", "Intercom"}
Kakao = Provider{"kakao", "Kakao"}
LastFM = Provider{"lastfm", "Last FM"}
LINE = Provider{"line", "LINE"}
Linkedin = Provider{"linkedin", "Linkedin"}
Mastodon = Provider{"mastodon", "Mastodon"}
Meetup = Provider{"meetup", "Meetup.com"}
Microsoft = Provider{"microsoftonline", "Microsoft Online"}
Naver = Provider{"naver", "Naver"}
NextCloud = Provider{"nextcloud", "NextCloud"}
Okta = Provider{"okta", "Okta"}
Onedrive = Provider{"onedrive", "Onedrive"}
OpenID = Provider{"openid-connect", "OpenID Connect"}
Patreon = Provider{"patreon", "Patreon"}
Paypal = Provider{"paypal", "Paypal"}
Salesforce = Provider{"salesforce", "Salesforce"}
SeaTalk = Provider{"seatalk", "SeaTalk"}
Shopify = Provider{"shopify", "Shopify"}
Slack = Provider{"slack", "Slack"}
SoundCloud = Provider{"soundcloud", "SoundCloud"}
Spotify = Provider{"spotify", "Spotify"}
Steam = Provider{"steam", "Steam"}
Strava = Provider{"strava", "Strava"}
Stripe = Provider{"stripe", "Stripe"}
TikTok = Provider{"tiktok", "TikTok"}
Twitch = Provider{"twitch", "Twitch"}
Twitter = Provider{"twitter", "Twitter"}
Typetalk = Provider{"typetalk", "Typetalk"}
Uber = Provider{"uber", "Uber"}
VK = Provider{"vk", "VK"}
WeCom = Provider{"wecom", "WeCom"}
Wepay = Provider{"wepay", "Wepay"}
Xero = Provider{"xero", "Xero"}
Yahoo = Provider{"yahoo", "Yahoo"}
Yammer = Provider{"yammer", "Yammer"}
Yandex = Provider{"yandex", "Yandex"}
Zoom = Provider{"zoom", "Zoom"}
)
var all = []Provider{
Amazon,
Apple,
Auth0,
Azure,
Battlenet,
Bitbucket,
Box,
Dailymotion,
Deezer,
DigitalOcean,
Discord,
Dropbox,
Eve,
Facebook,
Fitbit,
Gitea,
Github,
Gitlab,
Google,
GooglePlus,
Heroku,
Instagram,
Intercom,
Kakao,
LastFM,
LINE,
Linkedin,
Mastodon,
Meetup,
Microsoft,
Naver,
NextCloud,
Okta,
Onedrive,
OpenID,
Patreon,
Paypal,
Salesforce,
SeaTalk,
Shopify,
Slack,
SoundCloud,
Spotify,
Steam,
Strava,
Stripe,
TikTok,
Twitch,
Twitter,
Typetalk,
Uber,
VK,
WeCom,
Wepay,
Xero,
Yahoo,
Yammer,
Yandex,
Zoom,
}
func FromSlug(p string) (Provider, bool) {
for _, single := range all {
if single.slug == p {
return single, true
}
}
return Unknown, false
}
func List() []Provider {
return all
}
func Slugs() []string {
list := []string{}
for _, single := range List() {
list = append(list, single.slug)
}
return list
}
func Public() []string {
list := []string{}
for _, single := range List() {
list = append(list, single.display)
}
return list
}
func Validate(p Provider) bool {
return slices.Contains(List(), p)
}