diff options
author | KatolaZ <katolaz@freaknet.org> | 2017-07-10 19:33:56 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2017-07-10 19:33:56 +0100 |
commit | 3b752dc02e8ac2048c3dc6efa37145c679502c84 (patch) | |
tree | 492425e6ce04a525147c0e0131a8e06a4f15e202 /scorsh.go | |
parent | d0afee5defa7c342a97e4f444f715eb70f0779a3 (diff) |
added global configuration system (config.go)
Diffstat (limited to 'scorsh.go')
-rw-r--r-- | scorsh.go | 41 |
1 files changed, 3 insertions, 38 deletions
@@ -2,9 +2,7 @@ package main import ( "errors" - "golang.org/x/crypto/openpgp" "log" - "os" "flag" ) @@ -57,46 +55,13 @@ func SCORSHErr(err int) error { } -func SCORSHWorker(keyring string, c_msg chan SCORSHmsg, c_status chan int) { - - // read the worker configuration file - - // Open the keyring file - f, err := os.Open(keyring) - defer f.Close() - - if err != nil { - log.Printf("[worker] cannot open file %s\n", keyring) - c_status <- SCORSH_ERR_NO_FILE - return - } - - // load the keyring - kr, err := openpgp.ReadArmoredKeyRing(f) - - if err != nil { - log.Printf("[worker] cannot open keyring %s\n", keyring) - log.Printf("%s\n", err) - c_status <- SCORSH_ERR_KEYRING - return - } - - // wait for messages from the c_msg channel - - msg := <-c_msg - - // process message - ret := walk_commits(msg, kr) - - c_status <- ret - -} func main() { flag.Parse() - - + cfg := ReadConfig(*conf_file) + + log.Printf("%s\n", cfg) } |