-
Notifications
You must be signed in to change notification settings - Fork 0
/
tautulli.go
54 lines (47 loc) · 1.04 KB
/
tautulli.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
package tautulli
import (
"fmt"
"github.com/AlecAivazis/survey/v2"
"github.com/techsquidtv/uhs-cli/models/services"
)
type Tautulli struct {
services.Service `yaml:",inline"`
TautulliOptions `yaml:",inline"`
}
type TautulliOptions struct {
Config string `yaml:"config"`
}
// Return default values for service
func (s *Tautulli) Default() services.ServiceInterface {
http := 8181
p := &Tautulli{
Service: services.Service{
Enabled: false,
ReplicaCount: 1,
Image: services.Image{
Repository: "lscr.io/linuxserver/tautulli",
Tag: "latest",
PullPolicy: "Always",
},
Ports: services.Ports{
Http: &http,
},
},
TautulliOptions: TautulliOptions{
Config: "/opt/tautulli/config",
},
}
return p
}
func (s *Tautulli) Configure() services.ServiceInterface {
s.Enabled = true
inputConfigPath := &survey.Input{
Message: "Enter the path to your Tautulli config folder:",
Default: s.Config,
}
err := survey.AskOne(inputConfigPath, &s.Config)
if err != nil {
fmt.Println(err.Error())
}
return s
}