Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright ©2023 The calorado-daq Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Command calo-fwd serves an end-point for proxying CALO data.
// calo-fwd listens for commands from calo-daq to transfer data to
// the host of calo-srv.
package main // import "gitlab.in2p3.fr/sbinet/calorado-daq/cmd/calo-fwd"
import (
"flag"
"log"
)
func main() {
log.SetPrefix("calo-fwd: ")
log.SetFlags(0)
var (
addr = flag.String("addr", ":54242", "[host]:port to serve")
notify = flag.String("notify", "clrwebdev02.in2p3.fr:54242", "[addr]:port to send notifications to")
remote = flag.String("remote", "root@clrwebdev02.in2p3.fr", "remote host to send data to")
remoteDir = flag.String("remote-dir", "/home/calorado/data/raw", "remote host directory to send data to")
)
flag.Parse()
srv, err := newServer(*addr, *notify, *remote, *remoteDir)
if err != nil {
log.Fatalf("could not create CALO relay server: %+v", err)
}
err = srv.run()
if err != nil {
log.Fatalf("could not run CALO relay server: %+v", err)
}
}