-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.go
More file actions
28 lines (24 loc) · 1.28 KB
/
config.go
File metadata and controls
28 lines (24 loc) · 1.28 KB
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
package sshd
import (
"time"
)
// Config represents the required SSH server configuration.
type Config struct {
ControllerHost string `envconfig:"DRYCC_CONTROLLER_API_SERVICE_HOST" required:"true"`
ControllerPort string `envconfig:"DRYCC_CONTROLLER_API_SERVICE_PORT" required:"true"`
SSHHostIP string `envconfig:"SSH_HOST_IP" default:"0.0.0.0" required:"true"`
SSHHostPort int `envconfig:"SSH_HOST_PORT" default:"2223" required:"true"`
HealthSrvPort int `envconfig:"HEALTH_SERVER_PORT" default:"8092"`
HealthSrvTestStorageRegion string `envconfig:"STORAGE_REGION" default:"us-east-1"`
CleanerPollSleepDurationSec int `envconfig:"CLEANER_POLL_SLEEP_DURATION_SEC" default:"5"`
ImagebuilderImagePullPolicy string `envconfig:"IMAGEBUILDER_IMAGE_PULL_POLICY" default:"Always"`
LockTimeout int `envconfig:"GIT_LOCK_TIMEOUT" default:"10"`
}
// CleanerPollSleepDuration returns c.CleanerPollSleepDurationSec as a time.Duration.
func (c Config) CleanerPollSleepDuration() time.Duration {
return time.Duration(c.CleanerPollSleepDurationSec) * time.Second
}
// GitLockTimeout return LockTimeout in minutes
func (c Config) GitLockTimeout() time.Duration {
return time.Duration(c.LockTimeout) * time.Minute
}