npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

protoc-h1-plugins

v1.3.15

Published

Protobuf RPC over HTTP 1

Downloads

19

Readme

Protobuf RPC over HTTP 1

Supports all unary RPC calls over HTTP 1.

Generates clients for:

  • .NET Core 3
  • Angular (tested with Angular 6)

Supports server for:

  • PHP via https://github.com/timostamm/protoc-h1-php-server

Default values in JSON: The typescript typings assume that default values are not included in JSON. As of now (dec 2019), protobuf PHP does not support this feature, see https://github.com/protocolbuffers/protobuf/issues/6035

Usage

PHP server

Generate PHP classes for PHP server, includes interface for service and PHP classes for the protobuf types:

protoc --proto_path=example/protos \
    --php_out=example/out-php \
    example/protos/*.proto

Use timostamm/protoc-h1-php-server to serve.

dotnet client for the PHP server

Run npm install protoc-h1-plugins to install the plugins. Generate C# code for the protobuf types and the dotnet client:

protoc --proto_path=example/protos \
    --plugin=node_modules/.bin/protoc-gen-h1c-dotnetcore \
    --h1c-dotnetcore_out=example/out-csharp \
    --csharp_opt=base_namespace= \
    --csharp_out=example/out-csharp \
    --csharp_opt=base_namespace= \
    example/protos/*.proto

angular client for the PHP server

Generates typescript interfaces for all protobuf messages, generates client using angular´s http client.

protoc --proto_path=example/protos \
    --plugin=node_modules/.bin/protoc-gen-h1c-angular \
    --h1c-angular_out=example/out-angular \
    example/protos/*.proto

angular client for the PHP server

TODO

  • Support typescript typings for JSON with included default values, once PHP supports outputting them:

    • int32, uint32, int64, uint64, double, float: always present, default value 0
    • bytes: always present, default value ""
    • bool: always present, default value false
    • map: always present, default value {}
    • repeated fields: always present, default value []
    • message fields: always present, default value null
    • enum fields: always present, default value = name of first enum value (string)
  • C# client: Client-wide option to send binary or json.

  • C# client: Client-wide option: factory for accept headers, taking proto and bin/json flag as argument, returning enumerable of acceptable type (and quality), validate response.

  • C# client: Default accept headers factory:

    When sending binary: application/protobuf; proto=..., application/protobuf, application/json; proto=..., application/json

    When sending json: application/json; proto=..., application/json, application/protobuf; proto=..., application/protobuf

  • C# client: Always POST.

  • Support HTTP configuration via annotations:

    https://github.com/googleapis/googleapis/blob/master/google/api/http.proto

    https://github.com/googleapis/googleapis/blob/master/google/api/annotations.proto

  • Implement PHP client?