aboutsummaryrefslogtreecommitdiffstats
path: root/examples/simple-client/simple_client.go
AgeCommit message (Collapse)AuthorFilesLines
2022-08-02Change module name to go.fd.io/govppHEADv0.6.0-alphamasterNathan Skrzypczak1-9/+9
We are changing the module name from git.fd.io/govpp.git to go.fd.io/govpp to make repository migration easier. Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com> Change-Id: Idd6e0d583a92f6b82fe9adeffd026cd6b856038b
2020-10-30Stats API: added GetMemory()Vladimir Lavor1-4/+4
Retrieved numbers relate to the statseg heap. Change-Id: I72750183db3524481918c71c993b39e65c28ddb6 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-10-30Fix encoding for float64 and generate conversion for TimestampOndrej Fabry1-0/+17
- fixes encoding/decoding of float64 - uses little endian (contrary to all other types) - generates helper methods for vpe_types.Timestamp type - adds usage code to simple-client and binapi-types examples Change-Id: I2e83eee0629eb67964049406c50c7ee0a692ccaf Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-10-15Stream API optionsVladimir Lavor1-81/+29
* Stream API uses the same default values as the Channel API * request size, reply size and reply timeout settable using functional options * Added stream client example to show the stream API usage Change-Id: Id599134a7f520fc19f7d770ed5e3de74a7936829 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-07-22Fix binapigen decoding and minor improvementsOndrej Fabry1-1/+3
- fixed allocating byte slices before copying decoded data - simplified encoding functions - several minor improvements Change-Id: I6669424b89eb86333805cb1b57e4551169980cc2 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-07-17Improve binapi generatorOndrej Fabry1-7/+22
- simplified Size/Marshal/Unmarshal methods - replace struc in unions with custom marshal/unmarshal - fix imports in generated files - fix mock adapter - generate rpc service using low-level stream API (dumps generate control ping or stream msg..) - move examples/binapi to binapi and generate all API for latest release - add binapigen.Plugin for developing custom generator plugins - optionally generate HTTP handlers (REST API) for RPC services - add govpp program for browsing VPP API Change-Id: I092e9ed2b0c17972b3476463c3d4b14dd76ed42b Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-07-02Binary API generator improvementsVladimir Lavor1-8/+8
* Many aliases removed, aliased types reference original types via import instead * Added various helper methods for simpler conversion between go and vpp types Change-Id: I7999ac8d524cece4da03e6447b13421659765095 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2020-06-25Introduce Stream - experimental API for low-level access to VPP APIOndrej Fabry1-4/+45
Change-Id: I2698e11b76ff55d9730b47d4fee990be93349516 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-06-24Fix codec fallback and generate type importsOndrej Fabry1-3/+5
Change-Id: Idd76c7f19d952939caf153928ac60175845078ff Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-06-22Refactored binapi generator with message encodingOndrej Fabry1-7/+5
Change-Id: I5a6abb68b9d058866f94818169300e5c2fc43895 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-06-16Optimize socketclient adapter and add various code improvementsOndrej Fabry1-31/+47
This commit includes: Features - optimized [socketclient](adapter/socketclient) adapter and add method to set client name - added list of compatible messages to `CompatibilityError` Fixes - `MsgCodec` will recover panic occurring during a message decoding - calling `Unsubscibe` will close the notification channel Other - improved log messages to provide more relevant info Examples - added more code samples of working with unions in [union example](examples/union-example) - added profiling mode to [perf bench](examples/perf-bench) example - improved [simple client](examples/simple-client) example to work properly even with multiple runs Dependencies - updated `github.com/sirupsen/logrus` dep to `v1.6.0` - updated `github.com/lunixbochs/struc` dep to `v0.0.0-20200521075829-a4cb8d33dbbe` Change-Id: I136a3968ccf9e93760d7ee2b9902fc7e6390a09d Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2020-03-18Fix import path in examples/binapiv0.3.1Ondrej Fabry1-14/+9
Change-Id: I6af1ae2778b73f37be09c64a2948417e576f02ab Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-11-15Improve compatibility checkingOndrej Fabry1-0/+4
- added CompatibilityError to api package to represent error with list of incompatible messages - added UnknownMsgError to adapter package to represent error for unknown message - added list of registered message types Change-Id: I2623b45135521d52612ba91e4605fc064a7fc76e Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-09-09Fix compatibility with latest master (20.01-rc0)Ondrej Fabry1-120/+106
- fixed generator for new string types - update simple client example - regenerate examples binapi for VPP 19.08 Change-Id: If4fe78c130d95641f35f75cd0262b35b032acaf8 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-09-09Use new default binapi socket with fallback to legacyOndrej Fabry1-1/+1
Change-Id: I1a6839e3bbb8d599fcbdbc2b1aff7c81f7d263c9 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-06-27Improvements for binapi-generator and support VPP 19.04 in statsclientOndrej Fabry1-8/+15
- RPC service client implementation for dumps requests now streams responses - RPC service generation is now enabled by default - examples now allow setting binapi socket address - input dir flag for binapi-generator will recursively look into dirs to support core/plugins in /usr/share/vpp/api - minor improvements in debug logs - add support for VPP 19.04 for statsclient Change-Id: I0939ee3aa6e9f850d073fc5c87aff4ccc56b0d70 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-06-06Add various generator improvementsOndrej Fabry1-3/+3
- generate service implementation for modules - generate conversion maps and String() method for enums - generate module name and version as constants - rename Union_data field to XXX_UnionData for consistency - generate constant GoVppAPIPackageIsVersionN for checking compatibility with API - add example for using service clients - add some documentation to socketclient adapter - cleanup gen.go file used for generating binapi - regenerate binapi with latest VPP release (19.04.1) - change global variables Messages into a function AllMessages Change-Id: Id1ef97764570759eaa3e5a4dc14ecda7a168ee39 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-04-04fix govpp, add more checks to makefileVladimir Lavor1-1/+1
Change-Id: Ie118b0c254e5d70e66d5cb4a5f6eb8fa852f0ed8 Signed-off-by: Vladimir Lavor <vlavor@cisco.com>
2019-02-08Add support for using multiple generated versionsOndrej Fabry1-1/+9
- added CheckCompatibility for checking if given messages are compatible - generating Messages global for easier usage of compatibility check - added ReconnectInterval and MaxReconnectAttempts for reconnecting - added Failed state that is sent after exceeding max reconnect attempts Change-Id: I1062ba453f22657c1a2a31aa64cb103ef1223b0f Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
2019-02-08Generator improvements and cleanupOndrej Fabry1-0/+271
- generator now supports include-comments flag (as opt-in) - minor code cleanup in binapi-generator - remove obsolete unit tests - flatten examples from examples/cmd folder - introduce constant for checking compatibility in future versions Change-Id: I3545f2ba4b869a3b51d6d0de7e742f3f1e1be392 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>