forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 1
/
services.go
40 lines (30 loc) · 958 Bytes
/
services.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
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package externals
import (
"strings"
libkb "github.com/keybase/client/go/libkb"
)
type externalServicesCollection map[string]libkb.ServiceType
var externalServices = externalServicesCollection(make(map[string]libkb.ServiceType))
func (e externalServicesCollection) Register(st libkb.ServiceType) {
for _, k := range st.AllStringKeys() {
e[k] = st
}
}
func (e externalServicesCollection) GetServiceType(s string) libkb.ServiceType {
return e[strings.ToLower(s)]
}
func (e externalServicesCollection) ListProofCheckers(mode libkb.RunMode) []string {
var ret []string
for k, v := range e {
if useDevelProofCheckers || !v.IsDevelOnly() {
ret = append(ret, k)
}
}
return ret
}
var _ libkb.ExternalServicesCollector = externalServices
func GetServices() libkb.ExternalServicesCollector {
return externalServices
}