File: testMain.go

package info (click to toggle)
docker.io 20.10.5%2Bdfsg1-1%2Bdeb11u2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 60,044 kB
  • sloc: sh: 5,527; makefile: 616; ansic: 179; python: 162; asm: 7
file content (28 lines) | stat: -rw-r--r-- 571 bytes parent folder | download | duplicates (6)
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
package main

import (
	"log"
	"os"

	"github.com/docker/libnetwork/cmd/networkdb-test/dbclient"
	"github.com/docker/libnetwork/cmd/networkdb-test/dbserver"
	"github.com/sirupsen/logrus"
)

func main() {
	formatter := &logrus.TextFormatter{
		FullTimestamp: true,
	}
	logrus.SetFormatter(formatter)
	logrus.Infof("Starting the image with these args: %v", os.Args)
	if len(os.Args) < 1 {
		log.Fatal("You need at least 1 argument [client/server]")
	}

	switch os.Args[1] {
	case "server":
		dbserver.Server(os.Args[2:])
	case "client":
		dbclient.Client(os.Args[2:])
	}
}