compiler

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package compiler contains tools to take openapi.* definitions and compile them into protobuf.* structures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(spec *openapi.Spec, options ...Option) (*protobuf.Package, error)

Compile takes an OpenAPI spec and compiles it into a protobuf.Package.

Types

type Option

type Option = option.Option

Option is used to pass options to several methods

func WithAnnotation

func WithAnnotation(b bool) Option

WithAnnotation creates a new Option to specify if we should add google.api.http annotation to the compiled Protocol Buffers structure

func WithPrefixEnums added in v0.2.1

func WithPrefixEnums(b bool) Option

prefix enum values with their enum name to prevent protobuf namespacing issues

func WithSkipRpcs added in v0.2.1

func WithSkipRpcs(b bool) Option

WithSkipRpcs creates a new Option to specify if we should generate services and rpcs in addition to messages

type Parameter

type Parameter struct {
	protobuf.Type
	// contains filtered or unexported fields
}

Parameter is used to represent a parameter.

func (*Parameter) ParameterName

func (p *Parameter) ParameterName() string

ParameterName returns the parameter name

func (*Parameter) ParameterNumber

func (p *Parameter) ParameterNumber() int

ParameterNumber returns the number to be assigned

func (*Parameter) ParameterType

func (p *Parameter) ParameterType() protobuf.Type

ParameterType returns the underlying protobuf.Type

func (*Parameter) Repeated

func (p *Parameter) Repeated() bool

Repeated returns true if this parameter can be repeated

Jump to

Keyboard shortcuts

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