Commit 3f817efd authored by Nogweii's avatar Nogweii
Browse files

fix various snake case names

parent 53e49487
......@@ -3,6 +3,7 @@ package main
import (
"os"
log "github.com/sirupsen/logrus"
)
type Configuration struct {
......@@ -16,10 +17,10 @@ func readConfig() {
}
func requireEnvVar(envName string) string {
full_env_key := "MCA_" + envName
val, ok := os.LookupEnv(full_env_key)
fullName := "MCA_" + envName
val, ok := os.LookupEnv(fullName)
if !ok {
log.Fatal("Required environment variable is not set: ", full_env_key)
log.Fatal("Required environment variable is not set: ", fullName)
}
return val
}
......@@ -25,19 +25,19 @@ func main() {
for {
select {
case jsonMessage := <-stream:
all_domains, err := jsonMessage.ArrayOfStrings("data", "leaf_cert", "all_domains")
allDomains, err := jsonMessage.ArrayOfStrings("data", "leaf_cert", "all_domains")
if err != nil {
log.WithFields(log.Fields{"error": err}).Fatal("Error decoding json string to find all domains")
}
any_glob_match := false
for _, domain := range all_domains {
any_glob_match = any_glob_match || matchesDomains(domain)
anyGlobMatch := false
for _, domain := range allDomains {
anyGlobMatch = anyGlobMatch || matchesDomains(domain)
}
if any_glob_match {
if anyGlobMatch {
log.WithFields(log.Fields{
"domains": all_domains,
"domains": allDomains,
}).Info("New certificate we're interested in found!")
}
......@@ -53,12 +53,12 @@ func main() {
}
func matchesDomains(domainName string) bool {
any_match := false
anyMatch := false
for _, glob := range globs {
any_match = glob.Match(domainName) || any_match
anyMatch = glob.Match(domainName) || anyMatch
}
return any_match
return anyMatch
}
func readDomainsFromFile(filepath string) []glob.Glob {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment