golangimporter

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command() (cli.Command, error)

Command is a cli.CommandFactory

Types

type GolangImporter

type GolangImporter struct {
	Importer *importers.Importer

	InterfacesAsAny bool
	// contains filtered or unexported fields
}

GolangImporter go through a package and extract its structs to proto files

func NewGolangImporter

func NewGolangImporter(pkg, outputDir, goSrcPath string, env ...string) (*GolangImporter, error)

NewGolangImporter creates a new GolangImporter

func (*GolangImporter) GetFileNameFor

func (p *GolangImporter) GetFileNameFor(pkgName, pkgID string) string

GetFileNameFor will assist the command line to detect the file of the top config struct

func (*GolangImporter) GetImporter

func (p *GolangImporter) GetImporter() *importers.Importer

GetImporter returns the importers.Importer generated by GolangImporter

func (*GolangImporter) GetMessageFromFile

func (p *GolangImporter) GetMessageFromFile(filename, messageName string) *builder.MessageBuilder

GetMessageFromFile is a facility that helps filter the files to import

func (*GolangImporter) SetTargetTags

func (p *GolangImporter) SetTargetTags(tags []string)

SetTargetTags allows setting the go tag names in struct to be used as `json_name` and protobuf key name

func (*GolangImporter) Visit

func (p *GolangImporter) Visit()

Visit will run the packages visit logic

Jump to

Keyboard shortcuts

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