Add vendor matterbridge/gozulipbot

This commit is contained in:
Wim
2018-05-07 21:06:25 +02:00
parent c6c92e273d
commit 1605fbc012
5 changed files with 762 additions and 0 deletions

32
vendor/github.com/matterbridge/gozulipbot/flag.go generated vendored Normal file
View File

@@ -0,0 +1,32 @@
package gozulipbot
import (
"flag"
"fmt"
"time"
)
func (b *Bot) GetConfigFromFlags() error {
var (
apiKey = flag.String("apikey", "", "bot api key")
apiURL = flag.String("apiurl", "", "url of zulip server")
email = flag.String("email", "", "bot email address")
backoff = flag.Duration("backoff", 1*time.Second, "backoff base duration")
)
flag.Parse()
if *apiKey == "" {
return fmt.Errorf("--apikey is required")
}
if *apiURL == "" {
return fmt.Errorf("--apiurl is required")
}
if *email == "" {
return fmt.Errorf("--email is required")
}
b.APIKey = *apiKey
b.APIURL = *apiURL
b.Email = *email
b.Backoff = *backoff
return nil
}