proto

package
v0.0.0-...-ac4bb89 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConvertedField

type ConvertedField struct {
	Field       *types.Field
	Indexes     []types.Index
	ForeignKeys []types.ForeignKey
	ExtraTables []types.Table
}

ConvertedField is the converted form of protogen.Field, containing information on items to add to integrate the field into the schema.

type Converter

type Converter struct {
	// Packages maps file paths to the package of the file.
	Packages map[string]*protogen.File
}

Converter is a struct containing configuration to convert a parsed protoc file to Go types.

func (Converter) ConvertEnum

func (c Converter) ConvertEnum(protoEnum *protogen.Enum) (types.Enum, error)

ConvertEnum converts the specified protobuf enum to a types enum.

func (Converter) ConvertField

func (c Converter) ConvertField(field *protogen.Field) (*ConvertedField, error)

ConvertField converts the provided protogen.Field to ConvertedField.

func (Converter) ConvertMessage

func (c Converter) ConvertMessage(pkg *protogen.File, msg *protogen.Message) ([]types.Table, error)

ConvertMessage converts the provided protogen message to xo tables. The first table always represents the actual message.

func (Converter) TableName

func (c Converter) TableName(pkg *protogen.File, name string, plural bool) string

TableName returns the table name of the package and name pair.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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