protobuf

package
v0.2.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package protobuf generates a proto3 schema from a resolved model, or one under the edition an `edition` directive names.

docs/design/schema-backends.md has the mapping and the reasons for it. Two things are worth knowing before reading the output. An enum whose variants carry fields is a message holding a oneof of one nested message per variant, which is protobuf's sum type. And every field, variant, and enum value without a `number` directive takes the lowest number no pin holds, in declaration order, because the IR has no numbers and protobuf cannot go without them.

Index

Constants

View Source
const Name = "protobuf"

Name is what this backend is called, in a target block and as tdl-gen-protobuf on PATH.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct{}

Backend implements plugin.Backend.

func (Backend) Describe

func (Backend) Describe() plugin.Description

func (Backend) Generate

func (Backend) Generate(_ context.Context, req *plugin.Request) (*plugin.Response, error)

Generate returns a .proto file per file name the model's declarations are placed in.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL