-
Notifications
You must be signed in to change notification settings - Fork 0
/
MinimalProfiler.go
61 lines (46 loc) · 933 Bytes
/
MinimalProfiler.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
package sloauth2
type MinimalProfiler struct{
name, email string
}
func (pf MinimalProfiler) New() Profiler {
return pf
}
func (pf MinimalProfiler) Init(data map[string]interface{}) MinimalProfiler {
var kprof string
var vprof interface{}
var ok bool
var svprof string
for kprof, vprof = range data {
if svprof, ok = vprof.(string); ok {
if reEMail.MatchString(svprof) {
pf.email = svprof
continue
}
if reName.MatchString(kprof) {
pf.name = svprof
}
}
}
return pf
}
func (pf MinimalProfiler) Id() string {
return ""
}
func (pf MinimalProfiler) Email() string {
return pf.email
}
func (pf MinimalProfiler) Nick() string {
return ""
}
func (pf MinimalProfiler) Login() string {
return ""
}
func (pf MinimalProfiler) Name() string {
return pf.name
}
func (pf MinimalProfiler) SurName() string {
return ""
}
func (pf MinimalProfiler) Avatar() string {
return ""
}