-var vppAdapter adapter.VppAdapter // VPP Adapter that will be used in the subsequent Connect calls
-
-// Connect connects the govpp core to VPP either using the default VPP Adapter, or using the adapter previously
-// set by SetAdapter (useful mostly just for unit/integration tests with mocked VPP adapter).
-// This call blocks until VPP is connected, or an error occurs. Only one connection attempt will be performed.
-func Connect() (*core.Connection, error) {
- if vppAdapter == nil {
- vppAdapter = vppapiclient.NewVppAdapter()
- }
- return core.Connect(vppAdapter)
+// Connect connects to the VPP API using a new adapter instance created with NewVppAPIAdapter.
+//
+// This call blocks until VPP is connected, or an error occurs.
+// Only one connection attempt will be performed.
+func Connect(target string) (*core.Connection, error) {
+ return core.Connect(NewVppAdapter(target))