converter

package
v0.0.0-...-c21b5ec Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConverterTemplate = template.Must(template.New("").Funcs(map[string]interface{}{
	"UsecaseParamsToProtoConverter": UsecaseParamsToProtoConverter,
	"UsecaseParamsToProtoParser":    UsecaseParamsToProtoParser,
	"plus":                          func(a, b int) string { return strconv.Itoa(a + b) },
	"PrintImports":                  PrintImports,
}).Parse(strings.TrimSpace(`
// Code generated ; DO NOT EDIT

package {{ .GoPackageName }}

{{PrintImports .}}

{{UsecaseParamsToProtoConverter .}}
{{UsecaseParamsToProtoParser .}}
`)))

Functions

func PrintImports

func PrintImports(param TemplateParam) string

func ResolveImport

func ResolveImport(param TemplateParam) map[string]string

func UsecaseParamsToProtoConverter

func UsecaseParamsToProtoConverter(rootParam TemplateParam) string

func UsecaseParamsToProtoParser

func UsecaseParamsToProtoParser(rootParam TemplateParam) string

Types

type TemplateParam

type TemplateParam struct {
	GoPackagePath        string
	GoProtoPackagePath   string
	GoUsecasePackagePath string
	Usecases             []genapi.Usecase
}

func (TemplateParam) GoPackageName

func (p TemplateParam) GoPackageName() string

func (TemplateParam) GoProtoPackageName

func (p TemplateParam) GoProtoPackageName() string

func (TemplateParam) GoProtoPackageNameWithDotOrBlank

func (p TemplateParam) GoProtoPackageNameWithDotOrBlank() string

func (TemplateParam) GoUsecasePackageName

func (p TemplateParam) GoUsecasePackageName() string

func (TemplateParam) GoUsecasePackageNameWithDotOrBlank

func (p TemplateParam) GoUsecasePackageNameWithDotOrBlank() string

Jump to

Keyboard shortcuts

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