コード例 #1
0
func runService(t *testing.T) {
	if volumeService == nil {
		log := logger.DiscardLogger("test_volume_service")
		volumeService = service.NewVolumeService(volTestPort, log)
		require.NotNil(t, volumeService)
		go volumeService.Serve()
	}
}
コード例 #2
0
func runService(t *testing.T) {
	if volumeService == nil {
		log := logger.DiscardLogger("test_volume_service")
		volumeService = service.NewVolumeService(port, log)
		require.NotNil(t, volumeService)
		go volumeService.Serve()
		time.Sleep(800 * time.Millisecond)
	}
}
コード例 #3
0
// See printUsage for a description.
func main() {
	pathToConfigFile := parseCommandLine()
	config, err := models.LoadConfigFile(pathToConfigFile)
	if err != nil {
		fmt.Fprintf(os.Stderr, err.Error())
		os.Exit(1)
	}
	_context := context.NewContext(config)
	_context.MessageLog.Info("apt_volume_service started")

	volumeService := service.NewVolumeService(
		_context.Config.VolumeServicePort,
		_context.MessageLog)
	volumeService.Serve()
}