예제 #1
0
func newDPNSync(t *testing.T) *workers.DPNSync {
	config := loadConfig(t)
	_context := context.NewContext(config)
	dpnSync, err := workers.NewDPNSync(_context)
	require.Nil(t, err)
	for namespace := range config.DPN.RemoteNodeTokens {
		require.NotNil(t, dpnSync.RemoteClients[namespace], namespace)
	}
	return dpnSync
}
예제 #2
0
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)
	dpnSync, err := workers.NewDPNSync(_context)
	if err != nil {
		fmt.Fprintf(os.Stderr, err.Error())
		os.Exit(1)
	}
	dpnSync.Run()
}