test:
@echo "=> running tests"
go test -cover ./cmd/...
- go test -cover ./core ./api ./codec
+ go test -cover ./ ./adapter ./core ./api ./codec
extras:
@echo "=> building extras"
fmt.Println("Starting simple VPP client...")
// connect to VPP
- conn, conev, err := govpp.AsyncConnect("")
+ conn, conev, err := govpp.AsyncConnect("", core.DefaultMaxReconnectAttempts, core.DefaultReconnectInterval)
if err != nil {
log.Fatalln("ERROR:", err)
}
"git.fd.io/govpp.git/adapter"
"git.fd.io/govpp.git/adapter/vppapiclient"
"git.fd.io/govpp.git/core"
+ "time"
)
var (
// This call does not block until connection is established, it returns immediately. The caller is
// supposed to watch the returned ConnectionState channel for Connected/Disconnected events.
// In case of disconnect, the library will asynchronously try to reconnect.
-func AsyncConnect(shm string) (*core.Connection, chan core.ConnectionEvent, error) {
- return core.AsyncConnect(getVppAdapter(shm))
+func AsyncConnect(shm string, attempts int, interval time.Duration) (*core.Connection, chan core.ConnectionEvent, error) {
+ return core.AsyncConnect(getVppAdapter(shm), attempts, interval)
}