Skip to content

Generate a custom function.  #773

Description

@salemmohammed

Hi,

I need to create a custom function that becomes a part of the generated code. Below is my IDL file. I want BatchRequest1 to be handled by a custom function. This function should then be integrated into the generated code. How can I accomplish this?

syntax = "proto3";
package cockroach.roachpb;
option go_package = "github.com/cockroachdb/cockroach/pkg/kv/kvpb";
import "gogoproto/gogo.proto";
import "google/protobuf/descriptor.proto";

// Define a custom option to specify whether a message should be intercepted.
extend google.protobuf.MessageOptions {
bool intercept = 1000;
}

message BatchRequest1 {
option (intercept) = true; // Annotate the message with the custom option to specify interception.
string key1 = 1;
}

message BatchResponse1 {
string key2 = 1;
}

// Batch and RangeFeed service implemented by nodes for KV API requests.
service Internal1 {
rpc Batch1 (BatchRequest1) returns (BatchResponse1) {}
}

Thank you all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions