varcpuprofile=flag.String("cpuprofile","","write cpu profile to file")
varspool_size=flag.Uint64("spool-size",1024,"Maximum number of events to spool before a flush is forced.")
varidle_timeout=flag.Duration("idle-flush-time",5*time.Second,"Maximum time to wait for a full spool before flushing anyway")
varserver_timeout=flag.Duration("server-timeout",30*time.Second,"Maximum time to wait for a request to a server before giving up and trying another.")
varservers=flag.String("servers","","Server (or comma-separated list of servers) to send events to. Each server can be a 'host' or 'host:port'. If the port is not specified, port 5005 is assumed. One server is chosen of the list at random, and only on failure is another server used.")
vartheir_public_key_path=flag.String("their-public-key","","the file containing the NaCl public key for the server you are talking to.")
varour_secret_key_path=flag.String("my-secret-key","","the file containing the NaCl secret key for this process to encrypt with. If none is given, one is generated at runtime.")
//var our_public_key_path = flag.String("my-public-key", "", "the file containing the NaCl public key for this process to encrypt with. If you specify this, you MUST specify -my-private-key.")
funcread_key(pathstring,key[]byte)(errerror){
file,err:=os.Open(path)
iferr!=nil{
return
}
// TODO(sissel): check length of read
_,err=file.Read(key)
return
}
varconfig_file=flag.String("config","","The config file to load")
funcmain(){
flag.Parse()
...
...
@@ -47,58 +30,19 @@ func main() {
}()
}
if*their_public_key_path==""{
log.Fatalf("No -their-public-key flag given")
}
// Turn 'host' and 'host:port' into 'tcp://host:port'
if*servers==""{
log.Fatalf("No servers specified, please provide the -servers setting\n")