diff options
author | Ondrej Fabry <ofabry@cisco.com> | 2018-10-23 13:20:31 +0200 |
---|---|---|
committer | Ondrej Fabry <ofabry@cisco.com> | 2018-10-23 13:20:31 +0200 |
commit | 6d6ad42ec0942a378c5550ad3472f388d7c85d49 (patch) | |
tree | c938eca12ca683335a518e6c0bcf7df3c00cea1f /adapter/vppapiclient/stat_client_stub.go | |
parent | c00356ec332203f353fcd5f5992226940d90da92 (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/stat_client_stub.go')
-rw-r--r-- | adapter/vppapiclient/stat_client_stub.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/adapter/vppapiclient/stat_client_stub.go b/adapter/vppapiclient/stat_client_stub.go index 24f7e13..b42619c 100644 --- a/adapter/vppapiclient/stat_client_stub.go +++ b/adapter/vppapiclient/stat_client_stub.go @@ -20,26 +20,26 @@ import ( "git.fd.io/govpp.git/adapter" ) -// StatClient is just an stub adapter that does nothing. It builds only on Windows and OSX, where the real +// stubStatClient is just an stub adapter that does nothing. It builds only on Windows and OSX, where the real // VPP stats API client adapter does not build. Its sole purpose is to make the compiler happy on Windows and OSX. -type StatClient struct{} +type stubStatClient struct{} -func NewStatClient(socketName string) *StatClient { - return new(StatClient) +func NewStatClient(socketName string) adapter.StatsAPI { + return new(stubStatClient) } -func (*StatClient) Connect() error { +func (*stubStatClient) Connect() error { return adapter.ErrNotImplemented } -func (*StatClient) Disconnect() error { +func (*stubStatClient) Disconnect() error { return nil } -func (*StatClient) ListStats(patterns ...string) (statNames []string, err error) { +func (*stubStatClient) ListStats(patterns ...string) (statNames []string, err error) { return nil, adapter.ErrNotImplemented } -func (*StatClient) DumpStats(patterns ...string) ([]*adapter.StatEntry, error) { +func (*stubStatClient) DumpStats(patterns ...string) ([]*adapter.StatEntry, error) { return nil, adapter.ErrNotImplemented } |