gengateway

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Options
	// contains filtered or unexported fields
}

func New

func New(descriptorRegistry *descriptor.Registry, options Options) *Generator

func (*Generator) CheckDuplicateEndpoint

func (g *Generator) CheckDuplicateEndpoint(
	method, pathTemplate string, service *descriptor.Service) error

func (*Generator) Generate

func (g *Generator) Generate(targets []*descriptor.File) ([]*descriptor.ResponseFile, error)

type Options

type Options struct {
	// RegisterFunctionSuffix is used to construct names of the generated Register*<Suffix> methods.
	RegisterFunctionSuffix string

	// UseHTTPRequestContext controls whether or not HTTP request's context gets used.
	UseHTTPRequestContext bool

	// RepeatedPathParameterSeparator determines how repeated fields should be split when used in path segments.
	RepeatedPathParameterSeparator descriptor.PathParameterSeparator

	// AllowPatchFeature determines whether to use PATCH feature involving update masks
	// (using using google.protobuf.FieldMask).
	AllowPatchFeature bool

	// OmitPackageDoc indicates whether or not package commments should be included in generated code.
	OmitPackageDoc bool

	// Standalone generates a standalone gateway package, which imports the target service package.
	Standalone bool

	// GenerateLocal generates code to work a server implementation directly.
	GenerateLocal bool
}

Options are the options for the code generator.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns the default options.

Jump to

Keyboard shortcuts

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