Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help on Adding more Methods in API , for grpc #1290

Open
alidehghan opened this issue Dec 30, 2024 · 2 comments
Open

Help on Adding more Methods in API , for grpc #1290

alidehghan opened this issue Dec 30, 2024 · 2 comments

Comments

@alidehghan
Copy link

I am using grpc (started with grpc example), and need to add some more methods in API part (in the example, there is set and get methods, I want to add set_extra1, set_extra2, etc.). I changed proto files and everything looks good, but I don't know what should be set in D part of TypeConfig.

openraft::declare_raft_types!(
pub TypeConfig:
D = THIS ACCEPT JUST ONE METHOD,
R = Response,
Node = Node,
SnapshotData = StateMachineData,
);

Copy link

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

@drmingdrmer
Copy link
Member

D is not a method, it is a type.

https://github.com/datafuselabs/openraft/blob/6908a3cb0f3f7d4481c382bfe68cf4831004cadf/openraft/src/type_config.rs#L60

You should make the type for D a oneof type or something else:

message Requeest {
  oneof request {
    Foo foo = 1;
    Bar bar = 2;
    // ...
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants