aboutsummaryrefslogtreecommitdiff
path: root/connector/external/config.go
blob: caa2b7e2447e0d6295eea8f331334e2e6c86d85d (plain) (blame)
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
package external

import (
	. "git.deuxfleurs.fr/Deuxfleurs/easybridge/connector"
)

const DUMMYEXT_PROTOCOL = "DummyExt"
const MESSENGER_PROTOCOL = "Messenger"

func init() {
	Register(DUMMYEXT_PROTOCOL, Protocol{
		NewConnector: func() Connector {
			return &External{
				protocol: DUMMYEXT_PROTOCOL,
				command:  "./external/dummy.py",
				debug:    true,
			}
		},
		Schema: ConfigSchema{
			&ConfigEntry{
				Name:        "user",
				Description: "Username",
				Required:    true,
			},
		},
	})

	Register(MESSENGER_PROTOCOL, Protocol{
		NewConnector: func() Connector {
			return &External{
				protocol: MESSENGER_PROTOCOL,
				command:  "./external/messenger.py",
				debug:    true,
			}
		},
		Schema: ConfigSchema{
			&ConfigEntry{
				Name:        "email",
				Description: "Email address",
				Required:    true,
			},
			&ConfigEntry{
				Name:        "password",
				Description: "Password",
				IsPassword:  true,
				Required:    true,
			},
		},
	})
}