-
Notifications
You must be signed in to change notification settings - Fork 7
/
app.go
38 lines (34 loc) · 860 Bytes
/
app.go
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
38
package main
import (
"dbsync/transfer"
"flag"
"fmt"
// _ "github.com/alexbrainman/odbc"
_ "github.com/denisenkom/go-mssqldb"
_ "github.com/go-sql-driver/mysql"
"github.com/google/gops/agent"
_ "github.com/lib/pq"
// _ "github.com/mattn/go-oci8"
_ "github.com/adrianwit/dyndb"
_ "github.com/vertica/vertica-sql-go"
_ "github.com/viant/asc"
_ "github.com/viant/bgc"
"log"
"os"
)
var Version string
var port = flag.Int("port", 8080, "service port")
var debug = flag.Bool("debug", false, "debug flag")
func main() {
flag.Parse()
go func() {
if err := agent.Listen(agent.Options{}); err != nil {
log.Fatal(err)
}
}()
service := transfer.New(nil)
server := transfer.NewServer(service, *port)
go server.StopOnSiginals(os.Interrupt)
fmt.Printf("dstransfer %v listening on :%d\n", Version, *port)
log.Fatal(server.ListenAndServe())
}