generator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Generate

func Generate(pattern string, mapping []comments.Converter, config Config) (*jen.File, error)

Types

type Config

type Config struct {
	Name string
}

type Generator

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

func (*Generator) AppendToFile

func (g *Generator) AppendToFile()

func (*Generator) Build

func (g *Generator) Build(ctx *builder.MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *builder.Error)

func (*Generator) BuildNoLookup

func (g *Generator) BuildNoLookup(ctx *builder.MethodContext, sourceID *xtype.JenID, source, target *xtype.Type) ([]jen.Code, *xtype.JenID, *builder.Error)

type Method

type Method struct {
	ID            string
	Explicit      bool
	Name          string
	Call          *jen.Statement
	Source        *xtype.Type
	Target        *xtype.Type
	Mapping       map[string]string
	IgnoredFields map[string]struct{}

	Jen jen.Code

	SelfAsFirstParam bool
	ReturnError      bool
	ReturnTypeOrigin string
	Dirty            bool
}

Jump to

Keyboard shortcuts

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