github.com/Cloud-Foundations/Dominator@v0.3.4/lib/repowatch/api.go (about) 1 package repowatch 2 3 import ( 4 "time" 5 6 "github.com/Cloud-Foundations/Dominator/lib/log" 7 ) 8 9 type Config struct { 10 AwsSecretId string `yaml:"aws_secret_id"` 11 Branch string `yaml:"branch"` 12 CheckInterval time.Duration `yaml:"check_interval"` 13 LocalRepositoryDirectory string `yaml:"local_repository_directory"` 14 RepositoryURL string `yaml:"repository_url"` 15 } 16 17 func Watch(remoteURL, localDirectory string, checkInterval time.Duration, 18 metricDirectory string, logger log.DebugLogger) (<-chan string, error) { 19 return watch(Config{ 20 CheckInterval: checkInterval, 21 LocalRepositoryDirectory: localDirectory, 22 RepositoryURL: remoteURL, 23 }, metricDirectory, logger) 24 } 25 26 func WatchWithConfig(config Config, metricDirectory string, 27 logger log.DebugLogger) (<-chan string, error) { 28 return watch(config, metricDirectory, logger) 29 }