• Stars
    star
    142
  • Rank 249,359 (Top 6 %)
  • Language
    F#
  • License
    Other
  • Created over 5 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generates F# code from protobuf schema for binary and json format

Build Status NuGet

Falanx code generation

This repository contains the code generator to generate F# source (.fs files) from Protobuf v3 schema.

The general concepts are as follows:

  • Code generation, to generate F# source code, rather than types being injected as a type provider.
  • Idiomatic F# code is generated rather than simple .NET 1.1 era code. This means records, discriminated unions, etc., are generated where appropriate.

How to use

In a .NET Sdk library project, add the following packages

<PackageReference Include="Falanx.Proto.Codec.Binary" Version="0.5.*" />
<PackageReference Include="Falanx.Proto.Codec.Json" Version="0.5.*" />
<PackageReference Include="Falanx.Sdk" Version="0.5.*" PrivateAssets="All" />

It's possibile to use only one of Falanx.Proto.Codec.Binary and Falanx.Proto.Codec.Json or both, the generated code will depends on the packages referenced

Now specify the .proto file path like

  <ItemGroup>
    <ProtoFile Include="..\proto\bundle.proto" />
  </ItemGroup>

and an auto generated file will be created on build

More info in example-sdk/README.md

Template

Install the .NET template for an example library sample

dotnet new -i Falanx.Templates
dotnet new falanx

use --codec argument to specify the codecs (values json,binary,all)

Tool

It's possibile to use falanx as command line .NET global tool

dotnet tool install -g Falanx.Tool
falanx --help

To generate a .fs file for a specified .proto file:

falanx --inputfile test\examples\schemas\bundle.proto --defaultnamespace test --outputfile bundle.fs

More info in example\README.md

How to build Falanx

More info in docs/developer_guide.md

Use the src/Falanx.sln solution for development, or directly the projects with .NET Core Sdk (dotnet).

Projects:

  • src/Falanx.Tool the falanx console app, run with dotnet run
  • test/Falanx.Tests the unit test, run with dotnet run
  • test/Falanx.IntegrationTests the integration tests, run with dotnet run

As shortcuts, from root:

  • dotnet build to build the falanx executable Falanx.Tool.
  • dotnet pack to generate packages in bin/nupks
  • dotnet test -v n to run tests

To build packages

From root

dotnet pack

The nupkgs will be in bin/nupkg

To specify a version pass the Version property like /p:Version=0.1.0-alpha7

Info

Falanx uses:

  • Type Provider SDK common type for quotation and AST support
  • FsAst untyped F# AST to code via the code formatter Fantomas
  • Froto protobuf parser and binary serializer
  • Fantomas code formatter and linter

Security

This repository is actively monitored by Jet Engineers and the Jet Security team. Please monitor this repo for security updates and advisories. For more information and contacts, please see SECURITY

More Repositories

1

equinox

.NET event sourcing library with CosmosDB, DynamoDB, EventStoreDB, message-db, SqlStreamStore and integration test backends. Focused at stream level; see https://github.com/jet/propulsion for cross-stream projections/subscriptions/reactions
F#
451
star
2

propulsion

.NET event stream projection and scheduling platform with CosmosDB, DynamoDB, EventStoreDB, MemoryStore, message-db, Equinox and Kafka integrations
F#
171
star
3

kafunk

Kafunk: F# Kafka client
F#
162
star
4

kube-webhook-certgen

Tools to help with self signed cert generation for Kubernetes test environment
Go
134
star
5

FsKafka

Minimal F# wrappers for Confluent.Kafka+librdkafka.redist 1.x
F#
85
star
6

FsCodec

F# Event-Union Contract Encoding with versioning tolerant converters supporting System.Text.Json and Newtonsoft.Json
F#
84
star
7

damon

Supervisor program to constrain Windows executables running under Nomad's raw_exec driver
Go
83
star
8

dotnet-templates

Example app and service templates `dotnet new -i Equinox.Templates; dotnet new eqx*/pro*` https://github.com/jet/equinox https://github.com/jet/FsCodec
F#
63
star
9

nomad-service-alerter

Alerting for Nomad Jobs
Go
36
star
10

CallPolly

Apply systemwide resilience strategies consistently across subsystems, standing on Polly's shoulders
F#
16
star
11

XRay

Our distributed tracing library https://jet.github.io/XRay/
F#
16
star
12

Vertigo.Json

A reflection-based JSON (de)serialization library written in and for F#
F#
13
star
13

Microservice-Edge-Testing-Example

A sample implementation of complex microservice edge testing using distributable fakes
F#
13
star
14

baybars

Common Python library for interacting various third party infrastructure(Azure, Nomad, Kafka, Vault, Consul) that we use at Jet
Python
8
star
15

apidiff

Check your API surface
F#
5
star
16

wiremock-admin-api-client

An F# client for the WireMock Admin API
F#
5
star
17

go-interstellar

A Go client for interacting with the REST/SQL API of CosmosDB
Go
4
star
18

oms.infrastructure-talk

Demo code for Open F# in San Francisco
F#
3
star
19

go-mantis

A "standard library" for Jet's Golang codebase
Go
2
star