Closed
Description
Now the main package has some constants:
https://github.com/tarantool/go-tarantool/blob/v1.10.0/const.go
But the approach has disadvantages:
- Not all constants refer to the IPROTO protocol.
- It is not always obvious how these constants relate to IPROTO. As example, what is
KeyFetchPos
? It isIPROTO_FETCH_POSITION
, but I can't confirm this without looking at the Tarantool code. As example, this mismatch of names is confusing when you read this document and try to create a request/parse a response. - The file is edited manually, it contains only what is needed for the connector.
- v2: update public API #158
It would be nice:
- To create a separate package (as a part of the connector
https://github.com/tarantool/go-tarantool/iproto
or as a separate packagehttps://github.com/tarantool/go-iproto
with a separate lifecycle). - Periodically auto-generate IPROTO constants from
tarantool/src/box/iproto_{constants, features}.h
with a custom generator for the package. - An update requires as few manual actions as possible (start a job on GitHub Actions?). But we could start with
Makefile
targets.
See also:
tarantool/tarantool#7103
tarantool/tarantool#7951
https://go.dev/blog/generate
The idea is a part of a discussion with @unera :
https://www.notion.so/tarantool/Go-replicator-API-d9c982f15df044ee95d5d7d9d1b5505b