Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jcpsantiago/protopretzel
🥨0100110🥨 Protocol Buffers for Plumber APIs
https://github.com/jcpsantiago/protopretzel
api plumber protocol-buffers r shared-lib
Last synced: about 1 month ago
JSON representation
🥨0100110🥨 Protocol Buffers for Plumber APIs
- Host: GitHub
- URL: https://github.com/jcpsantiago/protopretzel
- Owner: jcpsantiago
- License: other
- Created: 2019-02-22T16:38:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-24T09:10:27.000Z (over 5 years ago)
- Last Synced: 2024-06-05T02:34:58.494Z (4 months ago)
- Topics: api, plumber, protocol-buffers, r, shared-lib
- Language: R
- Homepage:
- Size: 86.9 KB
- Stars: 9
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - jcpsantiago/protopretzel - 🥨0100110🥨 Protocol Buffers for Plumber APIs (R)
README
[![Travis build status](https://travis-ci.org/ozean12/protopretzel.svg?branch=master)](https://travis-ci.org/ozean12/protopretzel)
[![Coverage status](https://codecov.io/gh/ozean12/protopretzel/branch/master/graph/badge.svg)](https://codecov.io/github/ozean12/protopretzel?branch=master)
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)# protopretzel
[Protocol Buffers](https://developers.google.com/protocol-buffers/) filter and
serializer for [Plumber](https://www.rplumber.io/).The **ProtoBuf filter** will unserialize ProtoBuf messages according
to the `messagetype` set in the request header
(e.g. `Content-Type: application/x-protobuf; messagetype=prototest.TestPayload`),
and matching a `.proto` descriptor file.The **ProtoBuf serializer** serializes an [RProtoBuf](https://github.com/eddelbuettel/rprotobuf)
message descriptor object, adding the type of message to the response header.`protopretzel` is under active development and things may break. Check out the [protopretzel-playground](https://github.com/ozean12/protopretzel-playground) for an example implementation.
## Installation
You can install the current development version of protopretzel with:
``` r
# install.packages("devtools")
devtools::install_github("ozean12/protopretzel")
```## Example
``` r
library(plumber)
library(protopretzel)# Needs to be added before API creation
addProtobufSerializer()api <- plumber$new("api.R")
addProtobufFilter(api, descriptor_path = "prototest.proto")
api$run(host = "0.0.0.0", port = 8000)
```