github.com/Heebron/moby@v0.0.0-20221111184709-6eab4f55faf7/libnetwork/cmd/networkdb-test/testMain.go (about)

     1  package main
     2  
     3  import (
     4  	"log"
     5  	"os"
     6  
     7  	"github.com/docker/docker/libnetwork/cmd/networkdb-test/dbclient"
     8  	"github.com/docker/docker/libnetwork/cmd/networkdb-test/dbserver"
     9  	"github.com/sirupsen/logrus"
    10  )
    11  
    12  func main() {
    13  	formatter := &logrus.TextFormatter{
    14  		FullTimestamp: true,
    15  	}
    16  	logrus.SetFormatter(formatter)
    17  	logrus.Infof("Starting the image with these args: %v", os.Args)
    18  	if len(os.Args) < 1 {
    19  		log.Fatal("You need at least 1 argument [client/server]")
    20  	}
    21  
    22  	switch os.Args[1] {
    23  	case "server":
    24  		dbserver.Server(os.Args[2:])
    25  	case "client":
    26  		dbclient.Client(os.Args[2:])
    27  	}
    28  }