aboutsummaryrefslogtreecommitdiffstats
path: root/adapter/vppapiclient/vppapiclient_stub.go
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2018-10-23 13:20:31 +0200
committerOndrej Fabry <ofabry@cisco.com>2018-10-23 13:20:31 +0200
commit6d6ad42ec0942a378c5550ad3472f388d7c85d49 (patch)
treec938eca12ca683335a518e6c0bcf7df3c00cea1f /adapter/vppapiclient/vppapiclient_stub.go
parentc00356ec332203f353fcd5f5992226940d90da92 (diff)
Unexport adapter implementations to make it clear that API interfaces should be used
- this decision was made to follow more idiomatic Go, described in https://golang.org/doc/effective_go.html#generality Change-Id: I341556c792df77ca35a60a1e4afc541482f23734 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'adapter/vppapiclient/vppapiclient_stub.go')
-rw-r--r--adapter/vppapiclient/vppapiclient_stub.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/adapter/vppapiclient/vppapiclient_stub.go b/adapter/vppapiclient/vppapiclient_stub.go
index 6de89a7..c5566c6 100644
--- a/adapter/vppapiclient/vppapiclient_stub.go
+++ b/adapter/vppapiclient/vppapiclient_stub.go
@@ -20,34 +20,34 @@ import (
"git.fd.io/govpp.git/adapter"
)
-// VppClient is just an stub adapter that does nothing. It builds only on Windows and OSX, where the real
+// stubVppClient is just an stub adapter that does nothing. It builds only on Windows and OSX, where the real
// VPP binary API client adapter does not build. Its sole purpose is to make the compiler happy on Windows and OSX.
-type VppClient struct{}
+type stubVppClient struct{}
-func NewVppAdapter(string) *VppClient {
- return &VppClient{}
+func NewVppClient(string) adapter.VppAPI {
+ return &stubVppClient{}
}
-func (a *VppClient) Connect() error {
+func (a *stubVppClient) Connect() error {
return adapter.ErrNotImplemented
}
-func (a *VppClient) Disconnect() error {
+func (a *stubVppClient) Disconnect() error {
return nil
}
-func (a *VppClient) GetMsgID(msgName string, msgCrc string) (uint16, error) {
+func (a *stubVppClient) GetMsgID(msgName string, msgCrc string) (uint16, error) {
return 0, nil
}
-func (a *VppClient) SendMsg(clientID uint32, data []byte) error {
+func (a *stubVppClient) SendMsg(clientID uint32, data []byte) error {
return nil
}
-func (a *VppClient) SetMsgCallback(cb adapter.MsgCallback) {
+func (a *stubVppClient) SetMsgCallback(cb adapter.MsgCallback) {
// no op
}
-func (a *VppClient) WaitReady() error {
+func (a *stubVppClient) WaitReady() error {
return adapter.ErrNotImplemented
}