Coder Social home page Coder Social logo

Comments (4)

hultqvist avatar hultqvist commented on May 31, 2024

Can you provide a sample .proto to show the functionality needed?

from protobuf.

furesoft avatar furesoft commented on May 31, 2024
package com.Furesoft;

message Uri {    
      optional string scheme = 1 [default = "http"];
      optional int32 port = 2 [default = 80];
      required string host = 3;

      optional Path path = 4;

      optional Credentials Credentials = 5;

      extensions 6 to max;

      message Credentials {
        required string username = 1;
        required string password = 2;
      }

      message Path  {
        optional string file = 1;
        optional string query = 2;
        optional string segment = 3;
        optional string folder = 4;
      }
}

extend Uri {
    required int32 id = 7;
}

but there is no code for the extended stuff

from protobuf.

furesoft avatar furesoft commented on May 31, 2024

here a sample usage

uri.SetExtension(Fields.id, 5);

uri.GetExtension(Fields.id);

from protobuf.

hultqvist avatar hultqvist commented on May 31, 2024

At code generation time this is all statically known so one could have the property

uri.ExtensionId

or even more directly(assuming there are no name collisions)

uri.Id

Would the deserializer have to be more forgiving since some other implementation might have been using other wire-types with the same extension id?

from protobuf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.