Skip to content

Package with IPROTO constants #267

Closed
tarantool/go-iproto
#1
@oleg-jukovec

Description

@oleg-jukovec

Now the main package has some constants:

https://github.com/tarantool/go-tarantool/blob/v1.10.0/const.go

But the approach has disadvantages:

  1. Not all constants refer to the IPROTO protocol.
  2. It is not always obvious how these constants relate to IPROTO. As example, what is KeyFetchPos? It is IPROTO_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.
  3. The file is edited manually, it contains only what is needed for the connector.
  4. v2: update public API #158

It would be nice:

  1. To create a separate package (as a part of the connector https://github.com/tarantool/go-tarantool/iproto or as a separate package https://github.com/tarantool/go-iproto with a separate lifecycle).
  2. Periodically auto-generate IPROTO constants from tarantool/src/box/iproto_{constants, features}.h with a custom generator for the package.
  3. 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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions